How to check for a mouse and disable the trackpad

So I love my new massive desktop replacement of a laptop.  It’s fast, has plenty of RAM (for now at least), and plenty of Cores.  But it suffers from some of the same old issues every other laptop with a touchpad causes me.  When typing, it occasionally causes my cursor to end up in really strange places on my screen which results in messed up words or variable names.  On my MacBook Pro and in Windows I could disable the touchpad as soon as a mouse was connected.  I spent days trying to find the same settings on Linux and then ran across a few articles written by people who just wanted to turn off the trackpad for good.  That sounds good until you forget your mouse at home.  So I decided I needed to write my own script.  In a mere 38 lines(without comments) I came up with a script that looked to see if my mouse was connected and if so disable the trackpad.  If the mouse disappears or is removed the trackpad is re-enabled within 30 second.  If you want to use this script you will want to do a few things first:

  1. remove your mouse
  2. run “xinput list” determine what the system thinks your trackpad is called 
  3. plug-in the external mouse/pointer
  4. run “xinput list” again and determine what the system thinks it’s name is

My trackpad comes up as a ALPS GlidePoint.  If yours is different, which it likely will be, then you need to replace ‘ALPS GlidePoint’ in line 5 with the name of your trackpad.  If it is the same name then you don’t have to do anything with line 5.

My mouse comes up as ‘Logitech USB Receiver’ cause that sounds like a mouse right?  Well it is really the name of the wireless receiver for my mouse.  I shorted the name to just ‘USB Receiver’ in the hopes that any future wireless mice I may buy will use that part of the same name.  (Yeah I know there is about a 0% chance of that happening but I can dream can’t I?)  If yours is different, which like above it likely probably be, replace ‘USB Receiver’ in line 6 below.  If it’s the same then you don’t have to do anything with line 6.

The complete script can be found at this link.

One thing I did above that you may want to try in your scripts was to use the logger command instead of echo.  Logger uses the syslog subsystem and lets you write whatever you want to the default log for syslog.  Where to write is of course configurable if you need it to go somewhere else.  A word of warning though, logger will not move on if there is nothing to log.  It freezes and waits for you.  So like I did above, check to see if there is something in the variable before using it with logger.  Logger is available on most *nix versions.  If it’s missing you can normally find it as part of a syslog related package.


PCWorld is at war with itself over Linux on the Desktop…

So the story all starts with a very misguided reporter,  Tony Bradley,  failed to give Linux a chance to grow and change.  So much so that he declared it dead on the desktop.  He tried linux as his primary machine for 30 days.  Sounds like a good trial?  Well maybe it was but that was almost 2 years ago.  In the last two years for example Unity came from Shuttleworth’s dreams to reality.  OpenOffice forked and LibreOffice has seen development explode. In general the world of Linux marches on and at an impressive pace.  Microsoft and Apple have been around for since the 1970’s which makes them a little more than 30 years old.  As everyone will remember Linux just turned 20 last summer/fall.  So all things considered it’s amazing how far it’s come with no major financial backers.  You can read my own account of my life with Linux.  Oh yeah I am still using it as my main OS and using Windows 7 as little as possible.  I have found the latest versions of LibreOffice function nearly flawlessly and transparently with their Windows counterparts.  I digress though because this is supposed to be about the fact that even his fellow reporters at PCWorld don’t agree.  This where things get interesting.

Katherine Noyes wrote a rebuttal that pretty much attacked Bradley for saying Linux only makes up 1% of the desktop market.  She goes on to rant amazingly for Linux on the desktop is not dead yet.  She makes some great points and finished by agreeing with us on the fact that while Tablets are here we certainly not seeing the end of the PC era as lots of people would like us to believe.

