Thursday, 27 November 2014

What do to when cron refuses do run your Ruby script (using RVM and Bundler)

The reason this was happening to me was that I was using RVM, as well Bundler on a production server. This was the first time I used RVM in production, and I hoped it would run super smooth... Alas!
The main Sinatra web application was running perfectly, but the background script simply would not run, and there was no output either. Adding some debug statements in crontab revealed that all other operations ran perfectly both before and after the Ruby script.

Tuesday, 18 November 2014

How to make new files and directoris inherit group and permissions in GNU/Linux

~$ mkdir dir
~$ cd dir/
~/dir$ chmod -R 770 .  # gives full permissions to owner&group, none to others
~/dir$ chmod -R g+s .  # makes new files and dirs inherit group ownership
~/dir$ chgrp -R grp .  # changes group ownership to "grp"
~/dir$ ls -la
total 8
drwxrws--- 2 usr grp 4096 Nov 18 07:42 .
drwxr-xr-x 6 usr usr 4096 Nov 18 07:42 ..

Monday, 10 November 2014

How to prevent Ubuntu from running all kinds of processes slowing the computer down at 7:30am

I like to work early in the morning, and have been pretty annoyed when my relatively slow Asus eee seemingly randomly ground almost to a complete halt for a few minutes every morning. I noticed eventually that this happened around 7:30, and I usually had to kill some processes, such as these, to get work done:
/usr/bin/python /usr/sbin/update-apt-xapian-index --update --quiet
/usr/bin/find / -ignore_readdir_race ( -fstype NFS -o -fstype nfs -o -fstype nfs

It turns out that anacron was set up (presumably by default) to run all the daily cron jobs (defined in /etc/cron.daily) at 7:30.

Saturday, 1 November 2014

Getting a network connection in Ubuntu 14.04 (Trusty) on a Dell Inspiron 6400 with Broadcom wired and wireless chipset


The computer had no wired or wireless connection.
When clicking the Network manager icon, the first line read No network devices available.
This was an ancient Dell Inspiron 6400 laptop with Broadcom BCM4311 wireless network adapter and Broadcom BCM4411 wired ethernet adapter. If your computer is not the same, this solution may not work.