Linux Blog

Linux For Everyone!

Filed under: General Linux — TheLinuxBlog.com at 12:12 am on Friday, January 30, 2009

Today, while I was in the shower I was thinking:

“What way do people closely interact with Linux everyday without even knowing it”


With the recent re-regurgitation of the old GNU vs. Cisco case it came to mind that many people use Linux on a daily basis by using their routers. While this is not the best example of Linux in its prime it is a good way to demonstrate the versatility of the Linux operating system. To some, the concept of an operating system running on anything other than the latest and greatest hardware is alien. To Linux users this is part of its beauty.

I personally have two Linux powered routers. The first is a cheapo Belkin that is not very well suited, the second is the better supported WRT54G.

There are many variants of the WRT’s My personal favorite is DD-WRT because this is what I’ve used for a while, and I’m most familiar with it. I have an office with quite a lot of equipment that is somewhat distant from my cable modem and access point. What I use the first router for is a static access point, next to the cable modem, the second router has been re-purposed to be a full time bridge. I encrypted the communications and set up some static IP’s. I have a hundred or so DHCP lease IP’s available for friends and virtual machines. Whats great about this setup is DD-WRT does a great job as a bridge and hardly ever drops. My cable connection has gone out far more times then the bridge, if it ever has at all. I am able to connect many machines to the Internet over wireless while keeping my office communications switched. I do not have any of the hassles of multiple wireless cards with touchy Windows and Linux drivers and random dropped connections. The wireless bridge is so reliable I am able to do VOIP over it, with QoS to ensure that my calls always have priority over streaming media and other network traffic. DD-WRT truly has been the best thing that I’ve ever done to my routers and is really a great replacement for the Linksys junkware.

With this in mind next time your dearest Windows zealot complains about the stability of their Small/Home Office router, perhaps taking a stab at the stability of Linux (if their router even runs it) how about you educate them on the versatility of Linux. If you like, you could walk them through the very easy steps of installing a WRT variant onto the router (if possible) and enable Linux’s full potential to shine through.

Reasons Why You Should Jailbreak YOUR iPhone

Filed under: General Linux — TheLinuxBlog.com at 12:10 am on Wednesday, January 28, 2009



I’m pretty sure that most Linux users understand what jailbreaking the iPhone is. For those that don’t in short its a way of breaking the restrictions Apple put on your phone, which allows you to escape the sandbox and do more with the phone.

Sure, jailbreaking may void your warranty (or may not) but why would you want to do it? Well the first and foremost reason is freedom.
Some of the greatest organizations in the open source industry were spawned from the inability to work with a particular device. I think jailbreaking your iPhone is similar to this, while the tools are so easy to use that any one can do it, jailbreaking your iPhone gives you the freedom to do what you want with it and this is what its all about right?

Bash. We all know that Mac OSX is based off of BSD and it just so happens the iPhone is too. By jailbreaking your phone part of the default installation (depending on how you do it) is a terminal with a bash shell. Most Linux users should be right at home here with utilities like apt-get, aptitude and ping.

Perl, Python, Java, PHP. These are some of the languages that you can configure to run on the iPhone. Sure, they may need some tweaking (especially Perl.) But it can be done. Who said iPhone development had to be done in Objective C?

Along with the Bash shell comes the Open SSH package giving you the ability to SSH into your phone, should you choose to install and configure. This can come in very handy for the Linux hacker. The ability to pretty much manipulate your phone however you want is a great reason to jailbreak.

You’ve always wanted to be able to record video right? Well you can, that is if you jailbreak and install an application. While the video quality is not exactly up to par its better than nothing. You could even turn your phone into a robot if you wished.

Also, do it because the Woz says so. Well, actually he didn’t explicitly say to do it, but apparently he does advocate it and “hacked” some chick called Griffin’s phone. So come on, be that “Throbbing brain with a tie” and jailbreak your iPhone.

Why The Antivirus?

Filed under: General Linux — TheLinuxBlog.com at 12:39 am on Friday, January 23, 2009

Why The Antivirus

Although viri on Linux are not very common, it is not unusual to find anti virus utilities available. You may ask what the point is if your operating system is not as vulnerable to these types of threats but perhaps you are looking at it the wrong way. What better platform is there to act as an anti-virus scanner then one that isn’t as likely to get owned?

Take this example: a Linux file server Vs. a Windows 2003 file server. Just by plugging the Windows server in it may be at risk, in an hostile environment (eg Internet), while the Linux server may not have as much risk (at least from a Virus attack)