Bradley can’t seem to just let this die and write another even more insulting response.  He goes off again about how few people are using Linux on the desktop.  He is of course forgetting that Linux is only sold, the numbers he is using, on about 30-40 models of PC’s.  Most of those are from Linux Speciality builders not the mainstream builders.  This isn’t to say none of them are the big builders, except Apple of course, all have a few PC’s you can buy with Linux.  What he is missing is people like me and many friends of mine who are repurposing old PC’s as Linux machines.  I know of a few companies that are also doing this for Kiosks, Point of Sale/Service Machines, School terminal servers and Terminal emulators.  So while Linux may not be a contender yet they are moving in and picking off the low hanging fruit.  So like the improvements we have seen in the interface and easy of install the number of users is growing fast.

At this point I thought the story would be over.  Then the Mayor of Munich came out last week and gave an interview about how easy, fast and cheaply they have managed to switch over to their own custom version of Linux called LiMux.  Even with them spinning their own version, standing up a development environment, hiring staff to do all of this, they still will save 4 Million Euros in the switch.  Then an additional 2.8 Million Euros each year in lowered/eliminated license fees.  Then there is the fact that helpdesk calls complaining about the change dropped from 70 a month to just 46 as the number of PC’s running LiMux increased from 1,500 to 9500.  It’s stories like these that will make CEO’s and more likely CFO’s sit up and take notice.  This isn’t a small business, it’s not a simple environment, it’s a large cities entire infrastructure being converted to Linux.  What else comes close to a modern Enterprise.

So in conclusion, yes you should look to see if you could switch out some Windows machines with Linux.  The exercise and evaluation of whether it’s possible is relatively cheap, fast and low impact.  If you could save even 25% off your Windows related software fees wouldn’t it be worth it?

Episode 67 – Bring out your dead Linux Desktops…

Does Desktop Linux Need a Steve Jobs?

What an interesting question.  Apple had Jobs and Windows had Gates.  Do we really need a persona like that to get linux on the desktop rolling?  Answering that question is the attempt of this article over at  The concept seems to completely fly in the face of the community focus that the Open Source strives to be.  At the same time the kernel has Linus.  That one person who everyone knows and associates with it.  One of the big challenges we have with that is that there isn’t only one desktop.  Gnome, KDE, XFCE and most recently Unity are some of the biggest.  But there are more.  So which team should be that person?  Let us know.


What do you think?

My life with a Linux Desktop in the Corporate World…

When I recently changed jobs I was given the opportunity to build my dream machine and put what ever OS “I thought would be best”.  Several of my counterparts were running Linux or dual booting between Linux and Windows.  In my new position, I will mainly be supporting the IBM Tivoli family of security products.  Most of these applications run on Linux and the ones that don’t, run on Windows in a VM just fine.  So I was all set and ready to begin.  The first question was which distro?

After looking at and doing quick tests of several, I decided to go with PinguyOS.  Unlike Shannon from Hak5, I haven’t seen any real problems with it.  As I have come to expect with Ubuntu and it’s derivatives, everything in my new Dell Laptop including the web cam and finger print reader, were found and configured during the install.  So far, everything was going great.

I installed Vmware Workstation, even though PinguyOS comes with VirtualBox and Vmware Player pre-installed.  This was done mostly because I actually use the higher end features like VM Teaming and network manipulation.  VM Teaming allows you to group a set of VM’s into a team that then share a special network and can be managed as a group.  It is really nice when you are setting up a demo system where you need multiple servers or a mix of workstations and servers.  Even though I wasn’t dual booting, I set the system up like I was.  Then after getting all of this up and migrated to an SSD, I created a VM out of the original install of Windows 7 from the native spindle hard drive.  This give me the benefit of booting both Windows and Linux from the SSD.  It’s just plain fast.  As I said in a recent podcast, both Linux and Windows(as a VM) boot in less than 15 seconds.  The majority of the other VM’s I need are stored on the original 750GB spindle hard drive.  After getting myself to a workable state, I started migrating the rest of my world off of Windows and into Linux.

