Monthly Archives: February 2013

Adding User to a Group in Linux Ubuntu from command line

How to add an existing user to existing group?
using -a -G option, adds user to the supplemental group(s).

sudo usermod -a -G [groupname] [username]
How to change existing david’s primary group to www?

sudo usermod -g www [username]


How to verify user settings?

id [username]



Cannot set more than 1 cpu in Vagrant

I recently ran into the problem of NOT being able to set more than one cpu (core) in virtualbox for vagrant.  I am running Ubuntu 12.10 64 bit server edition on the VM. Turns out i needed to add a flag and turn –ioapic on.

VBoxManage modifyvm <VM_Name> –ioapic on

Thus, inside my Vagrantfile (config file), I have something like the following.




set static ip for ubuntu 12.10 server

sudo vim /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p5p1
iface p5p1 inet static

Since Ubuntu 12.04 the handling of resolv.conf changed.

If you want to add your own nameserver address(es) then edit the file /etc/resolvconf/resolv.conf.d/head
and add your nameserver there (eg: Google open dns)

sudo vim /etc/resolvconf/resolv.conf.d/head


save the file and then run

sudo resolvconf -u

restart network settings

sudo /etc/init.d/networking restart

cronjob to integrate git repository with redmine issues

using the following…
ruby version: ruby-1.9.3-p374
gemset: redmine
redmine installation location: /var/www/redmine-2.2.2

#!/usr/bin/env bash
source /usr/local/rvm/environments/ruby-1.9.3-p374@redmine

cd /var/www/redmine-2.2.2

/usr/local/rvm/gems/ruby-1.9.3-p374@redmine/bin/rake -f /var/www/redmine-2.2.2/Rakefile redmine:email:receive_imap RAILS_ENV="production" port=993 ssl=1 username=XXXXXX password=XXXXX folder=inbox project=XXXX allow_override=project,tracker,priority,assignee,status,category --trace

rails runner "Repository.fetch_changesets" -e production