Friday, May 31, 2013

Linux distro sampling - Ubuntu GNOME and Kali Linux

I decided to try a few new distros this week after realizing that my current Ubuntu 12.04 install is wrecked. Before picking what to install next on my dual boot machine I decided to try out a couple of things in a VM form. So I downloaded VirtualBox, installed that, changed my BIOS to be able to run a virtual machine and off I went installing Ubuntu Gnome.

Ubuntu GNOME


I had seen a few videos of the distro and read some reviews of Gnome 3 and thought this looks quite nice, looked nicer than KDE and it seemed a bit more practical and fast than Unity. Well after installing it I'm not nearly as impressed as I thought I would be. I don't like a lot of aspect of this version of gnome. I thought I would like the idea of a desktop environment that's simple, clean and minimalist, but I don't. I like the search function of the DE but it's not even as good as Unity at that. Not having minimize and maximize buttons is annoying even if they are not essential. The color scheme is annoying and I can't find a quick way to remediate that without downloading something. I know this is probably not related to my desktop environment, but the software center in this distro has no search function, and that's just abnoxious. I ended up downloading synaptic which I do like but seriously. I'm also not a big fan of the file manager that comes with this distro, Nautilus in my opinion is superior. All in all I think I would go back to the regular Ubuntu as soons as I can unless I do find something better before I make the jump back.

Kali Linux


After trying to get my old copy of Backtrack 5 running on my newer laptop and having a lot of issues to fix I decided to go ahead and download a more recent version of BT which would be BT5R3. Well I discovered in this process that there is a whole new distro that is the next BT called Kali Linux. I did a bit of reading and despite my natural propensity to avoid change I went ahead and downloaded Kali. First thing I noticed was how much smaller the ISO file is compared to BT5. The OS uses KDE and it isn't nearly as sleek looking as BT5 was, but obviously aesthetics of a distro with this kind of purposes is kind of a silly thing to worry about. The bottom line is that I'm extremely impressed with this distro. I don't think I will ever touch BackTrack again after experiencing Kali. It's faster, lighter, does the job with minimal problems. It also took a lot less configuring to get things I needed working to work such as the network adapter. I would strongly recommend anyone using BT to try Kali next chance they have, it's a wonderful change from BT in the sense that it does what you need it to with minimal to no headache. Great move by the developers.


Ubuntu Server 12.04


Since I'm at it and this was something I did recently I figured I'd post it here too... I mentioned in earlier posts that I'm also working with a server distro on my old laptop. I'm using it headless with Putty on my desktop machine. Right now I have it running a samba server which shares any HD attached to my dock, and this week I installed miniDLNA on it to share media over my network to other machines as well as my PS3 (mainly to my PS3 really).

My experience so far with this distro has been very positive. It's so fast even on my old shitty laptop. Working on it through a command line and no GUI has actually been quite an interesting experience. I'm not going to say it's not a bit more challenging to work on it this way (at least for a noob like me), but I feel like I'm learning quite a bit and it just makes the whole experience "cleaner" if you understand what I mean. It's nice having such a minimalist OS running in my server.

Overall (tl:dr)


Ubuntu GNOME 13.04 - I want my unity back, sorry Gnome 3 but it's just not going to work out.
Ubuntu Server 12.04 - Fast and reliable, what else do you need from a server?
Kali Linux 1.0.3 - An upgrade from BT5, I didn't think it was possible. It was love at first ARP spoof.

Tuesday, May 28, 2013

Media Server install on Headless Ubuntu Server 12.04

As I mentioned in a previous post, I've been playing around with Ubuntu Server 12.04 on an old laptop of mine. One of the purposes of putting it together is to stream media over my home network. As I mentioned earlier, I'm running this server headless using Putty. So here is a set of instructions I found to work very well with my install. Credit goes to folks at UbuntuForums.org and damo12 for putting this post together. Another potentially useful link in case there are still questions after this post can be found HERE.

 ----------------------------

Guide to Installing and Running MiniDLNA on an Ubuntu Server

I have recently been experimenting with running MiniDLNA on a headless Ubuntu Server and have hit a few snags. After a lot of search and a few pointers from this and other forums I have finally managed to get it running fine. In case anyone else has this problem I have written this guide to hopefully take some of the pain out of installing and configuring an amazing program.


