Sunday, May 29, 2011

linux force reboot or shutdown

Force Reboot :
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

If you want to force shutdown machine try this.
echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger

Thanks to http://linax.wordpress.com/2009/02/16/linux-force-reboot-and-shutdown/

Wednesday, May 25, 2011

linux create logical volume

pvcreate /dev/sdb1
vgcreate VolGroup01 /dev/sdb1
lvcreate -L953G -n LogVol00 VolGroup01
parted -l

add iscsi target and initiator in CentOS Linux

----------------- Target (Server) ----------------
#> vi /etc/tgt/targets.conf

<target iqn.2011-04.com.storage2.volgroup01.logvol00>
backing-store /dev/VolGroup01/LogVol00
</target>

#> service tgtd restart

; Take care of iptables

-----------Initiator (Client) -------------
#> iscsiadm -m discovery -t st -p 192.168.2.140
#> iscsiadm -m node
#> chkconfig iscsi on
#> service iscsi start


Sunday, May 22, 2011

linux discover and add new disk without reboot dynamically

To Discover and add new disk to a linux machine without having to reboot the server (e.g when virtual disk is added to a machine online) do the below:

ls /sys/class/scsi_host

#output is host0
#new rescan the scsi bus
echo "- - -" > /sys/class/scsi_host/host0/scan

#now you can see the new disk
fdisk -l

# add the new disk to the lvm if you want

Monday, May 16, 2011

vmware server 2 virtual console does not load

To solve the problem
find and run ./vmware-vmrc -h server:8333 -M "VM_ID"
to find "VM_ID" goto vmware webui and generate a shortcut on dekstop

Tuesday, May 10, 2011

ESXi scp

In ESXi to do scp using pscp simply do scp -scp to avoid doing sftp

Wednesday, May 04, 2011

Mikrotik DMZ

To put and IP address in DMZ
simple create a destination nat from the public IP to private without specifying anything else

Wednesday, April 20, 2011

get my oracle support (MOS) and metalink access cheap

Buy either
Oracle Load Testing Accelerator for Oracle E-Business Suite
Oracle Load Testing Accelerator for Siebel

Tuesday, April 19, 2011

linux bandwidth control

1. behind a router (easily done in mikrotik with queues)
2. using tc with iptables mangle
3. using redirection of traffic via squid proxy

Monday, February 28, 2011

MSM LSI MEGARAID

Install the latest MSM Megaraid manager regardless of whatever version actually belongs to the storage card on LSI website

Wednesday, January 19, 2011

Monday, January 10, 2011

openfiler scsi target not found in ESX 4.1

just edit /etc/initiators.deny and comment "ALL"

Sunday, January 09, 2011

resize LVM by adding new disk to lvm

    
fdisk /dev/sdb
mkfs -t ext3 -c /dev/sdb1
pvcreate /dev/sdb1
vgextend VolGroup00 /dev/sdb1
lvextend -L+1G /dev/VolGroup00/LogVol00 ;for adding one more GB to Logical Volume LogVol01
resize2fs /dev/VolGroup00/LogVol00


Thanks to http://sujithemmanuel.blogspot.com/2007/04/how-to-add-disk-to-lvm.html

amplify sound volume of a video file

To amplify - increase sound volume of - a video file do

ffmpeg -i myvideo.avi -vcodec copy -vol 5000 myvideo_louder.avi

thanks to http://superuser.com/questions/13552/how-to-amplify-the-audio-in-a-video-file

Thursday, January 06, 2011

VMWARE ESX 4.1 boot from ISO does not work

Remember to check the box which says "Connected", the damn thing took soooo much of my time.

Monday, December 20, 2010

Tuesday, December 07, 2010

linux detach screen

to exit a session created by screen command without stopping what is going on in the session do a
CTRL+a then d

Friday, November 19, 2010

awk dmidecode output

dmidecode | awk 'BEGIN {RS = "\n\n"} /System Information/'
thanks to http://aixhealthcheck.com/index.php?id=246

Wednesday, October 27, 2010

duplicate lines in vim

yy (copy) or dd (cut) a line and then do a p (paste)

NOHUP

start applications with nohup so they will not be closed once the terminal session is closed.