Ubuntu – Methods to determine what version of Ubuntu you are running

Below are different methods to determine what version of Ubuntu you are running.

Method #1:

$ cat /etc/issue
Ubuntu 10.04.1 LTS \n \l

Method #2

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

Method #3

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.1 LTS
Release:	10.04
Codename:	lucid
desposo@fett:~$ 

What is /proc? What is it used for? Why is it always 100% full?

The /proc directory contains a hierarchy of special files which represent the current state of the kernel. Within /proc, you can find information in regards to system hardware, processes currently running, and can be manipulated to communicate configuration changes to the kernel. The /proc file system is a virtual file system that contains virtual files which are mostly zero bytes in size and read only.

Commonly viewed virtual files in /proc:

/proc/cpuinfo
/proc/interrupts
/proc/meminfo
/proc/mounts
/proc/partitions
/proc/filesystems
/proc/sys/ ( contains system configuration information and interfaces)

Sake San Jose, May 28, 2010

If you’re into sake, an event you might want to check out is Sake San Jose, which is at Japantown in San Jose, CA. At this event, you get to taste 20+ different types of sake from unfiltered to spirited and everything in between. The drinks are spread across 20+ different stations in Japantown, and you literally drink some sake and move on to the next station. What’s awesome is that this is an all you can drink event! and they supply snacks to eat while you drink! The only negative things I can say is that the drinking window is only 3.5 hours (5PM to 8:30PM) and there are long lines at some stations. Other than that, I would highly recommend going, and I’ll probably make this a yearly thing to do. After our Japantown sake crawl, we ended the night with some shabu shabu at Shaburi. This is the closest shabu shabu restaurant to my house, and I frequently go here because it’s pretty good. So to sum it up, a night of drinking with good friends and eating good food. I’m in for next year. Below are some pics:


More photos here.

How To Install bind9 on Ubuntu 10.04 Lucid Linux 32 bit

I decided to build a local DNS server today because I got sick of editing /etc/hosts on all the computers in my home network. My home network consists of 2 Macbook Pros, a Dell Mini 10v (hackintosh), a Mac Mini, and an Ubuntu Acer Aspire Revo. I have a whole bunch of other hosts, but these are the only ones I actively use on a regular basis. Also, another reason I wanted to build a local DNS server is because it would be a cool project to work on. I mean, how many people do you know can say they’ve built a DNS server? Anyways, I’m installing BIND on my Acer Aspire Revo. Below is the OS specs:

me@fett:~$ uname -a ; cat /etc/lsb-release
Linux fett 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION=”Ubuntu 10.04 LTS”
me@fett:~$

Below are the steps I used to get BIND running on Ubuntu 10.4 Lucid 32 bit.

Step 1. Install bind 9

sudo apt-get install bind9

Step 2. Edit /etc/bind/named.conf.  In here, you will want to specify the zones you are create for forward and reverse name resolution.  In my scenario, I am creating zone bleh.com and my network address is 192.168.1.

sudo vi /etc/bind/named.conf.local

This is how it looks on my setup:

zone "bleh.com" {
        type master;
        file "/etc/bind/zones/bleh.com.db";
        };
zone "1.168.192.in-addr.arpa" {
     type master;
     file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";
};

Step 3. Edit /etc/bind/named.conf.options. What you want to enter here is the IP addresses of your provider in the forwarders section. In my case, the IPs I added are 68.87.76.1{82,34}.

sudo vi /etc/bind/named.conf.options

This is how it looks on my setup:

options {
	directory "/var/cache/bind";
	forwarders {
	 	68.87.76.182;
		68.87.78.134;
	};
	auth-nxdomain no;    # conform to RFC1035
	listen-on-v6 { any; };
};

* Comments in bind config files are preceded by “//”. Comments in the zone files are preceded by “;”. This is something to keep in mind because I’ve read numerous forums where people would get this mixed up. This in turn screwed me up for hours.

Step 4. Create bleh.com zone file

sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/bleh.com.db

This is how it looks in my setup:

$TTL    300
bleh.com.      IN      SOA     bleh.com. root (
						2006081401	;Serial
						28800		;Refresh
						3600		;Retry
						604800		;Expire
						38400	)	;Negative Cache TTL
;
bleh.com.	IN	A	192.168.1.124
bleh.com.	IN	NS              bleh.com.
bleh.com.	IN	MX     10       bleh.com.

zabrak	IN	A	192.168.1.110
fett		CNAME		bleh.com.
www		CNAME		bleh.com.

Step 5. Create reverse DNS zone file.

sudo vi /etc/bind/zones/rev.1.168.192.in-addr.arpa

This is how it looks in my setup:

$TTL    300
@ IN SOA bleh.com. root (
                        	2006081401	;Serial	
                        	28800		;Refresh 
                        	604800		;Retry
                        	604800		;Expire
                        	86400	)	;Negative Cache TTL 
;
			IN	NS	bleh.com.
124			IN	PTR	bleh.com.
110			IN	PTR	zabrak.bleh.com.

Step 6. Check zones and look at logs.

/usr/sbin/named-checkconf -z
tail -f /var/log/daemon.log

Step 7. Restart bind.

sudo /etc/init.d/bind9 restart

These are the steps I followed to get this up and running on my system. Hopefully you find this useful. I am by no means a DNS expert, but this setup works in my environment. If you see anything that could maybe make this more efficient, feel free to comment.

Quick Summary On Package Management On Ubuntu Linux

I’m new to Ubuntu / Debian Linux, and I figured I’d type a quick summary on how to manage packages.  There are GUI package management tools available (such as Synaptic Package Manager), but I am going to summarize command line package management.  You can get more info off the man pages, but here is my attempt to make it more human readable.

How to install packages. I’m sure everyone knows how to do this.  This is mentioned in almost every “How to” guide I’ve read so far.

sudo apt-get install $PACKAGE
How to remove a package.
sudo apt-get remove $PACKAGE
How to remove a package and all it’s configuration files.
sudo apt-get --purge remove $PACKAGE
How to list all installed packages. This can be piped to grep to get a more specific list.
dpkg --list
How to resynchronize the package index files from their sources.
sudo apt-get update
How to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list.
sudo apt-get upgrade
This pretty much sums up most of the things I’ve done with debian style packaging so far.  Most of these are straight out of the man pages, and I would highly suggest reading through them for a more concise and detailed explanation on the things I’ve mentioned so far.

How To Install zlib-1.2.5 on Ubuntu 10.04 Lucid Linux 32 bit

  1. wget http://www.zlib.net/zlib-1.2.5.tar.bz2
  2. tar -xjvf zlib-1.2.5.tar.bz2
  3. cd zlib-1.2.5/
  4. sudo ./configure –prefix=/usr/local/zlib
  5. sudo make
  6. sudo make install