The Hardware

My server is a headless HP Microserver running Ubuntu 10.04.3 LTS 64 bit edition accessed through Putty and Webmin (www.webmin.com). I have also tried this using a virtual setup using Virtual Box and that also worked fine.

As a receiver, I am using an LG HX806SH Blu-ray player connected to my LAN by a Homeplug adapter. I have also tried using Windows Media Player and they both work fine. I would like to try this with VLC to test it on a Linux desktop but configuring VLC to receive streaming media from a server is beyond me right now.


The Server Setup

The server has a standard headless setup including Samba installed (a combination of Windows and Linux machines share files stored on it). If you need any help installing and using Webmin, I suggest you have a look at the excellent guide at http://www.kelvinwong.ca/2010/05/22/...-04-lts-lucid/.


Installing and Configuring MiniDLNA

For some reason, when I tried to install MiniDLNA, through Putty I received error messages. From reading around, it turns out that this is a common problem as some repositories are missing.

In the end, these commands installed the package:

Code:
sudo apt-get install --reinstall python-software-properties && sudo dpkg-reconfigure python-software-properties

sudo add-apt-repository ppa:stedy6/stedy-minidna
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install minidlna
I would also recommend installing the Webmin MiniDLNA module from https://sourceforge.net/projects/minidlnawebmin/

If you are accessing the server through Webmin and are not sure how to install the module, save it to a local location (such as your desktop on your computer). Select the "Webmin Configuration" module which is under the "Webmin" tab. Select the "Webmin Modules" and choose to load the module “From uploaded file". Once the module has been installed it will be automatically be configured and it will be available under the "Servers" tab.

Once this is installed, you need to configure the MiniDLNA conf file located at /etc/minidlna.conf.

You can use your favourite text editor or if you are accessing this through Webmin, you can use the "Edit" option in "File Manager". If you have installed the Webmin module, you can also change all of the settings from there.

My minidlna.conf file reads as follows:

 [refer to link for the full text, but the only changes I had to made were adding the following]

# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
#   can prepend the type, followed by a comma, to the directory:
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)

media_dir=V,/media/server/server/Media/Films
media_dir=V,/media/server/server/Media/TV
media_dir=V,/media/server/server/Media/Commedy
media_dir=V,/media/server/server/Music/Videos
media_dir=A,/media/server/server/Music/Music
media_dir=P,/media/server/server/Stuff/Pictures

# set this if you want to customize the name that shows up on your clients
friendly_name=MiniDLNA Server

[Basically you need to add the path to the appropriate folders you want to share, and where it says "friendly_name" you can change to something you can easily identify in your network.]

As you can see, I've made a few changes to the standard file:


  • I have added various sources of videos
  • I have changed the name of the server so I can recognise it easily on the network
  • I have moved the location of the database to a location that I backup each day and is shared by Samba (this is for my personal benefit only)
  • I have added extra filenames to the "AlbulmArt" section as I usually call the front cover of an album "Front"

Despite the line “# default presentation url is http address on port 80” MiniDLNA does not have a webpage that it can be controlled from. From what I can gather, this was going to be a future feature that was not completed for whatever reason. However, the Webmin module takes care of everything that you need.

From the "Command Shell" in Webmin or through an SSH session using Putty, you can control MiniDLNA using the commands:

Code:
sudo /etc/init.d/minidlna stop
sudo /etc/init.d/minidlna start
At first run, MiniDLNA will scan all of the folders (and their sub-folders) it has been pointed at and make all of these files available. The scan is extremely quick (less than 10 minutes to scan about 12,000 files).

The Webmin module has a "Restart" button but for some reason (on my set-ups) it does not work properly. It will stop MiniDLNA but when it tries to restart it, it fails. Trying to manually start it using the command "sudo /etc/init.d/minidlna start" after using this "Restart" does not seem to work and the only way I have found to resolve this is to restart the whole server.


Adding or Removing Files of Folders from the Database

In my experience, MiniDLNA tends not to notice if a file has been added or removed from the folders so the database does not update and new files are not shown on your device and old files are still shown even though they have been removed. This seems to be a problem with MiniDLNA and not the receiving soft/hardware. If you change the name of the server, the soft/hardware picks that up fine.