We all know the benefits of running Linux file servers such as cost, stability and coolness so we won’t touch on those but there are downsides to running a Linux file server. One of the major downsides is that Linux servers have a perception of being hard to manage. While they can be significantly different from managing a Windows server this myth is often on the top of the list for decision makers.

Often system administrators (myself included in this one) get lazy in their samba configurations. This is a potential problem because a sneaky virus could attempt to write its self to any writable volume, which could cause a lot of grief for the poor Windows machines. Or perhaps in tandem with the writable volume an exploit for a piece of out dated software allowing the writable file to be executed.
A friend of mine first introduced me to the concept of anti-virus scanners on a machine he had created specifically for the purpose of housing his virus collection. He had made a script that extracted information about the virus and cataloged it for easy reading and searching. All he had to do to add a virus to his collection was copy it to a folder. With this method he was able to quickly search and find any virus he had on file for specific traits or purposes for analysis. While some may call this overkill for him it was a hobby. Would you keep your entire virus collection on a Windows machine?

As with any operating system, it is only as secure as you make it, therefore running an anti virus on your Linux machine may not be as stupid as it first sounds. Especially if they interact with the dirty Windows boxes on a regular basis. Then again, if you’re purely a Linux shop, enjoy the cleanliness while it lasts.

Linux CD Ripping Utilities

Filed under: Linux Software — TheLinuxBlog.com at 12:33 am on Wednesday, January 21, 2009

CD Ripping with Linux doesn’t have to be the labor intensive task that it once was. No longer do we have the days of writing a hundred character command to rip a CD with the perfect options. Here are some utilities aimed at making your life of ripping your collection of CD’s to a digital format you can actually use.

First up for review is Grip. Grip is an gtk application that can play, rip and encode CD’s. It is really easy to use and is my CD ripping utility choice.

While the interface is not as pretty as it could be I guess its not hard to fool you that grip means business.

All you have to do to rip an entire CD is put it in, wait a couple of seconds and Bobs your uncle it found your track information from freedb.org. Next hop on over to the “Rip” tab and hit “Rip+Encode”. Since we didn’t select any tracks it should squawk and ask if you really wanted to try and rip no tracks, or if you just want to go ahead and rip the entire CD. I always hit entire CD and move along.

Before you get too excited and to a yum install grip and start ripping your entire collection keep in mind that you will have to install the dependencies (usually lame) and change the format under the “Config->Encode->Encoder” tab. This is not really a big deal and for your convenience grip will remember your settings. There are no sounds when a rip is finished (which can be frustrating either way,) but there it does eject your CDROM for you.

Goobox is next. Just as easy to install, just as easy to use and it’s also another gtk application. Goobox has a slightly more boring interface with less options. If your looking for a Gnome based CD ripper with a minimal interface this is the one to choose.

I think its about time for a KDE utility. KAudioCreator has an interface very similar to Goobox. You will first have to select an encoder from the “settings->encoder” tab. You can then pop a CD in and it works its magic just like the other CD rippers, well that is right after you hit the “Rip Selection” button which is the KDE gear.

Try them and let me know which one you like the best. GUI’s are nice but nothing can compare to a command line utility and this CD changing robot

thinkpad_handler ACPI Script for Lenovo T61 hotkeys

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:54 pm on Sunday, January 18, 2009

Lenovo T61 Thinkpad_Handler ACPI hotkey

This weeks shell scripting article showcases the modifications I have made to the thinkpad_handler script that normally resides in /usr/lib/acpid on an OpenSuse distribution. For any one not using a Lenovo T61 this may or may not be useful, however anyone interested in shell scripting can take a look at the file and see the simplicity of shell scripts that are used in production environments.

Here is my modified thinkpad_handler script

One of the reasons I chose to post this was because an OpenSuse upgrade broke my brightness keys support, so I figured it would be another good place to back it up while providing a reference. My modifications are very minimal at the moment, I still have a lot of work to do.

Here are my minor modifications:

Line 102 to add support for suspendon Fn+F4

Line 127 to eject /dev/cdrom on Fn+F9

I used to have a special script for Fn+F8 which enabled me to toggle support for the touchpad and track point mouse. Until I find that script I’ll endure excruciating mental anguish every time I accidentally hit the touchpad. I’ll have to make an update to this script once I change all of the other hotkeys for OpenSuse on the Lenovo T61 or other similar Lenovo notebook computer. I should also probably upgrade to OpenSuse 11.1 and see if that makes a difference in the keyboard shortcuts.

Until next week, happy scripting!

Getting Home

Filed under: General Linux — TheLinuxBlog.com at 6:30 am on Friday, January 16, 2009

