RSS Feed

RSS

Comments RSS

The Watch Folder

For the programmers and systems administrators among us.  Consider the following, and all too common, programming task. Events from one process need to trigger actions by another.  Now, the impulse may be to try to impliment a direct method of communications between the two process via networking sockets, low level OS signals, etc.  While this may be good to consider or even use at times, there may be a far more simple and less problematic method that is almost always worth considering – the Watch Folder.    If both processes can have access to a common directory, via network share or direct filesystem mount for instance, then all one has to do is have the first process drop a small file to the locaton and have the other process be watching for it, act in response and then clear it out and wait again for the next time the file appears in order to act again.   The second process can watch for it directly or have some other task be the watcher that then calls the final process, perhaps through a periodic call from a task scheduler such a cron.   There are lots of realitively simple ways of implementing such an arrangement without resorting to more complex networking or OS signaling programming schemes.   The Watch Folder methodology works well in any language but is particularly easy to implement in simple scripting languages that are available as part of the command shell of most any OS, such as BASH in Linux, Bourne or Korn Shell in Unix, or DOS Batch or Powershell script in Windows.

Slackware vs. Arch Linux

I recently found an excellent article comparing Slackware and Arch Linux.

http://beej.us/blog/2009/12/arch-vs-slackware/

bye bye Ubuntu

I think I am going to scrub my Ubuntu 10.04 system (the one I am typing on is Linux Mint Debian), and do another Arch Linux install.   At that point Ubuntu will have been totally jettisoned.  For an Ubuntu done better than Ubuntu, I have Linux Mint.   LM is great for an easy productive installed Linux.  However, it is so easy that it does not do much for my need for a Linux “geek” fix.  So, that is what Arch is for.  Not an easy install.  I have to actually think, read, and learn to do stuff properly on it which is why I fell in love with Linux in the first place.

Don’t get me wrong, I am not an Ubuntu hater.  The Ubuntu team did some really great things and set some really high bars that I think had a great influence on the entire Linux world.  However, I think they have taken a wrong turn with their emphasis on the Unity desktop and have dumbed down the system far too much.  I do appreciate their reasoning for doing this in that they want to get as many newbies and hopeless end users onto Linux and expand the user base.  I really do applaud that and wish them all the best.  However, it is just not for me.  I am a hardcore geek.  I write code.  I do geek for a living and for pleasure.  I just need something more chanenging and interesting.  Fot me comptuing is not just a means to and end, it an end unto itself.   So, of to greener pastures.  I have done Arch before, and really like it.  Even when I got stumped a few times on how to do something, I really liked it.  Linux Mint for my everyday utilitarian computing and Arch for my geek needs.  That’s where I am at now, but given time all this too will change.  I love the ever changing Linux landscape.

–Bill

GRUB2 – editing the boot menu

When it comes to Linux bootloaders, I cut my teeth on LILO.   Learned that, got good at it!   But, time moves on and pretty much all the Linux distros went to GRUB.  So, learned that, got good at it, LIKED IT!   But, time moved on again.  Now most of the major distros have switched to GRUB2.  Granted, it did fix some problems found in GRUB, but we lost the easy-to-edit menu.lst file which was a one stop shop for configuring the boot menu in GRUB.   Typically, you would either want to manually added entries to the boot menu or to remove unneeded entries.  This much more complex in GRUB2, but not impossible.   With a little guidance, you can get back to having a boot menu done the way you want.   After some searching, I found these two articles that provide the best HOWTO info that I know of, particularly without being overly complex.  Both of these authors have done a very good job at making this understandable, and doable.  Check them out.

Understand the structure of GRUB2 and how to add entries:

http://maketecheasier.com/mastering-grub-2-the-easy-way/2009/11/19

Clean up your boot menu in GRUB2 and remove unneeded entries:

http://www.howtogeek.com/howto/17787/clean-up-the-new-ubuntu-grub2-boot-menu/

I use Linux Mint