Some people have had success with the command:

Code:
minidlna -R
or by removing the file /tmp/minidlna/files.db and restarting the server using the command:

Code:
rm -rf /tmp/minidlna
Someone else suggested using the command:

Code:
minidlna -R -f /tmp/minidlna.conf
However, I have found the easiest and most successful method is to use the "Rescan" button in the Webmin interface. This button deletes the MiniDLNA database and rescans from scratch. On my system, this new scan took less than 10 minutes to scan about 12,000 files. After the scan, any new files appear in the database and any deleted files are removed.


Outstanding Problems

The only thing I have not been able to get MiniDLNA to do so far is display my photos properly on the Blu-ray player even though they display fine on Windows Media Player. On the Blu-ray, it shows all of the folders where my pictures are stored and even gives me the option to search by camera but when I try to view the pictures or look into the folders, the folders are all empty. This suggests it is something to do with the Blu-ray player and not MiniDLNA however, to be honest this is not an issue for me as my main aim was to stream videos and music and it works perfectly for that.

If anyone can point me to a walkthrough of how to receive streamed videos and music on VLC I would be grateful so I can test this set-up on that and add it to this guide.

I hope you find this guide useful and it takes away some of the headaches I've had with setting up this excellent program.

Thursday, May 23, 2013

Continued rant about capitalism and our imaginary democracy