Getting into your home network from the wild west known as the internet can be a pain, especially if your IP address is always changing on you, or perhaps the one time that you need to get into your home network your IP address changed.

This happened to me not so long ago, my IP address hardly ever changes but my IP address did happen to change when I moved into my new residence. Assuming that my address would stay the same I headed off to work, unfortunately I was unable to phone home.

Many people know about the free sites that let you update your IP address such as DynDNS, no-ip.org etc. But I couldn’t settle for that mediocre domain. By setting up a CNAME in my DNS I was able to forward a subdomain to my dynamic update address which in effect allowed me to remember home.mydomainname.com rather than the wacky no-ip.org address I chose. You can do the same using free utilities, providing that you have a little time and some control over your DNS.

Before you proceed make sure you have a way of setting a CNAME for your domain name. You can try your domain registrant if you use their web servers, maybe your web host gives you the ability to manage zones and if not ask them if they can add it for you, most times they will.

You will need to set up an account with one of the free providers I used No-IP.com but others like DynDNS.org, freedns.afraid.org, ZoneEdit.com and easyDNS.com should work.

Once you have set up an account with them and have your IP address mapped to a domain name, go ahead and add the CNAME record into your DNS.

The next step is to install and configure the program, script, cron or whatever method your free DNS account uses to update. I used my DD-WRT installation and plugged my account information into the DDNS tab, I checked the update and it registered my IP.

Once you have got your IP address into the free DNS provider, you should check to make sure that it works by doing a lookup on that host name. Use nslookup to do this:

nslookup yoursubdomian.your-free-dns-account.com

If it resolves to your home IP address, then your set to move forward with tackling the task of adding the CNAME into the DNS for your domain name. I cannot cover how to do this with every system in this article but basically you create a zone with the domain, 14400 IN CNAME and the full address of your free DNS with a period at the end. This is important or your name will not resolve properly.

Depending on what DNS servers you use it may take a while for the DNS to get updated. In nslookup I set my server to use OpenDNS’s in to test to make sure the name resolved properly. To do this, start nslookup and type:

> server 208.67.222.222

Once you perform a lookup on your new subdomain, you should see something like the following:

> home.yourdomainname.com
 
Server:         208.67.222.222
 
Address:        208.67.222.222#53
 
Non-authoritative answer:
 
home.yourdomainname.com canonical name = yoursubdomain.your-free-dns-account.com
 
Name:   yoursubdomain.your-free-dns-account.com
 
Address: [your IP]

Thats all there is to it. If your IP is updating via your free DNS service and you set up your CNAME then you will be able to find your home, or give your home address to anyone wishing connect without the embarrassment or hassle of explaining your subdomain and free domain account.

Fedora 9 Thunderbird Update Fix

Filed under: Linux Software — TheLinuxBlog.com at 12:01 am on Wednesday, January 14, 2009

Fedora 9 Thunderbird
While updating a Fedora 9 installation I ran across an error. The error was with the Mozilla Thunderbird package that I use on a regular basis.
The error looked like this:

 Running Transaction
Updating       : thunderbird                                                                                                                                                  1/2
Error unpacking rpm package thunderbird-2.0.0.19-1.fc9.i386
error: unpacking of archive failed on file /usr/lib/thunderbird-2.0.0.19/dictionaries: cpio: rename

Obviously any fix that I implemented couldn’t loose my mail. The problem was with the dictionaries more specifically the /usr/lib/thunderbird-2.0.0.19/dictionaries file. The error is not very specific but lets us know its having trouble unpacking the archive and ends with cpio: rename. So here is what I did to solve the problem:

 cd /usr/lib/thunderbird-2.0.0.19/
sudo mv dictionaries dictionaries-old

Thunderbird data is stored in ~/.thunderbird it is advisable you make a backup of your mail if it is that important to you. I didn’t since this directory is a library directory and all of my mail can be downloaded again with imap. If you use pop you may want to consider doing a backup. After doing this it fixed Thunderbird and I’m all up to date. Horray!

Let me know if it worked for you and I’ll let you all know if there are any problems.

An rsync primer

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 12:55 am on Tuesday, January 13, 2009

An rsync Primer

rsync is a great tool used to copy or “sync” files locally or remotely. Having just lost a fair amount of important personal data its good to make the point that you can lose data if you use rsync, so make sure that you know what you are doing works before putting it into production.
“Whats so great about rsync?”
I hear you ask.

Well, there are many ways of copying data around, regular old cp, scp and rcp but what sets rsync apart is that it’s capable of syncing those files that have changed, or those that are missing. In other words, why do a full copy of all files, risking further corruption when only some have changed?
rsync also handles compression and verifies that the files were written correctly.
The syntax for rsync is fairly straightforward, those of you familiar with the rcp or scp should be easily able to relate to that of rsync.