I have just realized that I have not done an Ubuntu install in … well … a long time.   And it seems that the last time there was this crazy user interface called Unity that completely, utterly, turned me off to that distribution.   With all the very many things I do like about Ubuntu, the simple fact is that if I hate the interface I simply won’t use it or recommend it to others.   So, what to do?   I did do something.   I switched to Linux Mint.  Being basically build on top of the Ubuntu repositories, but with many improvements and the with the basic understanding that the application centric interface systems (like you see on the iPhone) are NOT suitable for use as a desktop environment.   All I really want is a normal desktop environment.   I did not need or WANT a new computer interface paradigm forced upon me.   I am convinced that most Linux users feel the same way.  Not only that, but I am very certain that Unity is also not the way to introduce new users to Linux.   Linux Mint has everything in it that I wanted and liked about Ubuntu, but without the terrible monstrosity of a non-dekstop called Unity and without the arrogance of thinking they know what is best for all us.  The Linux Mint developers have been committed to the needs and sensibilities of the users and that has won my loyalty.   I now tell folks that I use Linux Mint,  and I recommend it to others.

Linux Mint

Linux Mint, 2 thumbs up!

more about Unity badness…

 

LFS 6.8 not ready for prime time!

I was in an experimenting mood today and decided to give LFS (Linux From Scratch) 6.8 a try.  It is intended to be a from the ground up Linux build system that is primarily aimed at being an educational tool.   The goal is excellent!  Sadly, LFS 6.8 is not.  I did not get very far into the book before I began finding evidence that this version, suposedly the “stable” version, needs serious sanity checking.   More than once I found that the directions left me in the wrong directory.   Worse yet, the heart of the build, the GCC compiler build, fails outrageously.   I tried correcting the instructions but found that even with the paths to the files, etc. corrected it still fails.   I have sent note to the developers with what I have found and hope for some good help and feedback.   It is not beyond possibility that I made some bad mistake along the way, but I believe I was following the directions very, very carefully.   I hope the LSF effort continues and a corrected or updated version is released as it would be a wonderful teaching tool.   However, a teaching tool needs to work flawlessly if it is going to succeed in educating rather than confusing or frustrating the student.

ArchLinux, install file compression packages

With a base install of ArchLinux completed, you may find you still do not have all the file compression utilities installed to handle most commpression types.  Run the following to install the most common file compression packages.   Some may already be installed.   This is ok, they will just be refreshed.

pacman -S tar gzip bzip2 zip unzip unrar p7zip arj lha lzma-utils lzop

Xfce 4.8 missing trashcan

If you install Xfce 4.8, you may find the desktop trashcan icon is missing, even though it is selected in the desktop properties visible icons selection.   To get the trashcan icon back, install the gvfs package.

ArchLinux Reviewed

The Linux Action Show guys review ArchLinux. The ArchLinux review is about 30 minutes into the show.

An ArchLinux DVD tweak

This is just a quick tweak for ArchLinux. Many apps, such as VLC Player, that need to read the DVD device default to a setting of /dev/dvd. I found that ArchLinux does not have the DVD device listed in the /dev directory as such. Instead they are using /dev/sr0. You have a couple of choices. Once you know this fact, you can adjust the configuration of every app you use that needs to read the DVD drive to look to /dev/sr0. In my opinion, it is more straight forward to adjust the ArchLinux system to accomodate the use of /dev/dvd by creating an entry for it. Put the following in your /etc/rc.local system startup script and everytime you start the system the /dev/dvd device entry will be created for you automatically.

cp -l /dev/sr0 /dev/dvd

Intro to Linux

Distro Review: ArchLinux

ArchLinux, when old becomes new again

