Configuring ddclient

ddclient updates IP addresses at dynamic DNS services.

# install ddclient
$ sudo apt-get install ddclient


Selected in the installation process and followed the prompts. Did not need to manually enter anything.


Enable Dynamic DNS for your domain
Login to your Namecheap control panel and enable dynamic DNS for your domain.
You’ll get a really long password string to use. Save that for now as you’ll need it later on.
namecheap dynamic dns password

$ sudo nano /etc/ddclient.conf

# example configuration
# the login is the domain name and password is the hash you saved in the prior step called ‘Dynamic DNS Password’.

# Configuration file for ddclient generated by debconf
# /etc/ddclient.conf

use=web,, web-skip='IP Address'

# remove cache
$ sudo rm /var/cache/ddclient/ddclient.cache

# force update, you may need to delete cache
$ sudo ddclient --daemon=0 --debug --verbose --noquiet

# another configuration file
$ sudo nano /etc/default/ddclient
# to enable automatic updates you must enable the daemon, see specified settings


# restart ddclient
$ sudo /etc/init.d/ddclient restart


ddns, Dynamic DNS

Setting up Ubuntu Server on Laptop

Dell Latitude D630

Ubuntu Adding Packages

When attempting to install a program thru apt-get the most frustrating moment is when the program cannot be found and what’s worst is not being able to add the package to install the program. In the past attempting to add packages by editing /etc/apt/sources.list has been unsuccessful but success has came from adding thru “apt-add-repository” command line command. Here are examples.

Where to find packages
ppa packages info

To install cmake:
$ sudo apt-add-repository ppa:kalakris/cmake
$ sudo apt-get update
$ sudo apt-get install cmake

To install emacsen-common:
$ sudo add-apt-repository ppa:kubuntu-ppa/backports
$ sudo apt-get update
$ sudo apt-get install emacsen-common

To install cheese
# adding a line to your /etc/apt/sources.list like this:
deb precise main universe
$ nano /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install cheese

View package info

$ apt-cache policy [package name]
# apt-cache policy cheese

Stop ubuntu from Hibernating, fixing crontab

Recently I was having issues with cron not executing between the times of 10pm to 9am and when I didn’t access the server for an extended period of time. The issue I found was that my server was hibernating/sleeping at those times and cron doesn’t execute if that happens. My ubuntu server doesn’t have a GUI so everything needs to be configured in the command line. So here is what I did.

edit the grub file:

$ sudo nano /etc/default/grub

Add the kernel options “acpi=off apm=off” to the GRUB_CMDLINE_LINUX_DEFAULT:


Then run:

$ sudo update-grub

Reboot your computer.


turn off ubuntu server hibernation

Multiple Remote Virtual host and sub domains

Just by doing whats below the server will automatically recognize if its requesting or and navigate to the correct page. No additional configuration is necessary, everything to make subdomains and virtual host work is here.

$ sudo nano /etc/apache2/sites-available/

    # domain:
    # public: /var/www/mulsite/

    <virtualhost *:80>

      # Admin email, Server Name (domain name) and any aliases

      # Index file and Document Root (where the public files are located)
      DocumentRoot /var/www/mulsite/

$ sudo a2ensite
$ sudo service apache2 reload


For subdomain:
configure you dns provider godaddy or

$ sudo nano /etc/apache2/sites-available/

    # domain:
    # public: /var/www/mulsite/

    <virtualhost *:80>

      # Admin email, Server Name (domain name) and any aliases

      # Index file and Document Root (where the public files are located)
      DocumentRoot /var/www/mulsite

$ sudo a2ensite
$ sudo service apache2 reload

the default page should be /var/www/

sub domains

Change default editor Ubuntu

Changing the default editor from gedit to sublime text

1. Download Sublime Text

2. Make a symbolic link of the executable file
$ ln -s “/home/bigbang/Desktop/Sublime Text 2/sublime_text” /usr/bin/sublime_text

3. Make an executable file desktop file
$ sublime_text /usr/share/applications/sublime.desktop
Inside sublime.desktop:

[Desktop Entry]
Name=Sublime Text 2
Comment=Advanced Code and Text Editor
Exec=sublime_text %F
Icon=/home/bigbang/Desktop/Sublime Text 2/Icon/256×256/sublime_text.png

** you should have an executable file in the dash **

4.replace all occurrences of gedit.desktop with sublime.desktop.
$ sudo sublime_text /usr/share/applications/defaults.list


Sublime Text 2 as Default Editor in Ubuntu 12.04

Multiple Sites on One Server – Virtual Hosts

This works for Ubuntu

Go to your site directory and make two folder and
$ mkdir /var/www/ /var/www/

Modify your host file
$ sudo nano /etc/hosts

Add the two lines of code into that file

Make configuration changes to apache by creating 2 files in the /etc/apache2/sites-available directory
$ sudo touch /etc/apache2/sites-available/ /etc/apache2/sites-available/

Put this code in those new created file. file:
<VirtualHost *:80>
DocumentRoot /var/www/
</VirtualHost> file:
<VirtualHost *:80>
DocumentRoot /var/www/

Final configuration commands
$ sudo a2ensite
$ sudo a2ensite
$ sudo service apache2 reload

Now if you put either or in your browser you’ll go to those sites. Now if you own these domain names put you internet IP address with the domain hosting and it will automatically navigate to the specified site location, making accessibility public.

if error:
apache2: Could not reliably determine the server’s fully qualified domain name, using for ServerName

$ sudo nano /etc/apache2/httpd.conf

add the line below:
ServerName localhost


AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message

Corrupted dpkg status file fix

Today I was trying to install a program using apt-get install however I kept getting this error

Do you want to continue [Y/n]? Y
Selecting previously unselected package libxmlrpc-core-c3.
(Reading database … 60%dpkg: unrecoverable fatal error, aborting:
reading files list for package ‘intltool-debian’: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

after hours of research I found out that the reason for this error was the /var/lib/dpkg/status file was corrupted.

I had three options to fix this which were reinstall ubuntu operating system, edit the status files or find a backup status file. I didn’t want to reinstall my operating system so I tried the other two.

(warning: Before trying to edit any file make sure you make a back up of it)

I tried to edit the status file by looking for the package I was trying to install. However I couldn’t find it and I didn’t know what to delete. Luckly there’s dpkg status backupfiles in your system located at /var/backups. I found one that was created a month ago called dpkg.status.3.gz and extracted it and renamed the file status and put into /var/lib/dpkg directory.

Then I tried to install the program using apt-get install and it worked.