Setting up mounts to the corporate network was simple. go to the Samba setup app and with a few clicks and a little typing everything was available.  Connecting to Windows machines I required access too for various AD and other tasks was even simpler with the Reminna Remote Desktop Client.  This was probably one of the finds that made me the happiest.  I have long searched for a putty type program for Linux.  By that I don’t mean the SSH part but the session/server list part.  The customers I am working with are all within different types of business markets and there is no standardization in their systems names.  So having a client app I can store the system names in, is awesome.  The great part of this is that whether it’s Windows or Linux, I can use the same program and connect to anything that I need too.  I use Eclipse for my IDE when developing in Python, shell and JavaScript.  As with most Java applications, it works fine and took no more effort to configure on Linux than it does on Windows.  Pidigin is what I chose for my instant messaging needs.

Now for the things that have, in the past, stopped me from switching to Linux completely as a work desktop.  Office and E-mail apps seem to be hard to keep compatible and usable.  I have been working with this system for just over two months now.  I keep switching from running MS Office and Exchange in a Windows VM,  to using LibreOffice and the Web client for Exchange and back again.  I haven’t found a good native client for Exchange, and by that, I just mean one I like.  There are several workable solutions but each is missing something I need.  So for now, I have decided to stick with a Windows VM for them.

The next issue has been VPN Clients.  This was not an area that  I thought would be a problem at this time.  I have used VPN’s on Linux before and read plenty of articles talking about how easy it is to set up Linux to talk to just about any VPN.  From my experience, it just doesn’t seem to be working that way.  At one client, they are using a Cisco VPN.  I have the Linux Cisco VPN client installed, but need to compile it to make it work.  That is fine and I am capable of doing it, but it is not very fun.  Several hours of work later, I finally got it working.  On the other end of the spectrum is a smaller client who is using a WatchGuard firewall.  It’s a Linux based appliance and supports OpenVPN.  Within about 30 minutes, I had the VPN up and working.  The only client I will be supporting that has forced me to use a VM to connect to, is one that requires you run a check for AntiVirus software which only supports a small list of Windows software.  When I asked if I could get help connecting with Linux, the silence on the other end of the phone had me convinced we had gotten disconnected.  So for them I will just fire up a VM.

The only Linux oddity I have experienced is a missing mouse pointer.  While it’s still completely functional on my two monitor setup when using VMWare, the pointer occasionally disappears.  I can still move it around and highlight menus, but I cannot see it.  If I logout and back in, it comes right back and will often work on one screen but not the other.

The thing I like the best so far is Conky and the Docky app.  Docky looks like the MacOSX dock with shortcuts to your favorite apps on it.   Conky, the system status widget on the PinguyOS screen snapshots, gives you CPU usage, Network usage and the like.  It’s extremely customizable and easy to use.  Both of these are great tools that make life just that little bit more useful and fun.  The system is fast, stable and everything works.

I am a linux lover for servers.  I love the stability and tools available to stand up machines consistently.  I like the control and manageability I get and find troubleshooting it easier than any other OS I get asked to support.  (Yes even other *nix flavors.)  I would say that my experience with Linux on my desktop doesn’t quit leave me with the same passion for it on my desktop as I have for it on my servers.  However, it is completely usable, fully functional, and will probably be the base for my next computer build at home.  If you are going to switch to a full time Linux desktop,  I strongly suggest following my path.  I have been able to remain completely functional while I work out what I need,  to get my job done.  For most normal situations, VMWare Player or VirutalBox should work so you don’t need to invest the $180 for VMWare WorkStation.  I believe that at the one year mark, I will have myself completely switched over to Linux.  I will write another story at the one year point and update the news blog as I find cool new tools to use as replacements for MS and Mac Tools.

How do I get Xwindows to work when I am using an encrypted Drive?

My friend Mike Jansen pinged me this afternoon with an interesting problem.  

Here is the background:

He has setup a Linux VM and needs to get to it remotely from his PC running Windows.  He has xming(A great free XWindows server for Windows) and connects to the machine over SSH.  He decided he would take security to the next level and encrypted his personal directory.  Interesting fact is that when you do this on Ubuntu your home directory isn’t decrypted or mounted until you actually login.  Why is that a problem?  Well as part of the login process SSH puts the magic-coookie XWindows needs to start into your /home/<UserID>/.Xauthority file.  The next thing that happens is that your encrypted directory is decrypted and mounted to /home/<UserID>/ which then hides /home/<UserID>/.Xauthority under the mount.  At that point it breaks X and stops you from running the XWindows Programs.  Unless you do something like what Mike pieced together.  What Mike has below should work system wide for all users.  You should as with all scripts test this out on a non-production system first.

