Open Source Software and Linux: January, 2009 archives

Open Source Software and Linux:

January, 2009

Jan 27 2009   8:51PM GMT

How many Top applications are in Linux?



Posted by: John Little
Linux, top, mytop, ptop, apachetop, powertop, dnstop, iftop, ntop

I don’t know how many Top applications are in Linux. However MARKUS FEILNER AND SASCHA SPREITZER over at Linux Pro Magazine have evaluated all that they could and come up with a top ten for use to use.

As you might expect the original Top came in number one. I was surprised at the number of uses the other Tops came up with.

My favorite is Power Top since all that I use is a notebook. Occasionally it gets hot but the fan doesn’t come on. Maybe Power Top can help me with that!

Another one that I like is MyTop for MySQL. You can use MyTop to analyze what is going on with your MySQL database. There’s alsp PTop for PostGRE users.

Head over to their website and check out the article. You may find a Top that you really like!

-j

Jan 27 2009   8:01PM GMT

VirtualBox releases version 2.1.2 with wireless NIC support



Posted by: John Little
virtualbox, lan, wlan, Linux, wireless

The newest version of VirtualBox has the native ability to use host interface networking and attach to your host’s wireless NIC. This gives users the ability to use a local ip of their network for network access and maintain an internet connection. In other words your virtual machines can now become an integral part of your LAN.

If you’ve ever tried to use wireless with a virtualized machine you know that it is a royal PITA. With this new version of VirtualBox this is no longer the case.

The 2.1.0 version was released in December of 2008. If you tried this version you probably found that you had numerous problems in many areas. Personally it crashed my Centos 5.2 installation. Trying an upgrade failed to clean up files and in general wreaked havoc during the boot phase of the host machine.

This latest version appears to have most of this cleaned up. However, to be safe, if you are using a 2.0 version or lower I would uninstall it rather than upgrade. You should also do a manual search and destroy of any leftover files. You can make quick work of this by issuing the following commands after uninstall:

locate -i vbox | xargs rm -Rf
updatedb
locate -i vbox

You should not get any return after the last command.

All of that said this newest version of VirtualBox looks very promising with it’s ability to natively connect to the host’s wireless NIC and LAN. You can download it here. It is available for Linux, Solaris, Windows and Mac.

-j


Jan 27 2009   7:30PM GMT

Broadcom releases open source wireless drivers



Posted by: John Little
bcm3412, Linux, broadcom, wireless

Broadcom has released an open source version of their wireless drivers.

The driver is available for 32 and 64 bit operating systems. It supports 802.11a/b/g/n wireless protocols so it should work for any network. It is designed for use on Broadcom’s BCM4311, 4312, 4321 and 4322 based hardware.

The software comes in tar files for download. This means that you will need your development kernel and kernel headers for your distribution to compile the driver.

The binary driver files are designed to work with any version of the Linux kernel using operating system specific files. That should make it viable for any Linux distribution.

You can download the drivers here.

-j


Jan 27 2009   2:08PM GMT

Open Souce software is literally making money..



Posted by: John Little
open source software, artists, architecture, graphics

Open source software is literally making money in Holland.

Stani Michiels, a Belgian artist and open source software developer, won the competition to design the new 5-Euro commentorative coin. The competition was set up by the Dutch Ministry of Finance.

His winning design was developed entirely with open source software, has now been implemented and is a legal coin in Holland. The theme of the competition was “Holland and Architecture”. Competition was by invitation only to a select group of architectural firms and individuals.

Michiels says in his blog “All the developing and processing was done on GNU/Linux machines which were running Ubuntu/Debian.”

How he went about designing his coin is wildly interesting as is the software and hardware that he used to generate the graphics. You can read all about it on his blog.

-j
architecture


Jan 25 2009   1:22AM GMT

Using the Korn Shell with Linux



Posted by: John Little
korn shell, bash, Linux, unix, scripting

My current consulting gig requires that I use the Korn Shell and modify Unix scripts so that they will work with Linux. While the Korn Shell has many comparable characteristics of BASH there are some distinct differences-or at least ones that I’ve never seen in BASH.

The first difference that I noticed is tab completion. For example let’s say that I issue the command

ls /home/jlittle

and hit the tab key to see the files and directories. The output that you see will be in this format

ls /home/jlittle/
1) CentOS-5.2-x86_64-bin-DVD/
2) Desktop/
3) Documents/
4) Video call snapshot 8.png
5) bin/
6) ffmpeg.cfg

At this point you can either choose a number and hit the tab key or type in the first couple of letter of what you want to see or do. The complete output when using the number would look like this

ls /home/jlittle/<tab>
1) CentOS-5.2-x86_64-bin-DVD/
2) Desktop/
3) Documents/
4) Video call snapshot 8.png
5) bin/
6) ffmpeg.cfg
ls /home/jlittle/Desktop/<2tab>
Project-timeSheet.ods Skype.desktop

