Tuesday, June 27, 2006

installing firefox on centos 4.3

Well, i'm sure there are a hundred different ways of doing this. I believe you can even download the rpm from somewhere, but I decided to download it directly from mozilla.

Visit http://www.mozilla.com/firefox/index.html and it will have the download link. The program comes in a form of a tar.gz file.

This means after you download it, you need to run the following command in terminal.

$ tar xzvf firefox-
$ su
# mv firefox /opt/
# cd /usr/bin/
# mv firefox firefox-1.0.7
# ln -s /opt/firefox/firefox firefox
# cp /opt/firefox/firefox /opt/firefox/firefox-

I'm quite sure this isn't the best way of doing it, but it works. It shouldn't get stuffed up with any patching as well and should be easy enough to recover.

If anyone knows a better way, please feel free to correct me.

Monday, June 26, 2006

coldplay concert 23rd Jun 2006

A pretty good concert, looks like most people replaced lighters with light from mobile phones. Only managed to see one guy with a lighter during the whole event. Lots of camera flashes as wel.

I need to upgrade my phone's camera. VGA just doesn't cut it anymore. Anyway here's it again with the lights on.

Sunday, June 25, 2006

psc 2510 install on centos 4.3

If you have the full installation of centos, there is actually very little to do to establish printing and scanning for the HP PSC-2510 printer.

Setup printing

Plug in the printer and turn it on. A dialog box should pop up and you just need to select (HP | PSC 2500 series) as the connected printer

If you launch the (applications > system settings > printing) application you should see the printer.

Setup scanning:

start a terminal window and su as root
$ su -
# ptal-init setup -v

follow the prompts, this works for network as well, but in my case my connection is just usb.

Probe for USB-connected devices ([y]/n)? y

Probing "/dev/usb/lp0"...
Found "psc 2500 series"

# exit
$ xsane

This runs xsane which is the scanning application

Monday, June 19, 2006

centos 4.3 install - yes again

After my failure to install a new kernel, I realised that the LVM default install wasn't any good. So I decided to try again.

This time, i did a manual disk setup and created one /dev/hda1 for the / install with about 7.8 GB, enough for the install and other source files if required.

/dev/hda2 for swap twice memory for 1538 MB. And the last /dev/hda3 for /home

to speed up the mp3 process just run this

# rpm -ivh http://mirror.optusnet.com.au/dag/redhat/el4/en/i386/dag/RPMS/xmms-mp3-1.2.10-11.1.2.el4.rf.i386.rpm

It downloads and installs in no time.

my oracle dba past

I was trying to look up an old friend with google with no luck and just decided to do a search on my name as well. I discovered this new link. Apparently someone actually found my script useful and posted it at this forum. Cool.


Tuesday, June 13, 2006

iptables cheats

Can't remember iptables commands and what youre doing? Its easier to modify the default saved configuration instead of trying to write your own ipchains especially if you do not do this on a daily basis.

step 1: find your iptables config file.

Use "locate iptables | more". This should give a listing of anything related to iptables. Normally this should be in the /etc/sysconfig/ directory

step 2: change your rules using vim

centos: /etc/sysconfig/iptables
openwrt: /etc/firewall.user

and run:

centos # /etc/init.d/iptables restart
openwrt(i think) # /etc/init.d/S45firewall restart

The good news is that in most cases now, the default firewall does give an example of a tcp port and udp port. and openwrt gives a commented version on forwarding ports. e.g.

WAN=$(nvram get wan_ifname)
### Port forwarding
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j DNAT --to
iptables -A forwarding_rule -i $WAN -p tcp --dport 22 -d -j ACCEPT

Note that in this case, the port forwarded does not require the port to be open on the WAN interface. As it means that it will accept on the WAN

Alternatively, here's some iptables commands and basics to get you going. This is basically all I know and I managed to survive somewhat.

probably the 2 commonly used tables is nat and filter. By default it is set to filter so when listing existing firewall rules, you only need to do this:

