Latest Entries »

centos add new fibre channel disk

Following on from my previous multipath posting I wanted to add a new FC disk onto my machine.

First I need to rescan for devices (after setting everything up on the SAN).

# echo “- – -” > /sys/class/scsi_host/host0/scan
# echo “- – -” > /sys/class/scsi_host/host1/scan

Then with # fdisk -l

I can see my new drive(s).

centos fibre channel multipath

I needed to setup multipath for the redundant routes to the FC San.
View full article »

remount in readwrite mode

So you messed up /etc/fstab and now the system wont boot. Instead you get dropped to that dreaded shell, and to make matters worse the system is read only so you can’t edit your filesystem.

It’s easily solved by re-mounting in read-write mode:

mount -o remount, rw /

Now you can fix your fstab file!

some iscsi stuff

to find iscsi targets on an initiator:

iscsiadm -m discovery -t sendtargets -p xxx.xxx.xxx.xxx

to login to a target:

iscsiadm –mode node –targetname iqn.???.??? –login

to get the ids of the targets for fstab:

udevinfo -q symlink -n /dev/sdb1

I had a major headache trying to get the iscsi initiator to detect a new drive on 2k3 server. It would find the targets no problem but when going to the disk manager there was no new disk. I ended up completely trashing my SAN at one point thinking it was the SAN’s fault. However, it worked fine on a 2k8 box.

In the end I re-installed the initiator and didn’t tick the MPIO support option. After that it all started working nicely.

C++ queued file locking system

I needed to write an interprocess locking system which had a queue.

Each request  that came in needed to go to the back of the queue so requests were handled in order. I already had a basic file locking system which I wanted to expand upon. The original idea just appended its pid to the end of the lock file, but if for whatever reason (crash) the process died the lock pid would remain in the lock file and the lock would not be obtainable by any other process.
View full article »

iis7 and apache on the same machine

I have windows SBS 2008 and wanted to run Apache for a Zend Framework website and IIS7 to support web based outlook.

Here’s how to do it (thanks to http://weblogs.asp.net/steveschofield/archive/2007/07/06/iis7-post-44-iis7-and-apache-on-the-same-machine.aspx)
View full article »

mysqldump your database

from the shell

#mysqldump -u username -p database_name > database_name.sql

This will copy the table structures and the data of your entire database into an sql file!

find all folders with 777 permissions

# find /home/ -type d -perm 0777

will find all folders in home with 777 permissions.

how to flush your dns

On Windows:

run -> cmd

#ipconfig /flushdns

On Mac:

bash-2.05a$ dscacheutil -flushcache

Powered by WordPress | Theme: Motion by 85ideas.