The syntax for a local file copy is:

rsync [OPTION...] SRC... [DEST]

-avz is the option that I use most commonly.

-a for archive, -v for verbose and -z for compression. As lame as it may sound, I actually remember the syntax for this as “Alien Vs. Zeus.” Sounds stupid, but it actually works.

Since I do not normally sync directories locally, one of my hosts is usually remote. rsync is configured to use SSH by default, but rsh can be used if preferred. I stick with the default SSH for simplicity. The syntax is very similar to scp’s

To Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
 
To Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

If you like to back up all files matching a pattern the same syntax applies but you specify a pattern. An example is you could backup all .conf files from /etc (provided you have read access) to another host by doing the following:

rsync /etc/*.conf [USER@]HOST:DEST

If you do the above, I am assuming that you would also want to backup other configuration files within the /etc/ directory. Instinct tells you if you have read the man page to just use -r however you may want to just do a full backup as rsync with a pattern by default does not traverse into directories.

Compression is really a nice feature for transferring large amounts of data. To demonstrate the speed increases that the -z option gives my full /etc/ directory which is 48M. It took 0m12.671s with compression and 0m35.657s without. This was over wireless from a dual core 2GHz laptop to a 1.8GHz wired desktop, so your results may vary. Either way compression or no compression rsync is a handy utility that should be able to make your life of copying files around a little easier.

My Goals for 2009

Filed under: General Linux — TheLinuxBlog.com at 7:56 am on Monday, January 5, 2009

Linux New Years Resolutions

As we enter the first REAL week in 2009 there are a lot of goals I have. I’m not one for resolutions just because if I weren’t to complete all of these tasks I would have broken the resolution, and there is no point in making one in the first place if its just going get broken. I’m not going to be bench pressing 200lbs or competing in the Ironman any time soon but these are some of the items of technical relevance.

Set up an Asterisk PBX
I subscribe to the Broadvoice VOIP service and have since 2005. I have been meaning to set up a PBX for quite some time but never quite got around to it. Asterisk running on Linux is a great way to get some extra functionality out of the ordinarily boring phone service. Since my mobile phone now has a SIP client I’d like to be able to use it along with my home phone. I’d also like for other family members to be able to share my international calling plan either with soft phones or analog telephone adaptors.

Learn basic electronics
I guess this is a rather broad topic but basically I would like to get better at basic electronics. Sure, I know my way around a circuitboard and can identify components, but I want to get into the nitty gritty and be able to etch PCB’s and make intelligent devices from the ground up without following plans. This relates to a few other projects I have planned and will be blogging about.

Learn to program and implement micro controllers
This task is very important to me. While I know how to program well, I’d like to be able to program micro controllers and actually implement projects from the project board without buying another basic stamp. This may mean I need to look into different micro controllers either way its something that I’d like to be better at.

Consolidate data
This one really should have been done a long time ago, but everybody knows backing up and organizing data is boring. This next year I hope to be able to better navigate and manage my data. Ultimately I’d like to be able to switch Linux distributions and be able to recover without loosing any data. This is also a safe guard from the inevitable drive failure that is sure to happen to me in 2009. This goal is somewhat complete as I set up a NAS with a script to copy data to a second drive, but is far from being organized.

Rip my CD Collection
Ripping my CD collection probably should be done right after I organize my data. I’ve been putting this off for years but think its finally time to ditch the old plastic and move into digital form. I don’t own an iPod or mp3 player but I should be able to stream them to my laptop or planned media center.

Get Certified
I’ve been collecting certifications for a while but in 2008 I did not get any. Perhaps it is because they are getting harder or maybe its because I’m lazy. Anyway in 2009 I hope to get Security+ certified and then see about some others. On the list are RHCE, LPIC, Cisco, Zend PHP, MySQL and a few other smaller ones.

Thats my list of things I’d like to achieve in 2009, does any one else have a list, resolutions or any comments

Crontabs 101

Filed under: Shell Script Sundays — TheLinuxBlog.com at 11:42 pm on Sunday, January 4, 2009

Although not necessarily classified as shell scripting its self cron’s are very useful to any Linux administrators arsenal. The ability to run tasks at a specific interval is a great way to schedule things to run later or when the system load is lower. Many applications use crontab to schedule tasks so its hard to say what yours will look like.

crontab -l

will list all of the cron jobs scheduled for the currently logged in user mine has an entry for kpodder

# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
#KPodder entries
0 0 * * * kpodder.sh -c "/home/owen/.kde/share/apps/kpodder/" -s "global.casts" -o "/home/owen/podcasts" -d 0
#KPodder End

The first five fields are to tell the task when to run. They are in the following order: minute, hour, day, month, day of the week. Asterisks are used to say any valid value and a forward slash can be used to make intervals such as five minutes, hours, days or months (*/5). A comma can be used for or values, so if used as 2,4,6 the cron would run at 2, 4 or 6 o’clock. Dashes are used for time spans, If you have an 8-5 work day you can use 8-17 if in the hours field.

