Tuesday, June 30, 2009

Fixing RHL up2date InvalidRedirectionError

I wanted to install pstack on Red Hat Linux and decided to use up2date for the first time. I kept getting an InvalidRedirectionError when it tried to update pstack's gdb dependency. Looking in the /var/log/up2date file I had:

[Fri Jun 26 14:05:22 2009] up2date   File "/usr/sbin/up2date", line 1312, in ?
sys.exit(main() or 0)
File "/usr/sbin/up2date", line 813, in main
fullUpdate, dryRun=options.dry_run))
File "/usr/sbin/up2date", line 1160, in batchRun
batch.run()
File "/usr/share/rhn/up2date_client/up2dateBatch.py", line 93, in run
self.__getPackages()
File "/usr/share/rhn/up2date_client/up2dateBatch.py", line 225, in __getPackages
up2date.getPackage(pkg, wrapperUtils.printPkg, wrapperUtils.printRetrieveHash)
File "/usr/share/rhn/up2date_client/up2date.py", line 180, in getPackage
buf = rpcServer.doCall(repos.getPackage, pkg, msgCallback, progressCallback)
File "/usr/share/rhn/up2date_client/rpcServer.py", line 238, in doCall
ret = apply(method, args, kwargs)
File "/usr/share/rhn/up2date_client/repoDirector.py", line 37, in getPackage
return self.handlers[channel['type']].getPackage(pkg, msgCallback, progressCallback)
File "/usr/share/rhn/up2date_client/rpmSource.py", line 186, in getPackage
package = source.getPackage(pkg, MsgCallback, progressCallback)
File "/usr/share/rhn/up2date_client/repoBackends/up2dateRepo.py", line 201, in getPackage
fd = self.s.getPackage(channel, filename, offset=startpoint)
File "/usr/lib/python2.3/site-packages/rhn/rpclib.py", line 622, in __call__
result = self._send(self._name, args)
File "/usr/lib/python2.3/site-packages/rhn/rpclib.py", line 290, in _request
raise InvalidRedirectionError("Too many redirects")


I'm not sure what had happened previously on this particular lab machine, but it looks like a previous attempt to update gdb was corrupt, or perhaps interrupted. When I deleted /var/spool/up2date/gdb-6.3.0.0-1.162.el4.x86_64.rpm, then the up2date command worked like a charm.

How to uninstall Subversion on Mac OS X

I ran into this problem today where I was trying to uninstall Subversion 1.6 so I could install 1.5 instead. So, according to the instructions, you only need to delete the /opt/subversion directory and all of the sym links in /usr/local/bin that point to /opt/subversion. After doing this I tried to run the Subversion 1.5 installer and kept getting this message:

You cannot install Subversion 1.5.4 on this volume

The way to solve this problem is to delete Subversion-1.6.1.pkg from /Library/Receipts. Then I was able to run the Subversion 1.5 installer.

Thursday, June 4, 2009

How I work in a Mac OS X environment

I've been using a Mac as my exclusive desktop at work for the last few months. I've learned a few tricks to keep my hands on the keyboard and away from the mouse as much as possible. This is to prevent any repetitive use injuries like Carpal Tunnel Syndrome. Here are a few things that I've started doing to make things easier for me.
  1. Hide, don't minimize! Coming from Windows OS, I used to minimize windows frequently and keep them down in the task bar. In Mac OS X, you can easily minimize a window to the Dock with Command-M. However, you cannot easily restore the window with a simple keystroke. While Command-Tab allows you to cycle through your open applications, it doesn't really let you cycle through your windows. So, if you select an application via Command-Tab, you may or may not get the minimized window to restore. If you are using Command-Tab, as you select your application, keep holding down the Command button and then also select the Option key as you release. This will allow you restore a window. However, it is extremely awkward to me. So, instead of minimizing windows, now I just hide them. Using Command-H will hide the application, and cycling through Command-Tab will bring it back.
  2. Quicksilver is a fast and easy tool to launch applications. I highly recommend this free utility. I don't navigate to the Applications folder anymore to start a program. With Quicksilver, I just type Control-Space to open a window where I can type in the first few letters of the application I want. I know that using Command-Space will open Spotlight and you can achieve the same thing. It's just a matter of preference.
  3. Gnu screen instead of multiple terminals. I have recently started using screen. I usually need a lot of ssh sessions open to various machines here at work. Instead of having half a dozen terminal windows, I only have one terminal running screen. There are a few getting started type tutorials out there on the internet, and I suggest that if you find your desktop cluttered with terminal screens you should spend a little time learning screen.