Here is what he gave back to be to post to for everyone:

So I got my issue with encrypted home and ssh/xauth figured out. The solution is actually simple once it’s figured out 🙂

The basic idea for xauth transfer was from


The idea for this came from the man page for SSH. 

I got rid of ~/.ssh/rc and put this in /etc/ssh/sshrc:

if read proto cookie && [ -n "$DISPLAY" ]; then
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
# X11UseLocalhost=yes
echo add unix:`echo $DISPLAY | cut -c11-` $proto $cookie
# X11UseLocalhost=no
echo add $DISPLAY $proto $cookie
fi | xauth -q -
MYXAUTH=/home/.ecryptfs/`id -un`/.xauth
xauth list > $MYXAUTH
chmod go-r $MYXAUTH

Mount encrypted home

The idea’s behind this section came from this page

In /etc/profile, I mount encrypted home (if it’s not already mounted):

if test -e $HOME/.ecryptfs/auto-mount; then
mount | grep "$HOME type ecryptfs"
if test $? != 0; then


I got rid of ~/.bash_login and put this in /etc/bash.bashrc:

# Load xauth information from pre-encrypt mounting ssh initialiation
MYXAUTH=/home/.ecryptfs/`id -un`/.xauth
if [ -e "$MYXAUTH" ]; then
xauth add `cat $MYXAUTH`

Sample SSH LOGIN after Implementation

Here’s what my ssh login looks like now (I have a bunch of outputs to understand the flow and make sure my real and effective uid’s are what I expect):

Using username "mike-jansen".
Authenticating with public key "REALLY_COOL_DEV_SERVER" from agent
Welcome to Ubuntu 11.04 (GNU/Linux 2.6.38-11-generic-pae i686)

* Documentation:

56 packages can be updated.
29 updates are security updates.

Last login: Thu Sep 22 15:48:24 2011 from
------ BEGIN /etc/ssh/sshrc Real [mike-jansen] Effective [mike-jansen]
------ END /etc/ssh/sshrc Real [mike-jansen] Effective [mike-jansen]
------ BEGIN /etc/profile Real [mike-jansen] Effective [mike-jansen]
Enter your login passphrase:
Inserted auth tok with sig [c46ead8832a353d7] into the user session keyring

INFO: Your private directory has been mounted.
INFO: To see this change in your current shell:
cd /home/mike-jansen

------ BEGIN /etc/bash.bashrc Real [mike-jansen] Effective [mike-jansen]
------ END /etc/bash.bashrc Real [mike-jansen] Effective [mike-jansen]
------ END /etc/profile Real [mike-jansen] Effective [mike-jansen]
------ BEGIN ~/.profile Real [mike-jansen] Effective [mike-jansen]
------ BEGIN ~/.bashrc Real [mike-jansen] Effective [mike-jansen]
------ END ~/.bashrc Real [mike-jansen] Effective [mike-jansen]
------ END ~/.profile Real [mike-jansen] Effective [mike-jansen]




*For those who don't know ~ is a shortcut to the current users home directory as recorded in the user repoistory for the system.







Microsoft isn’t really afraid of Linux

According to their latest fillings with the SEC Microsoft claims that Linux is no longer a threat on the desktop.  This story over at Business Insider tries to make more of it than it really is. I personally love seeing Linux getting the Apple treatment.  After playing with PinguyOS for the last couple of weeks I am starting to change my opinion on Desktop Linux.  I am running Windows apps in VMWare just like I have always done with Linux when I am forced to use Windows.  While there are only a few things I need to do in Windows I still can’t live without it at work.  So let Microsoft and others keep thinking that Linux can’t do the desktop.  Remember they thought the Internet was a FAD also.