Month: August 2007

How-To: Change Hostname

How-To: Change Hostname

I swear, i always forget how to do this even though i’ve done it for the nth time. For my sake (and maybe a few others out there), here are several ways on how to do it.

But first check your hostname. It’s normally set to localhost.localdomain. To do that, use uname -n or simply hostname.

Now to change to your desired hostname, the easiest way is to use the hostname command.

> hostname

Normally it does the trick. But if it doesn’t, edit /etc/hosts and add the ff line. server1

Then edit /etc/hostname and add your hostname. Don’t worry if the file doesn’t exist, just create it.

Next edit /etc/sysconfig/network and add


Finally, this last trick is very useful if all else fails.

echo > /proc/sys/kernel/hostname

There! Now i don’t have to use google when i have to do this.

DIY: How To Fix a Power Adapter

DIY: How To Fix a Power Adapter

Apple has once again failed me with it’s amazingly poor quality accessories. Well I admire how stylish and flair their new gadgets are. However once the hype subsides, your precious loses its glitter to scratches, and the warranty expires, say goodbye to your dear old gadget – or in my case its accessories. I’m barely new to Apple products,yet i now have two faulty products up my sleeve. Anyway, my rant is not about that, coz we can always blame misuse. I’m more worried on the ‘unrepairable’ design flaw.

Perhaps Apple accessories are designed not to be repaired, but only to be replaced. Good news is Apple has loads of reserve and Apple Store is everywhere. There seems to be no way of repairing them other than err, cracking them up. I’m not sure if it’s design flaw or it’s just made that way since we are more concerned with the “looks” anyway.

The Powerbook 65W AC Adapter i’m using yielded yesterday. The part of the cord going into the casing has shorted out. I planned to bring it to the Apple Center today but due to heavy rains, it didn’t pursue. There’s a big chance i would end up with a new one anyway since it’s out of warranty. So equipped with the EEE yabang, we opted to do it ourselves. Google “how to open powerbook AC adapter” and it will give one or two useful sites.

In summary, this is how we – my friend being the main worker and i’m the trivial helper – did it:

  1. The casing had no screws or anything, meaning it’s not meant to open. So you have to literally crack it up. Crack all sides open with a flat screwdriver and a hammer to push the screwdriver in. This is the hardest and most tedious part (and the reason I’m ranting).
  2. Cut the plastic molding since it can’t be reused anyway. Now the large part of the cable, whose other end connects to the powerbook, is unattached. Remove the burned portion.
  3. Strip the cables to reveal the wires. There are two sets of wires, the ground and the Vdd (not sure of the voltage).
  4. Twist the wires back together (remember there are two sets) and cover with an electrical tape. (We used masking tape). You may have to solder them together or to the board if it’s loosen up.
  5. Test if it will charge your Powerbook! There might be other safer ways though.
  6. Secure the wires. Put a little knot on the end where the plastic molding originally is.
  7. Put back the casing, put some masking tape around, and it’s good to go.

Now your power adapter is working, but is reduced to a pauper from a prince. It will look really bad! But as my friend says, just laugh out and be proud.