There is an old saying about old things becoming new again.   That is what I thought about as I did an ArchLinux install for the first time this weekend.   The process took me way, way back into the ’90s when I first became involved with Linux.   Back then, it was Slackware and a pre version 1 kernel.   The process was boot from the disk and very carefully follow the directions.   No GUI install back then and you configured your system as you went.   When the install finished, you were were presented with a shell login prompt to logon as root.   Very much the same thing when doing an ArchLinux install today.   I chose to use the net install CD, which is only about 160MB in size, the rest of the distribution is pulled down from mirror sites on the Internet.   The main appeal, to me, was that it was a return to a more technical DIY type of install with every little detail under my control, as opposed to a GUI install that lets you choose the language, time zone and keyboard and all the rest is done for you.   Now, I am not at all complaining about the modern, easy, GUI Linux installs.   These are in fact WONDERFUL!   Without easy installs like these that very nearly garantee a successful install, Linux would have very little chance to spread and be as widely adopted as it is becoming.    However, sometimes us geeks need more.   We need to satisfy that urge to take a look under the hood and tinker.   Sometimes we just need to geek out and do it ‘the hard way’.   So, I jumped in and did an ArchLinux install to satisfy this need.   One thing that I found is that while is very much a lower level install, it is also a very structured and GOOD install process.   You encounter much more detail along the way, but the process is very tightly controlled.  It is also what I would consider a very educational install with the internals exposed to view.   However, one thing it is not is undocumented.   Back in the old days, the install was sparsely documented and you really had to hunt and search to find out what you need to know to get everything right and running.  The documentation on the ArchLinux site, and also provided on the install CD itself, is supperb!   For instance, after I got the base install done, I wanted to do two more things – Get XWindows up so I could have some GUI if and when I wanted it, and get my wireless card going.   Both of these processes were extreemly well documented and I got both accomplished with just the documentation on the ArchLinux site.   I highly recommend ArchLinux to anyone wanting to dig in deeper and learn more of what makes Linux tick by getting back to the basics and doing a more basic install and then building your system, the way you want it, from there.   ArchLinux——– A review of ArchLinux

Linux Desktops, Xfce 4.8

Being able to select a desktop for your computer is a concept that is unfamiliar to the typical Windows user. Windows users can, of course, make a fairly wide selection of themes and configurations to their current desktop, but changing it out wholesale for a completely different desktop with its own set of default applications and functionalities is not part of their operating system experience. This is not true for users of Linux, or any of the other Unix-like operating systems. From the very beginning of the availability of graphical windowing systems in the Unix world with advent of X windowing system, development of new and innovative desktop environmnets has been the name of the game. Some of the available systems have been X11, CDE, GNOME, KDE, Fluxbox, WindowMaker, Englightenment, LXDE, and Xfce. There are many others, and surely I have inadvertantly omitted somebody’s favorite desktop environment. The main point here is that once you leave the world of Microsoft Windows, you enter a world full of choice when it comes to your operating system environment and particularly your graphical desktop environment. Today I would like to point out the Xfce dekstop, which recently came out with its latest release Xfce 4.8

Linux.com has a nice “weekend project” article about Xfce:  http://www.linux.com/learn/tutorials/456623-weekend-project-find-hidden-treasures-in-xfce-48

Linux Celebrating 20 Years

Linux Mint, 2 thumbs up!

After facing so many frustrations with Ubuntu 11.04 and uncertainties as to where Ubuntu is going in the future, I finally decided to bite the bullet and try different distributions.  The latest two that I have tried I can give 2 big thumbs up.   These were Linux Mint 11 and Linux Mint Xfce.

Linux Mint 11 is based on Ubuntu 11.04, but the Linux Mint team chose to not include the Unity desktop.   This distribution is everything that I would have hoped Ubuntu 11.04 could have been.   In fact, the level of polish and completness in Linux Mint 11 exceeds that typical of most Ubuntu releases.   This is saying a lot, because most Ubuntu releases are quite good.   However, one thing still worries me – GNOME.   Linux Mint kept the GNOME 2.3x desktop, which I prefer, but I must wonder if they will it be forced into GNOME3 in the next release?  I like GNOME2 and am not looking for wholesale changes of my desktop.   This type of uncertainty about the future of the desktop has given me enough pause to cause me to explore other desktops, which leads me to my next big thumbs up.

