Monday, September 08, 2008

Configuring Your Linux Hostname

First, check your hostname to see if it's configured correctly.

uname -n
hostname -a

hostname -s

hostname -d

hostname -f

hostname

If the above isn't correct, follow these steps:


Configure /etc/hosts

Add any static IPs on as follows:

127.0.0.1       localhost
192.168.0.4 mybox.example.com mybox


Setting the hostname using 'hostname'

You can run the following command after updating your /etc/hosts:

hostname mybox.example.com


Checking /etc/hostaname

You can also check to see if that worked by looking at /etc/hostname and you should see

mybox.example.com

I found all this good stuff at cpqlinux.

It is also possible that you may need to reconfigure httpd.conf in /etc/apache2/httpd.conf such that it reads

ServerName yourservername

Tuesday, August 26, 2008

Using terminal screen sharing with Unix Screen

Screen can be used to share a screen between two users-

screen -R screen-test

That opens a screen, now allow multiuser access in the screen session via the command CTRL-A :multiuser on (all 'screen' commands start with the screen escape sequence, CTRL-A).

CTRL-A
:multiuser on

Next, the host must grant permission to the remote user to access the screen session using the command CTRL-A :acladd user_name where user_name is the remote user's login ID.

CTRL-A
:acladd username

The remote user can now connect to the hosts 'screen' session. The syntax to connect to another user's screen session is screen -x host_username/sessionname.

screen -x username/screen-test

Thanks to Ubuntu Community.

Sunday, August 24, 2008

Dealing with Processes using ps

To find a process containing X, use:

$ ps -ef | grep 'X'

To terminate said process, the first column is the PID.

$ sudo kill -9 PID

This can be used to kill user sessions on SSH

How to bind additional IPs in Debian / Ubuntu Linux

So you're looking to add an additional IP addresses to a network interface that already has an IP address bound to it? Here's how: (source: NixCraft Article)

Let us assume that your eth0 IP address is 192.168.1.1. You need to create alias or binding using eth0:0, eth0:1...eth0:N devices. You need to add range of IP's in /etc/network/interfaces config file under Debian/Ubuntu Linux. First make a backup of existing file:

$ cp /etc/network/interfaces /root/working.interfaces

Now open file using nano text editor:

$ sudo nano /etc/network/interfaces

Modify as follows:

auto eth0
auto eth0:0
auto eth0:1

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.248
gateway 192.168.1.254

iface eth0:0 inet static
address 192.168.1.2
netmask 255.255.255.248
gateway 192.168.1.254

iface eth0:1 inet static
address 192.168.1.3
netmask 255.255.255.248
gateway 192.168.1.254
# add rest of alias / binds below

Save and close the file.

Now restart networking, enter:

$ sudo /etc/init.d/networking restart

That's all! Thanks NixCraft!

Embracing Linux

I've slowly worked my way into a Linux/Unix environment. I started using SSH access to familiarize myself with navigating the Unix landscape. Now I use Linux on one of my tower PCs; specifically, Ubuntu Server Linux. I like it because it's well documented and developed somewhat for ease-of-use. I've also used Ubuntu desktop via virtual machine as well as Open Solaris.


One thing that I noticed when using Linux is that it's difficult to find the correct commands when you need them. Often, they're just a simple search away, but other times it takes a long time to refine which tutorial is the proper one to follow. Some of them require a little customization for the specific distro. I'm going to try to publish some of the tutorials I use for personal reference in addition to clogging up my del.icio.us. The problem is that often these links I use aren't worth clogging up my del.icio.us, so this will work to clear that up and make it simple to find my solutions after I've found them once.

Saturday, December 01, 2007

Operating System Crash

I've been thinking a lot lately about switching to Windows Vista. That is, I've been thinking of not switching to Vista. Everyone that I talk to seems to not really like Vista at all, and after reading about it, I don't think I will like it either. I won't go into the details of why, but I'd like to explain my conflict.

