Error/Fix: OOM (out of memory) killer kills mysqld every time!

Error (or undesired behavior, in this case): Out of Memory killer kills mysqld when memory runs low. I’d rather have it kill apache processes instead.

Fix: specifically exclude OOM from killing the mysqld process with:
echo -17 > /proc/`cat /var/run/mysqld/mysqld.pid`/oom_adj

Error/Fix: Error: Invalid Private Key with Amazon ELB

When setting up an Amazon Elastic Load Balancer (ELB) with SSL:

Error: “Error: Invalid Private Key” when attempting to upload your keyfile to Amazon EC2

Fix:

Convert the key to a format that ELB likes with the command:

openssl rsa -in somekeyfile.key -outform PEM

edit: I got this message today “Error: Unable to parse certificate.” when I was adding a new SSL certificate for a loadbalancer. It turned out to be my key. The command above fixed it.

AWS customer service

I must admit I’m a bit surprised. This morning, I tweeted about a DNS issues I was seeing on some EC2 instances (which turned out to be a Godaddy problem)
Amazon responded to my tweet by opening up a support case:
Hello,
I am sorry to hear that you are having issues with DNS Services, Can you please let us know what issues you are seeing so we can resolve this for you.
Best regards,
Amazon Web Services

I must admit, I’m surprised and impressed. Good job AWS!

vi: change all uppercase to lowercase (and vice-versa)

It’s easy to change from uppercase to lowercase in vi!
:%s/.*/\L&/

or to change from lowercase to uppercase
:%s/.*/\U&/

Raspberry Pi case made from cardboard, cardstock, paper or plastic

A few months ago I designed a case for my Raspberry Pi that I could cut out of cardstock with a Silhouette Cameo.

img_3670

(this case is cut out of an overhead projector slide)

 

It was inspired by the Punnet case.  Except I wanted something that didn’t require glue to assemble and was a little more compact.

img_3664

Punnet case (bottom), rev1 (middle), current design (top)

 

The Silhouette file is downloadable from my raspberry-pi-case github project.

pi-layout

I’d like to change the vent in the top to be a raspberry, but haven’t had the time to make that change yet.

 

 

Remove a stuck DVD/CD from a MacBook Pro

So, I burn a fresh CD in my MacBook Pro and it gets stuck. When I hit the eject key, it tries to come out but only pokes out a couple of millimeters before getting sucked back in.
Searching all over the internet, Mac users were useless for helping me. Everyone suggested alternate ways to eject the disc (push the eject key, command-E, drag the disc to the trash, hold down the mouse button on boot) ignoring the fact that it may be physically stuck.

Then I found the solution (queue the angelic choir)

*** Do this at your own risk. It worked the first time for me but I take no responsibility for you doing something stupid and messing up your laptop. ***

There are two levers on a slot-loading CD/DVD drive that help center a CD/DVD disc. Some CDs and DVDs have an uneven edge which can cause enough friction to prevent the disc from ejecting.
If this happens follow these steps:

1. Take a large paperclip and grasp it with one hand so that about three quarters of an inch, or 18 millimeters, extends beyond your fingers. Insert the paperclip into the CD/DVD slot about 1.5 inches, or 36 millimeters, from the left edge of the slot.
2. With the other hand, push the eject key on the keyboard to eject the disc. When you hear the disc attempt to eject, slide the paperclip to the left edge of the slot and then remove the paperclip. You should feel a little resistance from the spring loaded centering lever.
3. Once the disc has been successfully ejected, wipe the outside edge of the CD/DVD with your hands. Cleaning the edge of the disc in this way will reduce the likelihood of the disc becoming stuck again.

 

Error/Fix: ‘SSLv2_method’ undeclared here (not in a function)

When building ruby 1.9.2 on Ubuntu 11.10
Error:
ossl_ssl.c:110:1: error: ‘SSLv2_method’ undeclared here (not in a function)
ossl_ssl.c:111:1: error: ‘SSLv2_server_method’ undeclared here (not in a function)
ossl_ssl.c:112:1: error: ‘SSLv2_client_method’ undeclared here (not in a function)
make[1]: *** [ossl_ssl.o] Error 1
make[1]: Leaving directory `/home/username/.rvm/src/ruby-1.9.2-p180/ext/openssl’
make: *** [mkmain.sh] Error 1

Fix:
rvm pkg install openssl
rvm install ruby-1.9.2-p180 –with-openssl-dir=$rvm_path/usr

Uninstalling Google packages from Ubuntu

So, you installed an app from Google (Chrome or Google Music Manager) but are done with it and now you want to remove any traces of the Google software…
You’d think that sudo dpkg -p <packagename> would do it but Google’s a little more sneaky than that… They took the liberty of adding their repository to your machine. To remove it you need to perform the following steps.
sudo rm /etc/apt/sources.list.d/google-musicmanager.list
sudo apt-key del linux-packages-keymaster@google.com

As a side note, it doesn’t seem right that they add the repository settings with a cron job instead of at the install of the package. It seems fishy to me because if you remove their repository settings without disabling their cronjob, their settings will come back the next day. Check out /etc/cron.daily for any google files before you uninstall their package to see what they are up to.

OfficeMax Coupon Code

Another OfficeMax Coupon code. It’s good for $30 off your online purchase of $150 or more. Expires 12/17/2011

ZAH4HYK3UH8TXHBB

Please post a comment here if you use it so that others won’t waste their time trying.

Error/Fix: Disable byobu (screen) from automatically starting on login (EC2)

Error:
If you run Ubuntu 11.10 (Oneiric Ocelot) on Amazon EC2, you may notice an annoying “feature” that they enabled on this release. A byobu session is started when you login.

Fix:
Fortunately, this is easy to fix:
rm /etc/profile.d/Z98-byobu.sh

Note:
Also fortunate, this will not be the case for future releases as it has been removed.

Go to Top