But what can we do? Well, I may be pinned as an idealist, a socialist (as if that's an insult), a communist or worst for believing what I believe. But I firmly think there are several areas we need to change.


    1. Fair trading - The idea of fair trading is an interesting one to me, looks very appealing, but also feels a bit idealistic. If there was any way to introduce fair trading practices in the world, at least some of the issues raised on my last post would be considered. Fair trading would attempt to provide fair jobs in developing countries. Instead of having people working at almost slave conditions, we would trade with countries like India, China and Bangladesh in a way that may ensure the growth of a middle class, which is the only real driver of prosperity as seen in history. Sounds great, doesn't it? But I did say it also feels a bit idealistic. One of the problems with this idea, is that it would clearly cut down profits. If the main drive for outsourcing cheap labor to these countries is profit, fair trading would diminish the interest in the idea. I believe that this is the main reason the only time you see "fair traded" labels involves food and other exotic commodities. By that I mean, you can't produce coffee as easily in Canada, so we need to export it from the tropics, no other options there so the big players can afford to push for fair trading. With sweatshops, you don't get that. If all of a sudden local business owners in Bangladesh decided that their working conditions isn't good enough, hence they push for fair trade, Wal-Mart and Fresh Co will just go ahead and shop around other desperate countries to provide the same service for cheap.

    2. Rational protectionism - One other way to prevent some of the problems outlined in my last post is to introduce tariffs to products imported from countries like Bangladesh. I don't think a blanket protectionist policy is a good idea, but I do believe that using tariffs to regulate prices of goods that are coming from developing countries and are made from inhumane conditions can help. A capitalist economy has profit at the bottom line, not global or social prosperity. So they don't care if 300 people have to die in Southeast Asia in order to be able to make large profits. What they do care about is profit, and if these profits are getting chopped at the border because of tariffs, that will change their practices. Maybe implement conditional tariffs that try to enforce accountability, so for instance if a falling building would make it so that from now on, Fresh Co will have to pay significant tariffs to our government because of their negligence in choosing appropriate manufacturers. I hope this point isn't mistaken by people, and make them think I don't believe in globalization and free trade, I do, I just think it needs to be done responsibly. I also think accountability isn't a real factor in the free market, so this is one way to add accountability to the picture.

    3. Tax things we don't like - Another way the government can help this situation is by taxing things we don't want, and giving benefits to things we do want. In this situation, one approach would be to give more tax benefits to businesses that hire locally, and contribute fairly to the local economy. This would obviously impact commodity prices, but I just see it as a necessary evil. Nothing in this world is free, so when we pay so little for things, we have to wonder how this is possible. Efficiency is one possible explanation, but another very real explanation involves the fact that people cut corners. Corners that sometimes should not be cut. For instance, in Canada recently, it has made the news that big banking conglomerates have been firing local workers in order to hire, cheaper, temporary replacements from abroad. They use our government programs in order to increase profits while putting Canadians out of work. Again, this is where taxing or giving benefits comes in, our government is rewarding corporations for bad behaviour. To me this is even more of a problem when you start to talk about the whole "trickle down economic policies", which clearly, and I mean, CLEARLY, is complete rubbish. Businesses want to make profit, they don't give a crap about how they treat employees, or how the overall economy is doing. They just want to make money.


    4. Criminalize lobbying - This brings me to my last point. We do not live in a democratic country here in Canada or the USA. We just call it a democracy, but the truth is that when money is involved, the popular opinion isn't a factor. There are two things that move our countries towards changes. These two are money and power. The government and corporations have a complete monopoly of these two commodities, if you will. Corporations make huge loads of money, that they then turn around and pay for lobbying that furthers their agendas. Lobbying is essentially the exchange of dollars for political power. This is where politicians take corporate money, to not only fund their propaganda during election, but also this is the money that moves politics. Money that prevents stricter gun laws in the USA, when 90% of the population supports the motion. It really doesn't matter what people want, if politicians can just sell bits of their influence to corporations, so that they can fund their next election. Elections nowadays are a joke. It's basically a bunch of corporate puppets paying absurd amounts of money to tell us what we want to hear so that we vote for them next time. I mean, just look at the Conservatives in Canada, spending tax payer dollars on advertising to convince us that the Harper government is environmentally conscientious. While at the same time they are developing and destroying the Tar Sans, they are closing down research facilities in Ontario focused on environmental issues and global warming and they are trying to move us away from freedom of research by muzzling Canadian environmental research. So it really pisses me off to see my money being spent to convince me of a complete lie. So people, wake up! While we are all still comfortably employed, living a relatively comfortable life in Canada, our nation is moving in a very terrifying direction. The direction of a plutocratic nation, away from the democracy we like to say we have.

Friday, May 10, 2013

After installing Ubuntu Server 12.04 (a noob's perspective)

Hello everyone, I just finished installing Ubuntu Server 12.04.2 LTS on my spare laptop. I basically am looking to put together a home server for fun. I think this post may be useful to people that are absolute noobs to this stuff since I'm an absolute amateur and I think I may bring up some difficulties that other new users may experience as well...

Anyway, I went through the installation of the OS to my laptop. For this I followed fairly simple instructions from "The Official Ubuntu Server Book, 2nd ed." as well as this (http://www.youtube.com/watch?v=0SgX15CpT64) video found on YouTube. There are other videos as well if needed, but honestly the process of installing the OS is fairly straight forward if you have ever installed Ubuntu before. There is one thing I would say though, when you are installing the server to your machine, I recommend you plug your machine to your router directly before you start. I started off trying to use the wifi, and that just wasn't going to happen, I only later realized that my original challenges were due to this simple fact.

Once you finish installing Ubuntu Server on your machine, reboot it and I would recommend running an update. In order to accomplish this you need to type:

sudo apt-get update
sudo aptitude safe-upgrade

This is of course all done after you have logged in with you username and password. By the way, make sure you don't forget any of the passwords you have for your server since I'm pretty sure you can't get them back later. Also if you are really new to Linux, sudo is the command you use to gain root access, which is sort of like having administrator privileges. Anytime you use "sudo" you need to use your password.

I also added vim to my server by typing

sudo apt-get install vim

I think that if you are completely new to linux commands, another important one to learn is

sudo shutdown -h now

which turns off your server, as well the command to restart your machine:

sudo shutdown -r now

The last thing I would like to mention, which is what you will need if you want to run the server headless (ie. without a keyboard or monitor directly connected to the machine), is that you need some kind of software that allows you access to your server. For that, one of the more popular options is the use of putty.exe which can be obtained at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Once you download putty.exe, run it. There you will type your Host Name or IP address. The hostname is the machine's name you types during the installation of your OS. Make sure SSH is selected in the connection type. This will obviously only work if you have the SSH stuff installed on your server. Save a name for your session, I'm just using the server's name for reference. At this point you can select your session and click "open".

Click yes to the pop up box that will show up (PuTTY Security Alert). At this point you will get a command prompt box, where you can operate your server as if you were typing directly into it. Quite cool really for anyone like me who has never done this before.