I really like working with XP. I understand how to tweak and administer the XP/2003 environment. It's a valuable skill these days. Vista doesn't appeal to my geeky side at all, and I've been meaning to become familiar with Linux for ages. This may be the opportunity for Linux to win me over. I'm a IT professional working in business. The value of knowledge of Microsoft products in the business and 'real' world far outreaches that of the *NIX environment. There definately is value in understanding Linux. For one thing, the only way to earn the title of uber-geek is to know Linux better than your spouse (assuming that you know your spouse pretty well).

The problem simply is that I just don't have enough time to become highly professionally proficient with Vista and Linux. I must use one operating system on a daily basis for everything from surfing the web to administering the server. Therefore, I must choose between something that is stupid but makes good business sense and something that is incredibly cool and geeky but doesn't make as much sense to my career. I would like to get my MCSE or MCSA, but I don't know if I can start taking tests before Longhorn rolls out. I don't want to be mediocre with both operating systems either. I would like to be mediocre with one of them, though.

So for now, I'm sticking with XP on my older box. The laptop I purchased in August has XP on it too. I think I'm going to take this chance now before Vista goes widespread to learn and understand Ubuntu Linux on a virtual machine and worry about picking up Vista later.

Tuesday, November 13, 2007

What American Accent Do You Have?

You might not think at first that a simple test about how you speak can pinpoint where you're from. Strangely enough, after I took this online quiz about identifying accents, this test pinpointed where was from. It looks like there are some good quizzes at http://gotoquiz.com/, but you won't find many. My other favorite was How Dumb Are You because it's pretty clever.

Saturday, August 25, 2007

Lenovo (IBM) ThinkPad T61p

Ahh...Finally at last the long overdue first laptop. Yes, I am a little behind the times in getting new computer equipment, but I did acquire a new Lenovo ThinkPad T61p. It didn't take long to decide which laptop on the market to purchase, and I wasn't wrong about my decision. PCMag has rated the ThinkPad T series Editors Choice time and time again and nominated the other Think Pads for editor's choice. Despite the general feeling of quality you can get from official sources, I would like to reiterate my opinion.

ThinkPads have great design

  • It has both touch pad and finger tracker for pointing
  • Wireless a/g/n and Bluetooth
  • Thinner and lighter than other comparable brands (namely Dell and Gateway)
  • Fingerprint reader integrated in chassis
  • Long battery life
  • Intuitive volume controls and no cramped keyboard

Some other things I liked were

  • Battery and fingerprint software very useful
  • Shock protection that prevents hard disk damage from shocks (including real time monitoring)
  • Optional 9-cell battery for extended work.
  • Nice wide screen (15.4")

Sunday, April 29, 2007

iPods can be a hassle

I know that most of you would hate me for saying how much of a hassle an iPod is, and some others are sitting there with their "other" no-name branded music players hating me just as much for using the "infidel iPod."

Quite simply, iPods can be a bit of a hassle. With the product of popularity comes a product of pain. This is only the second time my player has died on me, but I am wearing thin. Its bad enough I can't listen to my music, but considerable amount of money goes into the purchase/repair/repair cycle.

Maybe I can disclose a couple things I've learned about them through the cycle:

  • Don't drop your iPod. It's expensive, so be nice to them. While this might seem a little common sense, I didn't get this one the first time around
  • Don't pay Apple to fix it (you can get a new one for cheaper). I fixed mine (for a while) by following these directions. It's pretty simple and only costs around $50 for a new hard drive.
  • No matter how much you reformat the drive, try to reformat the drive, do chkdsk on the drive, restore the drive, etc., etc. -- it won't help. Once you've got that little "whizzzz--/CLICK..whizzzz--/CLICK..whizzzz--/CLICK" noise going, there's no going back to happy tunes.

But after I did all that I've been very careful to handle my iPod with gentle love and care, but its back to not working again, and it's pissing me off!

So FYI: DIY iPods can be a hassle!