Reminder for mysql rubygem install on Ubuntu

Quick easy steps to get up and running with ruby, mysql, sqlite, rails, and most especially the mysql gem on a fresh Ubuntu 10.10 64-bit system:

1
2
3
4
5
6
7
8
9
# mysql and dev packages needed for mysql rubygem:
sudo apt-get install mysql-server mysql-client libmysqlclient-dev \
libmysqld-dev
# Needed for ruby-debug:
sudo apt-get install ruby1.8-dev
# Rails package includes lots of goodies you'll likely want:
sudo gem install rails sqlite3 ruby-debug
# And finally the gem:
sudo gem install mysql
Posted in Programming, Ruby | Tagged , | 1 Comment

Amazon MP3 Downloader on 64-bit Ubuntu

We were in need of some additional holiday tunes and wanted to download this splendid album from Amazon. As it happens, I had my newly set up 64-bit Ubuntu system running 10.10, Maverick Meerkat. I’ve used the Amazon MP3 Downloader on 32-bit Ubuntu systems without a problem. But when I tried to install the deb labelled for “Ubuntu 9.04″ it complained about it being for the wrong architecture.

I came across this post, and then this post after it still wasn’t working. Here’s what ended up being the right process.

First you need to install getlibs, which as reader Adam thankfully pointed out, is not in the Ubuntu repos. This is the main post about it, but unfortunately the download link that worked for me before is down now. This post has information on it getlibs general use if you are interested.

Next download the Ubuntu 9.04 deb from this page. Then in your favorite terminal navigate to the folder you downloaded the deb to. Next up:

1
2
3
4
5
6
7
# getlibs allows you to grab 32-bit libraries for
# packages on 64-bit systems:
sudo apt-get install getlibs
# Now install the deb ignoring the architecture issue:
sudo dpkg -i --force-architecture amazonmp3.deb
# And grab the missing libraries:
sudo getlibs /usr/bin/amazonmp3

If you try to run amazonmp3 now you will get an error: “Error: Dependency is not satisfiable: libboost-filesystem1.34.1″. Let’s fix that:

1
2
3
4
5
6
mkdir old_boost
cd old_boost
wget https://launchpadlibrarian.net/26959932/libboost-signals1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/26959936/libboost-thread1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/26959922/libboost-iostreams1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/26959918/libboost-filesystem1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/26959916/libboost-date-time1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/26959928/libboost-regex1.34.1_1.34.1-16ubuntu1_i386.deb https://launchpadlibrarian.net/34165098/libicu40_4.0.1-2ubuntu2_i386.deb
sudo dpkg -i --force-architecture *.deb
cd ..
rm -r old_boost

Almost done.

1
2
3
4
# For good measure:
sudo getlibs /usr/bin/amazonmp3
# Start it up
amazonmp3

If all is well it should look like this:

After this point I was able to download the album from Amazon without a hitch! Note that you don’t have to start it from the command line, that was just as a test. You can also launch it from Applications -> Internet in the Gnome menu, or just launch it from the link on Amazon when buying a song.

Posted in Desktop | Tagged , , , | 7 Comments

Adobe AIR on 64 bit Ubuntu: install easily at last!

Consider this an extra Christmas present, at least I considered it as such :-) Back in this post I discussed various issues with 64-bit Ubuntu systems after an upgrade. And now 15 months later I upgraded a laptop that had been running 32-bit Ubuntu for some time. As I went through my checklist of upgrade tasks, I cringed when Adobe AIR came up. I love Pandora One, and I love TweetDeck, but installing AIR on a 64-bit Linux system… pretty much no love there. I mean come on, look at these instructions. After a few steps (several of which fail or act pretty differently than shown when on Ubuntu 10.10, I might add), you have to ask if you really care that much.

But thankfully I decided to try a bit more Googling and came across this lifesaver post. First of all, I’d like to say I think his solution is pretty damned sweet. He takes the 32-bit AIR deb package, pulls out certain pieces, changes the architecture specified, then repackages it. Then you can just install it like it’s a 64-bit package and no one need be the wiser.

I’ve confirmed this process works without a hitch on Ubuntu 10.10 running 2.6.35-24-generic kernel. Afterwards I installed Pandora One and TweetDeck, which ran without issue.

Posted in Desktop | Tagged , , , | 1 Comment

Handy tips for bash scripting: screen reminder and logging

Often I find myself writing simple wrapper scripts for long-running tasks, like migrating a database or performing some repair or optimization process. I mainly want to ensure proper logging is kept in order to determine how long each step takes and so I have a record (aside from avoiding executing each step manually more than once).

Screen reminder

Since these operations are also usually important I want to make sure I run them in screen so they don’t screech to a halt if my connection happens to timeout or otherwise disconnect. The problem is that I create these scripts pretty organically, primarily aggregating commands I run step by step on test systems, adding some helpful output, etc. During the creation process I am jumping between different terminal views so running in screen isn’t on my mind. To save myself some heartburn from the potential of starting the real thing without being in screen I’ve taken to adding this to the beginning of such scripts:
Continue reading

Posted in CLI | Tagged , , , | 7 Comments

Troubleshooting MySQL queries: a useful workflow

Configuring and optimizing MySQL servers, from the underlying hardware to the instance settings on up to the application queries, is a multi-faceted and complex process. Here I’d like to assume you’ve got a well-configured physical server (it’s at least functioning and not manifesting any obvious issues) and that you have some decent configuration settings in place. If you’re still facing what you think to be sub-optimal performance, I’m going to describe a workflow you might find useful in your investigations.
Continue reading

Posted in MySQL | Tagged , , | Leave a comment