Next, the sixth field is the actual program to run. It will look in the $PATH for the user, but for safety’s sake, I try to use the full path if possible. In my example of the kpodder script there are many arguments. I only really use simple crons and the number of arguments here seems rather excessive.

To edit the crontab do crontab -e. This will edit the current users crontab. If you are root and wish to edit a naughty cron from another user you use -u and specify the user.

Thats pretty much all there is to it. I’d love to here tips and how much people love/hate cron and why.

Happy Shell Scripting New Year,

– Owen.

ATTEMPTING TO INSTALL LINUX PART DEUX

Filed under: Linux for Newb's — aaron at 6:18 am on Friday, January 2, 2009

Ok, where’d I leave off.  Oh yeah, at the asscrack of dawn on the 31st…failing, as one would expect from a “newb.”  Believe many of my problems may actually be hardware related on some level, but cannot decipher the main cause. Optical Drive is the most likely candidate.  Moving on.

12/31/2009
9:51pm  Compy DBAN’d, attempting install of UBUNTU release 8.10 again.  Background looks like a blood smear in DEADSPACE. “Partitions Formatting” – ext3 again – 5% again.  Let’s see if it goes any further…15%…Scanning Files.  Copying files at 22%, I get excited, but, you know, not in that way.

10:02pm  INSTALLATION FAILED. Error copying files to HDD [Errno5].  Multitude of causes include a faulty optical drive, bad HDD, too hot, I call BS and go with the last possible cause “burn speed.”

11:18pm  Attempting to install UBUNTU 8.10 at 8x burn speed. Optical Drive churning away. Background up, beginning installation, FROZEN at Partitioner.  Failure.  Time to celebrate the New Year with lotsa drinkin’.

01/01/2009

1:59am  Frustrated with UBUNTU, I’m experimenting with a liveCD of a release called BERRY.  The Desktop Background is a kitten melded into a desert wasteland.  Written in the lower left margin of the screen is “THE MOST BEAUTIFUL O/S IN THE WORLD.” If by beautiful, I hope they mean the code because this….this is just apalling. Oh FRACK, I click some random gear button and up pops another kitten.  This Distro was developed by Satan and his demon buddies…and possibly Kevin Rose.  Ok, big NO and big waste of time.

3:34am  Still a no go on the UBUNTU front.  What is the fracking problem?!?!?!11?  Will continue to hack away at it.

5:32am  Browsed around on the intarwebz and came across the FEDORA distribution 10.  Burning it at 16x and installing.  FAILURE.

01/02/2009

4:32pm   Attempting installation of FEDORA 10 again. SUCCESS, FINALLY SUCCESS, I NOW HAVE A SYSTEM RUNNING LINUX (though I wish it were a laptop so I could tinker with it in my recliner as opposed to on this monstrosity of a former laptop with a possible bad optical drive and as opposed to working in my office where it is less than comfortable given certain medical conditions).  UH OH, a pop up tells me there’s a kernel error.  BAH! I sent a report off to the FEDORA folk, this may seem interesting in the future  if I run into a problem; at that point I may be able to fix it.

5:00pm  Ok…so, Fedora 10 seems like…any other operating system really. I’m writing this post on the intarwebz (@ 5:12am) on it.  I’ll just have to tinker with it more I suppose.  As Fedora is supposed to be based off Red Hat, certain knowledge I acquire may assist me in future endeavours (MONEY).  Don’t get me wrong, I like the nice, clean GUI with the blue burning sun ‘n all, but…I want to get down to the nitty-gritty as they say around here.  I want to learn command line functions.  I also want to start learning more about programming languages such as C++ (antiquated or not), PERL, JAVA, etc.  I want to be able to do what SNIDE does on a day to day basis and type in a few commands and have complete control over my machine (or someone elses, heh).  It’s all going to take time though.  Time.  Crap, The time setting is wrong on this thing, I have to fix that, oh, and they make it really easy.  Where’s the fun in that?

Until next time fellow NEWBS.

Next Page »