Typing 2 tab and the tab completion gives us the listing of the /home/jlittle/. Kind of a cool way of doing tab completion don’t you think?

You should also not use the “test” built-in that is available in bash. In bash the test built-in is the same as the “[" built-in. In other words don't use

if test $# -gt 0; then

instead use:

if [ $# -gt 0 ]; then

The korn shell also prefers the use of double brackets syntax “[[ ]]” instead of single brackets. This adds additional operators such as && and ||:

if [[ $# -gt 0 && $? -eq 0 ]]; then

You can use && and || to construct shorthand for an “if” statement in the case where the if statement has a single consequent line:

[ $# -eq 0 ] && exit 0

The Korn Shell is a powerful tool that can make your job easier. Since it’s creation several features have been added while maintaining backwards compatibility with the Bourne shell. The Korn shell can also be used as a programming language which gives it a distinct advantage of typical Unix and Linux shells.

Give ksh a whirl. I haven’t even scratched the surface of what the Korn shell can do for your scripting. If you are used to scripting with Bash then learning the Korn shell should only have a mild learning curve while presenting you with additional scripting power and speed.

-j


Jan 24 2009   8:13PM GMT

Turning tape compression on and off using the Linux mt command



Posted by: John Little
Linux, mt command, scsi tape, dat tape, tape compression, how to

It took quite a bit of google searching to find out how to turn tape compression on and off using the Linux mt command. The mt man page information for doing this is not helpful at all.

To turn compression off use 0 as the switch, to turn it on use 2 as the switch and to find out whether it is on or off use 1 as the switch.

Your commands will look like this

mt -f /dev/st0 datcompress 1 # tell if compression on or off
mt -f /dev/st0 datcompress 0 # turns off compression
mt -f /dev/st0 datcompress 2 #turns on compression

-j


Jan 24 2009   8:01PM GMT

Setting script variables using the if..then statement



Posted by: John Little
Linux, unix, ksh, korn shell, bash, if..then, variable

Recently I found myself wanting to set some variables in a script that I was writing using the if..then statement. I am using the Korn shell but this is bash compatible.

I wanted to do this as the variable command changed depending on if the script was running on Linux, HP-UX or AIX. This saved a ton of typing the same test over and over throughout the script which is about 600 lines.

The basic form of the script is

if [[ $STRING != string ]]; then
VARIABLE=string1
else
VARIABLE=string2
fi

As you can see the if statement is built around the VARIABLE rather than VARIABLE=if statement. Doing it in that form either won’t return any output or give you output that is not useful.

A real world example

VENDOR=$(uname)
if [ $VENDOR != "Linux" ];then
BACKUPHEADER=log “$(date ‘+%D %T’) Checking header.”
else
BACKUPHEADER=/bin/logger -t “VALIDATE LINUX BACKUP: $(date ‘+%D %T’) Checking header.”
fi
[code]
As you can see from the above the Unix command for sending output to syslog is log and is logger on Linux. Now imagine having to run various tests throughout the script and sending the output to syslog depending on the OS. As I mentioned, it saved quite a bit of typing.

Hope this helps you somewhere!

-j


Jan 24 2009   7:42PM GMT

Skype and OpenSuSE 11.1..



Posted by: John Little
skype, opensuse 11.1, Sound, mic, microphone, pulseaudio, libpulse0, alsa

As I’ve alluded to in previous posts Skype, OpenSuSE 11.1 64 bit and sound capture (the microphone) have not been playing nice with each other on OpenSuSE 11.1. Sound generally worked but if you wanted to talk, well, good luck with that.

I think maybe I’ve found a solution though. There are some things to to keep in mind here. The first is that Skype is a 32bit program, OpenSuSE uses pulseaudio, and that I am using a 64 bit system on an HP laptop nx6325 that uses the ATI Technologies Inc IXP SB4×0 High Definition Audio Controller. The module the sound card uses is snd_hda_intel. If you are using that module then this should work for you but ymmv.

Go ahead and install Skype. Open up the Install Software module in the OpenSuSE menu and under Installed Programs type pulseaudio. Uninstall all of it except for libpulse0. That will leave you the pulseaudio client interface for any 64 bit programs which have pulseaudio as a dependency. MPlayer comes to mind here. Conversely it may break 32 bit programs that have pulseaudio as a dependency.

Now reboot your machine. Open up the Sound module in the Yast Control Center. Adjust your sound settings so that the top 3 are Autodetect. The fourth one should read HDA ATI SB AD198x Analog (ALSA) and the last one HDA ATI SB (Alsa Mixer).

Now open Skype and try a test call. You may have to play around with your Skype settings. Mine are all set to default. If your machine becomes unresponsive hard boot it and it should be ok on the next boot. Strange I know, but it happened to me..shades of Windows :-(

With any kind of luck you should be able to use your microphone. I use the built in microphone on my laptop. If everything seems to be working properly but your not getting playback on your external mic open up the volume control from the speaker in your task bar and make sure that you have the external mic enabled.

Good luck!

-j


Jan 22 2009   12:15PM GMT

Travels of a Linux consultant - Day 2



Posted by: John Little
opensuse, skype, consultant, Linux, sles

We’re working a minimum of 10 hours which turn into usually turn into 12 on this project. These hours make it hard to find time to write. Anyway onward to Day 2.

As you may remember from the last post I finally arrived at my hotel about 2200 CST. Being tired and all from the trip I decided to hit the sack and check email and what have you the next morning.

I get up the next morning and get ready to go. Everything is looking good as far as arrival time. I am supposed to be at my destination around noon.

I sit down to check my email. No wireless internet. Like most of us the first thing that I look for is internet before I decide on a hotel/motel. These folks advertised wireless. Now I’ve been out of touch with everyone for almost 24 hours. This isn’t good.

A quick search around the room reveals a data jack. Ok cool. I have a patch cable with me. I plug in my patch cable and Voila!..nothing. Did I change something before I left and I’ve forgotten about it? I check all of my settings and everything is correct. I make another run at wired and wireless. No go.

Somewhat aggravated I go ahead and check out. While doing so I complain at the front desk. You advertised it and I need it for business. This is why I chose your motel. The lady that is on duty can’t do anything I know. But she promises to tell the manager and see if she can get me a comp stay or something. Later that afternoon she calls and they have knocked $20 off of the bill.

So I arrive at my destination and go in and meet everyone. I sit down at the table, open my laptop and boot ready to get to work. No X windows. I reboot. Still nothing. This is bordering on the ridiculous.

I try resetting X with the tools provided by CentOS. It says everything is installed and ready. Still no X. Ok I’ll boot to runlevel 3 and check for an update, check my history, look at the xorg.conf and check the logs. Nothing shows as wrong and the networking won’t even start. Now it’s even more ridiculous.

I know what you’re thinking. This DODO actually had internet at the hotel. No I didn’t. I wasn’t the only one to complain about there not being any internet.

Ok I’m on a SLES project. On of the resident engineers has an openSuSE 11.1 disk. I install this and get to work.

I live to regret this decision though. After I get to my hotel I install and fire up Skype. I setup my webcam and call my wife. No webcam and no microphone. But that’s another story.

So much for Day 2. I’m concluding my travel days here. Work goes well and the webcam and the mic continue to be a hassle. More the mic than the webcam but who’s counting…

-j


Jan 19 2009   1:53AM GMT

Travels of a Linux consultant - Day 1



Posted by: John Little
Linux, consultant, suse, red hat

It’s been a few days since I’ve had a chance to write so I want to catch up.

I recently accepted a 3-5 week consulting job about 400 miles from where I live. I had to leave in the late afternoon because I had an interview for another job, this one closer to home and about 60 miles in the wrong direction. This meant that I wouldn’t actually be on the road until 1500 EST or later.

After the interview off I went. About 90 miles into the drive my truck started missing so badly that it was shaking as I drove and the “Service Engine Soon” light came on.

I called my wife and asked her to locate an auto parts store in the town that was coming up, Champaign, IL. 60 miles of a teeth rattling miss in my engine. This was fun. She called back with directions to a store that was about 10 minutes off of the highway.

I arrived there about 1700 CST. If you’ve ever been in the midwest in January you know that it starts getting dark between 1730-1800. I had them put a tester on the truck and sure enough the Coil on Plug 3 was bad. To top off everything it was 10 degrees F outside.

I had somewhat expected something like this as my truck had been acting up for the last few days. With that in mind I had brought along enough tools to pull a spark plug which meant I had the necessary tools to remove the coil.

I don’t know if you’ve ever been under the hood of an F150 4 wheel drive but some of the plugs and coils can be difficult to reach. It is also high enough that it is helpful if you have a step stool of some sort. Fortunately the coil/plug 3 is not under the firewall so it wasn’t too bad. I did have to crawl up onto the grill housing to get to the coil though.

I bought the coil and went to work. It took me about 10 or 15 minutes to get the old coil off and another 20-30 to get the new one on. By now I’m working by the light of the auto parts store and the temperature is dropping. Cold, very cold. I’m glad the wind wasn’t blowing or it would have almost been unbearable.

The rest of the drive was uneventful although driving through St. Louis wasn’t much fun. Finally I reach the hotel in Rolla, MO about 2200 CST. This puts me about 4-5 hours from my destination. Ahh, I say to myself, the hotel has wireless and breakfast so I’ll just hit the sack and check email and what have you tomorrow morning.

So much for day 1.

-j