December 29, 2005

Windows XP and Ruby on Rails

Just a quick "how did I?" on making it so I could use PostgreSQL and MySQL on my Windows XP laptop with Ruby.

I was writing an application for work using the ActiveState Komodo IDE that parses e-mails in preparation for inserting them into a database. I knew that no matter how I connected to the database, I would need to do proper quoting so there wouldn't be any "surprises" with the data I inserted.

I ended up going with using a module that is part of Ruby on Rails, ActiveRecord (many of its functions automatically do the quoting). When I installed that, MySQL worked fine out of the box. For PostgreSQL I also had to also install postgres-pr.

I leveraged gem to load both. I am using the precompiled version of Ruby you can get by following the download links on their web site...and other MySQL/PostgreSQL options were complicated by their complile environment being different than mine...so anything that required a compilation was pretty much out of the picture.

Either way, without going into the specific items I tried that failed, you can read above what I did that succeeded :-)

Posted by alan at 4:42 PM

October 15, 2005

SELinux and loading dynamic Apache modules

This past week, for work, I set up a KnowledgeTree document server. It required installing MySQL, PHP, Apache, Java, and the IMAP Toolkit.

It actually went pretty well, but I did hit a wall when I went to start Apache. System Admin uses Fedora Core 4, and from what I can tell, it automatically runs with SELinux. Either way, I kept getting this error starting Apache:

Cannot load /usr/lib/httpd/modules/libphp4.so into server: /usr/lib/httpd/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied

Most hits I found searching on the web suggested turning off SELinux via "setenforce 0" which, I guess (based on the man page) turns SELinux into "permissive" mode.

This seemed like a bit of overkill, and searching I found this instead:

chcon /usr/local/apache2/modules/libphp4.so -t shlib_t

That did the trick...

Posted by alan at 12:09 PM

June 24, 2005

Add a company search box to Opera

I work for Tickets.com and we use a tool called Call Tracking to, of all things track stuff :-)

Either way, frequently I'm bouncing between cases, using only the case number. The main Call Tracking page has a form with a box to enter this, but it's a bit of a pain to have to keep that page open, and to switch back to it. Then it hit me, Opera probably would allow me to add it as a search dialog on my personal bar. Although it's a bit risky (because Opera doesn't support the changes, and upgrades may whack it), it sure was possible :-)

Opera 8 uses a search.ini file to define searches (if you have localized settings it'll be C:\Documents and Settings\YOURNAME\Application Data\Opera\Opera\profile\search.ini). You have to choices...you can edit it by hand:

http://www.schrode.net/opera/search/search_ini.html

Or you can use the free Opera Search.ini Editor (which is what I did to make sure I didn't hose up the file).

operasearchadd.gif

After that, right-click on your personal bar and select your search engine (please note, if you don't choose a keyword, you will not be able to select it in that list). You can see how I slected it in the image above.

(One more note, replace the value in the GET query string you would normally see in your address bar with %s...that is all I did to get our simple Call Tracking URL to work. E.g. "http://.../search.cgi?target=%s" versus "http://.../search.cgi?target=87711".)

Posted by alan at 2:38 PM | TrackBack

June 23, 2005

Vmware tools hosed up the mouse

I have VMware Workstation to allow me to run Linux on my Windows XP laptop. It is really slick (I'm using 4.5.2...5.0 is available).

Either way, after installing "VMWare Tools" on the UNIX system, I couldn't get X Windows to load...it said it couldn't start because of a mouse problem (couldn't find /dev/mouse).

Thanks to this link, I was able to solve it:

http://www.vmware.com/community/thread.jspa?threadID=16918&tstart=60

Basically, the setting in /etc/XF86Config should have been /dev/input/mice instead of /dev/mouse. It seems to me the installation may have stopped X from looking at /etc/X11/xorg.conf, which had the right setting.

Why use VMware Tools? From the VMware Workstation Users Manual:

For best performance, it is important to have VMware Tools installed and running in your virtual machine...

A suite of utilities and drivers that enhances the performance and functionality of your guest operating system. Key features of VMware Tools include some or all of the following, depending on your guest operating system: an SVGA driver, a mouse driver, the VMware Tools control panel and support for such features as shared folders, drag and drop in Windows guests, shrinking virtual disks, time synchronization with the host, VMware Tools scripts, and connecting and disconnecting devices while the virtual machine is running.

Posted by alan at 6:51 PM | TrackBack

June 9, 2005

Iomega Application Services

Yesterday, listening to a CD via my external USB Iomega Super DVD on iTunes in Windows XP SP2, my computer was sluggish to a point of appearing to hang.

My previous laptop, regardless of whether I was actually using the Super DVD, started misbehaving after I installed the software that came with the Super DVD. Sometimes I literally couldn't kill applications, and I think other applications would never fully start (that is, show up in the process table, but never become visible). I wasn't sure, but I believe it only started acting weird after the first time I went into and came out of hibernation (so things were clean if I used the computer from a fresh start or restart).

Getting back to yesterday, when I looked at the task manager's list of processes, appservices.exe was hogging all the CPU. Killing it fixed the problem. But, what is the "real" solution?

I'm hoping the Iomega Application Services patch will solve it as it appeared to remedy the other issue I mention above. I'm creating this "nerd note" hoping that a search engine in the future might find it, saving some other victim of wayward application services from having to poke around as much as I did. (Also, when I went to look for the link on Iomega's support site yesterday, they don't seem to make it easy to locate. Luckily I had save the link from my last bad experience.)

Lest it sound otherwise, the Super DVD is great. This XP service is an add-on required by some of the Iomega software (e.g. Hotburn Pro).

Posted by alan at 8:30 AM | TrackBack

May 5, 2005

iPod Mini and not playing iTrip stations in Shuffle mode

Mostly with AMEX points, I got a new 6GB iPod mini -- awesome. Today in the mail I got the Griffin iTrip for it. To allow it to tune to any open station, it uses mp3 files for each frequency. In shuffle mode, this leads to...well...from their documentation:

In Shuffle mode, iTrip Stations get played. Can I avoid this? The iTrip stations are included in the iPod's library, so they might occasionally get played - but there is a great way to avoid this. Create a Smart Playlist that includes all your music except the iTrip stations. See our website for specific instructions on how to do this - http://www.griffintechnology.com/support.

I actually went at it another way. I converted the mp3 files to AAC, and then changed the extension from .m4a to .m4b. When these files are transfered to the iPod they show up under audiobooks, and audiobooks do not automatically get played in Shuffle mode.

Of course, this may not be the best option for those who actually use audio books a lot on their iPod...but it works well for me :-)

Feel free to download a zip file of the .m4b files I created.

Posted by alan at 8:57 AM | TrackBack