Linux Mint Xfce is NOT based on the Ubuntu upstream package sources.   Instead, it is based on the upstream Debian Testing packages.   This is also a “rolling” distribution as it is continuously taking updates from Debian Testing rather than being locked in until the next big release.   In essence, there will not be a next big release, or need for a reinstall, or a major “upgrade”.   It will simply update right along with the Debian updates.    I like this!   Also, it is not a GNOME based distribution, it is Xfce.   I have long been a fan of Xfce as an alternative to GNOME.   Like GNOME, it is based on the GTK+ libraries, but is lighterweight in its resource usage.   This is turning out to be what I would consider to be an ideal Debian based distro and may be where I call home for a while.  Were there any issues?  Yes, but only a minor one.   Linux Mint Xfce does not include the jockey-gtk package that the GNOME based distribution does.   This package makes for easier installation of restricted hardware packages, such as the Broadcom STA wireless driver.   I would strongly urge the Linux Mint team to consider its inclusion in the future or provide their own alternative.   However, this was easily overcome once I found the instruction on the Debian site for installation and configuration of the WL package.  This was straightforward and simple.   Here is the link. Debian WL driver install. Also, this distribution came configured with the Linux 2.6.32 kernel.   This is understandable since it was the kernel used in Linux Mint 10, which this is essentially a continuous update of.   I chose to update the Linux 2.6.38 kernel and did so via the Synaptic Package Manager.   This upgraded flawlessly.  I do not know if the update system would have eventually provided the kernel update to me, but it was reported my system as up to date so I am guessing it was not going to do so.

I would recommend either of these offerings from Linux Mint as an alternative to Ubuntu.   For those simply wanting a good GNOME desktop experience with no hickups, go for Linux Mint 11.   For those wanting to try a different desktop altogether, but one similar to GNOME2, give Linux Mint Xfce a try.   I think you will enjoy either of these.   Remember, Linux is all about CHOICE.   You are not locked into any distribution or desktop system.   Don’t be afraid to try out new things.   If enough folks decide not to adopt Ubuntu 11.04 or its Unity desktop, they will get the message.

Ubuntu 11.04, another annoying “feature”

Yes, I am going to harsh on Ubuntu 11.04 some more.  Even once you have turned off Unity and returned to a classic Gnome desktop, all is not back to “normal”.  Ubuntu 11.04 introduces a really stupid feature know as the “overlay” scrollbar.   Basically, it is a scrollbar tab that replaces the traditional scrollbar found on a windowed item.   It hides when not in use and pops back up into view when the mouse is moved into its area at the edge of the window.   HOW STUPID!  Who really wants to be playing hide and seek with windowing elements on their screen?  Even worse, this “feature” is found by default in all the Ubuntu derivatives also based on 11.04 such as Xubuntu and Linux Mint.   I would encourage the providers of derivatives to NOT accept every new feature that might be foisted upon us by the Ubuntu developers.   Fortunately, there is a way to turn the overlay scrollbar off and return to a normal scrollbar.

  1. Go to a terminal.
  2. sudo to get administrative privs
  3. paste the following into the command line and hit enter (then reboot for the change to take effect)
  • echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars

I found this great tip here: http://www.webupd8.org/2011/04/how-to-disable-overlay-scrollbars-in.html

Another good article that addresses this issue and others in Ubuntu Unity.

http://www.pcpro.co.uk/blogs/2011/05/03/ubuntu-unity-the-great-divider/

 

 

Ubuntu 11.04 Alternatives

The Ubuntu 11.04 Unity desktop is horrible. Thank goodness that Gnome classic is still a desktop choice at log in. While I love Ubuntu generally, I do not like Unity at all. If a reasonable gnome desktop is eliminated from Ubuntu, then I will simply move to one of the derivatives such as Xubuntu or Lubuntu. I have tried out both of these for 11.04 and both are perfectly acceptable and feature what I consider a more standard type of desktop. I did try Kubuntu 11.04, but it was a failure as the Kubuntu build of KDE crashes my system system with a panic when it tries to load the desktop. However loading the kde-standard package for a desktop choice under Ubuntu or one of the derivatives works. So, the Kubuntu issue must be a tweak that was made to that derivative only.

A good article about the problems with Unity.

a different kind of ham homebrewing

This little project just took on a life of its own this afternoon.  What started out as an experiment in writing a single program to read output data from my radio via the RS232 serial interface has turned into a full blown radio remote control program.

