Solaris/Linux notes

# cat /proc/sys/fs/aio-nr;cat /proc/sys/fs/aio-max-nr 110456 1048576

To get all the wwns attached to an hba you can use this # cfgadm -al -o show_FCP_dev | egrep ‘disk|tape’

i don’t like to do a # cat /etc/passwd and manually create the users and chown their dirs… So, this is a one liner: # grep -i home /etc/passwd | awk -F: ‘{print “mkdir ” $6 ” ; chown ” $1 ” ” $6 }’ > somefile; chmod 755 somefile;./somefile 183/433

Categories: Uncategorized | 1 Comment

Just do this: ls /sys/class/scsi_host/ | while read h;do echo “- – -” > /sys/class/scsi_host/$h/scan;done

Use the queryformat modifier to print more info about your rpm # rpm -qa –queryformat %-{name}-%{version}-%{release}-%{arch}”n” You can grep for something there, because it is a full listing Thanks to Fergus O’hea

[root@mylinux]# swapon -s Filename Type Size Used Priority /dev/systemvg/swapvol (deleted) partition 4095992 0 -3 According to http://kbase. redhat.com/faq/FAQ_79_4331.shtm we need to add “swapoff -a && swapon -a” to the end of /etc/rc.d/rc. sysinit We can also run #swapoff -a && swapon -a To fix it live, and we’ll see: [root@mylinux]# swapon -s Filename Type Size [...]

If your slice 2 is empty and you got partitions 0-9 in your disk when checkign it in “format”, you have an EFI label. If you want to change it to a SMI label, you need to use “format -e” and when prompted for the label type, choose SMI partition> label [0] SMI Label [1] [...]

I already have a script like this in “miniexplorer”, but it generates html and that may be overkill, so this is a quickie one to query all network card ports in your solaris server about NIC speed. #!/bin/ksh ifconfig -a | grep flags | grep -v ‘lo’ |awk -F: ‘{ print $1 }’ |uniq|while read [...]

I got a TV card, it appears like this in lspci: 01:08.0 Multimedia controller: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decoder (rev d1) In order to stream 3 simultaneous streams, very low, low and high quality, you can do this: #!/bin/ksh # /sbin/modprobe saa7134-alsa sleep 2 DEV=/dev/tvcard ps -ef | grep -i vlc | grep -v [...]

Say you want a random Gnome wallpaper from google each 60 seconds, but if your machine is not connected, just take the backdrop from a local directory ~/Desktop/backdrops. you can put up a couple of scripts to do this, the main one would be /scripts/changewall.ksh #!/bin/bash mkdir -p /tmp/wallpapers E=`ps -ef | grep -i changewall [...]