November 14th, 2008 — Linux, Other
I’ve had a couple of times now that on one of my computers df keeps reporting 100% disk usage. Until now I have resolved this issue by rebooting. But today this happened on one of our servers. And I was reluctant to boot and I had to solve it fast because mysql was down.
After some searching I found that it was because of a process keeping a hold of some deleted files. So after shuttding down some processes I found the right one and df reported a dropping disk usage %. After starting mysql again we were back up again.
November 12th, 2008 — development, Ruby
I’m now developing a flexible car database for a couple of hours per week. Our first customer, a Beemer dealer, has a lot of fancy requests. Well, the hired-in Flash developer has these requests actually.
One of them is that they want to save a field in the database that contains a unique identification number for the secondhand cars they sell. But this number is set-up in a way that is unique to BMW’s. So actually, I didn’t want to add this column to the database, ’cause that will mess up my clean database tables.
But then I came up with the idea to add functionality to the website where users (dealers in this case) can add custom columns to their cars / profiles.
Instead of creating this functionality from scratch, I first wanted to know if there are any plugins that have this functionality already. I found these three:
- acts_as_free_form
- has-magic-columns
- acts_as_customizable
I haven’t decided (yet) which is best.
And if you want to roll your own, here’s a nice article about choosing the best structure for dynamic fields.
I realize that the story above is written in truly horrible English. But I really didn’t have the energy to make something nice of it…
November 5th, 2008 — development, Linux, Ruby
Very easy to do:
sudo aptitude install ant openjdk-6-jdk
cd ~/src
svn co http://svn.codehaus.org/jruby/trunk/jruby/
cd jruby
ant
bin/jruby --version
October 28th, 2008 — Linux, PHP, Ruby
It was a troublesome day today. All did not go as planned.
I had to install fcgid + suexec on one of our servers, I had delayed it too long. So I used my how-to and it still worked flawless. But I noticed I hadn’t mentioned what the right were of the suexec binary. So here it goes:
chown root:www-data suexec
chmod 4754 suexec
After the install I restarted Apache and looked at one of the sites. And it worked! I was baffled. That’s the first time I installed fcgid without hours long of searching where the flaw was.
But then I looked at our support system (Redmine) and it didn’t work too well
All controllers were being executed ‘n stuff. But the stylesheets, images and javascripts were not loaded. When requesting an image in the browser I got Rails 404-error page. Huh? Apache should have handled that request. At first I thought it was because of some changes I made to the virtualserver configuration of an other Rails site. But after some trial and error I couldn’t find anything that was wrong.
Then I removed the .htaccess from the public directory of Redmine. That once worked for one of my rails sites. But no cigar. Then I noticed that there were a lot of dispatch*example.rb’s in the public directory. And: after removing them, the stuff worked. So it seems like Rails or Phusion Passenger uses some kind of fuzzy matching when searching for a dispatch.rb. And it first just worked because fcgid was not installed. So I don’t know who’s to blame. But the problem is solved. Phew!
October 14th, 2008 — Linux
I wanted to install flash player 10 because flash player nine kept crashing on my Ubuntu 8.10 installation. So I found a nice howto on google an followed it. The article explains how to install it on a 64 bit installation of the Ubuntu operating system.
The howto worked fine, but flash kept crashing. I think it has something to do with the nspluginwrapper package.
[edit]
Flash 10 is now the default install, so this post is no longer needed!
[/edit]
October 1st, 2008 — development, PHP
I think you all noticed my fabulous new sidebar widget: My projects
It shows all of my github projects. I directly turned it into a plugin for you to enjoy. You can download and read the documentation in the wordpress plugin directory.
September 29th, 2008 — Linux
I needed to install a computer for my sister. She want a laptop, but until she has the money for it, she’ll be using one of my old computers.
It’s one with no dvd/cd drive (she doesn’t know that ), so I had to install ubuntu over the network.
First, like I always do:
aptitude install tftpd-hpa
Then make sure /etc/default/tftpd-hpa looks like:
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot -vvvvv"
And make sure you copy the right files to /var/lib/tftpboot. I don’t want to explain that here. If you’re interested in how to make that work: e-mail me or read the Ubuntu wiki.
Then you need a dhcp server that can send where to find the files. My router doesn’t support that (US Robotics), so I needed to install a local dhcp server. Usually I installed a fully-flexed dhcp server, but this time I wanted something simple. Apt-cache search showed me udhcpd. So:
aptitude install udhcpd
Then create /etc/udhcpd.conf and make it look like this (if you have a wireless interface):
dns 192.168.2.1 #Ip address of the local dns server (router in my case)
boot_file hardy/pxelinux.0
Then (re)start both services:
/etc/init.d/tftpd-hpa restart
/etc/init.d/udhcpd restart
Start the computer you want to install and select an option similar to: “Boot from network” and go!!!!!!
I really liked udhcpd: it’s really simple and fast. Tftpd-hpa always has worked great for me, so that’s why I picked it this time too.
There could be errors in this post, I typed it largely without checking. If you can’t figure out how to install it yourself: please let me know via a comment.
September 24th, 2008 — development, Ruby
This will be a short post: I like merb/datamapper better. It’s cleaner and faster.
But, I have to finish a project this week and merb/datamapper is not just stable yet, has less documentation, less plugins, less helpers and less features.
For example, the “has and belongs to many” association in datamapper isn’t fully implemented (look a the tests). There are some nice backend generators for Rails. And if you have to finish a project in too little time, it’s a quick decision.
I know, I could also make/fix this stuff for merb and datamapper myself and I would love to. But there just isn’t enough time! Aaarghhh…
September 20th, 2008 — Linux
I’ve been using Ubuntu/Gnome fulltime now for some 2 years I believe. I never found out what the “show desktop” shortcup was. I always used the little icon. But while I was tweaking compiz I found out that the shortcut was <ctrl><alt>d. I Windows it was Super+D (Windows key + D). So I decided to change the keybinding to that. I couldn’t manage it via the “Keyboard shortcuts” configuration. I kept insisting on Super_L. So I “hacked” it via the gconf-editor. See the screenshot for the correct value:
But, I realized I had to set this up every time I reinstalled Gnome/Ubuntu. So I changed it back to Ctrl+D. Convention over configuration maybe?
September 15th, 2008 — Ruby
I have this public/images/cars directory but it gets overwritten everytime I use “cap deploy”. So in order to have my images/cars directory saved every time, I used this addon for capistrano:
set :assets, ['images/cars']
namespace :deploy do
task :after_deploy do
copy_assets
end
end
namespace :deploy do
desc "Link in the production database.yml"
task :copy_assets do
self.assets ||= []
assets.each do |asset|
run "cp -r #{previous_release}/public/#{asset} #{release_path}/public/#{asset}"
end
end
end
Worked like a charm for me!