The current state of the program will let me control my rig from a remote PC across the local network at my QTH.

There are 4 separate programs involved in this.  Much of the code from my previous blog post comprises the heart of the system.

Here is how it all works. On the PC that is connected to the radio (we will call this the PC-Radio system) resides two programs – K2client.py and K2server.py.   On the remote PC across the network (we will call this the PC-operator system) resides two other programs – client.py and server.py.   On the PC-Radio system, the programs each have to communicate with both the network and the radio.   The K2client.py program takes any output data from the radio and sends it out to the network to be received as feedback from the radio by the server.py program on the PC-operator system. The K2server.py program receives any data sent to it from across the network by the client.py program on the PC-operator system and passes these as commands to the radio.  The radio takes the command, gives feedback, and cycle begins again.   As a diagram, it looks like this.

server.py[PC-operator system]client.py —————->K2server.py [PC-Radio system]K2client.py —>
^                   (operator)                    (network)                             (radio)                        |
|                                                                                                                                v
<——————–<———————————<—————————–<——————————-<——————–<—————————-

It was not as that this was all entirely necessary.  I could have downloaded software already designed to do this, and have used such in the past with my computers and radio.   However, for me, it is the difference between buying a radio and building a radio.  You can accomplish the very same thing in the end, e.g. communication.  Both ways are OK.  However, there are added benefits from building equipment such as the opportunity to learn, pride in the work one has done, the sense of accomplishment, etc.   The same is true for this type of homebrewing, the only difference is that it is homebrewed software rather than hardware.  The Python source code for the project is available.  This code is very minimalist and intended only to demonstrate the principles involved.  Please feel free to use, adapt, or modify it in any way you may wish.

NOTE:  The code from my previous blog post contains comments that explain how to take this Linux implementation of RS232 communications and adapt it for use on a Windows system.  Also note that there are hard coded IP addresses in the code that would need to be changed for implementation elsewhere.  Aside from those differences, this code should be fully cross-platform and usable anywhere as it pertains to the parts dealing with the serial and network communications.  The control codes and settings I am sending to my radio may not be applicable to your own, so please see the users or programming manual for your rig for appropriate codes, settings and methods for communicating and controlling it.   Additionally, the code found in this project that implements the network socket clients and servers are adaptations of code found at evolt.org.

Serial Communications using Python

#k2test1.py  by Bill Allen – WA5PB
#This is an experiment in communicating with an Amateur Radio transceiver
#via Python through RS232 serial communications.  Similar code could be used
#to communicate with any device supporting serial communications.

#This was written using Python 2.6.5, but I like using the new
#Python 3.x print function so we pull it in for use here.
from __future__ import print_function

#We will be using the PySerial library to provide RS232 serial communications.
#PySerial is a third party library module that can be found here:
#http://pyserial.sourceforge.net/
import serial

#Configure the serial port to communicate with the Elecraft K2 xcvr.
#I am coding this on a Linux system, so the device string /dev/ttyS0
#works for the first serial port.  Your system my use a different serial
#port device.  For a Windows system, try COM1 for the first serial port.
ser = serial.Serial(‘/dev/ttyS0’, 4800, timeout=1)

#Sanity check for the K2 AutoInfo mode, turn it off.
ser.write(“AI0;”)

#Now set the K2 AutoInfo mode to mode 1 and get some initial data.
ser.write(“AI1;”)

#Read up to 150 bytes of returned data from the K2 and print it out.
K2_data = ser.read(150)
print(K2_data)

#Now set the K2 AutoInfo mode to return the most data while it is being polled.
#Ctrl-C will be used to end the program.  End the program gracefully by trapping
#the Ctrl-C, turning off the K2 AutoInfo mode and closing the serial port prior
#to exiting.
ser.write(“AI3;”)
while True:
    try:
        K2_data = ser.read(150)
        if K2_data != “”:
            print(K2_data)
    except KeyboardInterrupt:
        print(“\nOK, exiting…”)
        print(“Reseting K2 AutoInfo mode OFF”)
        ser.write(“AI0;”)
        print(“Closing Serial Port”)
        ser.close()
        raise SystemExit(0)