# iptables -L --line

It is important to note that iptables works in a sequencial way, that means it looks at rule 1 before it looks at rule 2. I've recently started using --line which is really vital if you want an easy way to view what you want to insert to where. e.g. iptables -I INPUT 2 -j ACCEPT --dports 22 -p tcp

To view the nat (network address translation) table

# iptables -L -t nat --line

One of the more important entrys for this table is probably the masquerading for network sharing.

# iptables -A POSTROUTING -j MASQUERADE -t nat

I guess it does look intimidating, but it really isn't when it dawns upon you as in how the logic works.

if you have finished using iptables -I to create your rules, use "# iptables-save > /etc/sysconfig/iptables" to make sure your changes are saved.

More examples:

iptables -I RH-Firewall-1-INPUT 8 -p tcp --dport 80 -j ACCEPT

iptables -D RH-Firewall-1-INPUT 9

yum updates using a proxy

I did this for centos, but I'm sure its usable on anything that uses yum.

create a new file for dag repo in /etc/yum.repos.d called dag.repo

Find your local ISP mirror. I think both pacificnet and optus does mirrors. Here is what the file should look like.

name=Dag RPM Repository for Red Hat Enterprise Linux

After creating this file, you can run the following commands to complete the update.

# export http_proxy=http://proxy:port[dag]
# yum update

Friday, June 09, 2006

fwbuilder and checkpoint firewall

Is it me or are the two interfaces rather similar? When I first installed fwbuilder on windows xp, i thought this looks rather familiar. I know I've seen this before.

Suddenly it dawned on me that that was how checkpoint firewall looked on the solaris firewall box. Ooo.

Anyway, its something worth checking out especially if you have a linksys router, although it is still an overkill.


Sunday, June 04, 2006

enterprise ready cent os - the install

This weekend, I decided to blow away fedora core 3 and install something supposed to be more stable and enterprise ready. Part of the reason was also to do with another disk reshuffle and I've been finding an excuse to swap my creative live drive with my cdrom. the SDPIF cable was blocking the tray from opening properly. So why not just do a new distro upgrade as well.

Being familiar with redhat, I didn't think it would be that much of a challenge. Well, needless to say there were a couple of hickups. The first one being I had the install DVD and my machine didn't have the DVD rom. So off I went to download the 4 cd's.

After the installation, it refused to boot failing at the boot loader. I decided to stick to defaults and use the suggested LVM with root and swap. I modified the LVM to include a bigger mount for /home. As I was going to change my distro if things go sour.

After the machine booted sucessfully with the recommended disk partitions, I stuck in my backup harddrive and it didn't seem to boot properly. Anyway, by that time I was too tired and decided to reboot for the heck of it and go to sleep.

The next morning to my suprise, I saw the login screen of centos waiting for me. In glee, I decided to log in only to realise that it was unnaturally slow and it popped an error saying that it can't find itself in its host that will cause gnome to act weird.

I couldn't even start a terminal, but somehow the machine came back to life when i used system-config-network to disable the eth0.

Great, now I got a terminal. I decided to modify the hosts file and resolve.conf. I even decided to specify the IRQ for each network card so as I dont confuse it. The config all looked fine, but my network was still broken and I couldn't even ping my gateway. Hmm, broken network card?

So I rummaged though my spare parts and found another 3com network card. I pulled the machine apart again. After the card was changed, the machine didn't even boot to bios. Argh. Ok, I swapped the previous card back. Made in Ireland vs made in Singapore.

Whoo Hoo, it booted and network works for some strange reason. Maybe all it needed was a reboot.

Anyway, what do you do first after you install centos?

Download and install xmms-mp3 from


Yes, the compiled binaries for RHEL 4 works for Centos 4.3 as well. Yay, joy. my machine now plays my mp3s.

Another one down and tons more to go.

Installing ubutun on old intel macbookpro

After gettting a new last of the intel macbook air, I decided to install ubuntu on my older mac. The setup was fairly simple after download...