,-O 
      O(_))       
       `-O

Yes, it is a cheat-sheet code page. To community, I believe this cheat-sheet code can be very useful enough as dirty and quick reference. I will update this page frequently. Have fun 🙂

1. How to perform unzipping multiple zip files?

echo -en "enter zip files directory : "
read answer
mkdir -p $answer/totalzip
cd $answer/totalzip
for i in `ls $answer | grep '\<.*zip\>'`
do
  unzip $answer/$i
done


2. How to perform mounting ISO file on Solaris

sh> lofiadm -a /export/home/you/esf.iso
sh> mount -F hsfs -o ro /dev/lofi/1 /mnt


3. How to perform compress directory into .tar.Z type file?

sh> tar cf myfile.tar My\ File &&  compress -vf myfile.tar 


4. How to perform uncompress .tar.Z type file?

sh> zcat /afs/data/myfile.tar.Z | tar xf -


5. How to setup Link Based IPMP
Active-standby concept which fjgi0 and hme0 get the same IP. Please be sure to set parameter FAILBACK=no in /etc/default/mpathd and run command below,

sh> eeprom  local-mac-address?=true
sh> hostname testbed
sh> echo "192.168.100.5 testbed" > /etc/hosts
sh> echo "192.168.100.0 255.255.255.0" > /etc/inet/netmask
sh> echo "192.168.100.1" > /etc/defaultrouter
sh> ifconfig fjgi0 192.168.100.5 netmask 255.255.255.0 \ broadcast 192.168.100.255 up
sh> echo "`uname -n` netmask + broadcast \ + group set_ipmp1 up" > /etc/hostname.fjgi0
sh> echo "group set_ipmp1 up" > /etc/hostname.hme0


5. How to regenerate the broken or corrupted /etc/shadow file?

sh> pwconv


6. How to perform shell terminal log

sh> script -a /export/home/log_script_oktora.txt


7. How to check WWN info

sh> /opt/FJSVpfca/sbin/fc_info -a
sh> fcinfo hba-port
sh> prtconf -vp | grep ww


8. How to recognize CD/DVD-ROM device on Solaris

sh> iostat -En


9. How to check NIC link status

sh> kstat -p fjgi | grep link


10. How to create ALOM user in ILOM environment

-> create /SP/users/dummy
-> set /SP/users/dummy role=Administrator
-> set /SP/users/dummy cli_mode=alom


11. How to restart, shutdown Solaris gracefully & enter to the single user from Solaris

For restart command
sh> shutdown -y -g0 -i6
For shutdown command sh> shutdown -y -g0 -i5 To enter single user environment sh> shutdown -y -g0 -i0


12. How to recognize new inserted device(s) on Solaris

sh> devfsadm


13. How to capture prstat output periodically by schedule job on Solaris
Below, /export/home/testbox/prstat.sh is executed by every minute.

sh> touch /export/home/testbox/prstat.sh
sh> chmod +x /export/home/testbox/prstat.sh
sh> TERM=vt100 ; EDITOR=vi ; export TERM ; export EDITOR
sh> vi /export/home/testbox/prstat.sh
#!/usr/bin/bash
`(date; prstat -n 100 -c 1 1) >> /export/home/testbox/performance.txt`

sh> crontab -e
* * * * * /export/home/testbox/prstat.sh


14. How to delete and remove metadevice on Solaris
For example, we have metadevice d24 related to c0t1d0s4 slice. But at moment we decide to remove metadevice d24 remaining c0t1d0s4.

sh> metaclear d24


15. How to reset ILOM or ALOM at Sparc Enterprise T series
It is rare but needed. When ALOM/ILOM T series management hang, it is needed to reboot ILOM/ALOM from serial management. This reset method doesn't harm live machine, it will not reboot operating system. It means safe. First line command is used in ILOM environment and second line is in ALOM environment.

-> reset /SP

sc> resetsc


16. How to connect serial port from Solaris

sh> tip hardwire


17. How to generate SADC system log

sh> /usr/lib/sa/sadc 1 5 sadc_`date +%d%m%y`.dat

Command above will generate 1 second interval for 5 times (lines).

18. How to collect hardware defect log in ALOM environment
Run command below as sort ALOM catalogue,

sc> showfaults -v
sc> showenvironment
sc> showfru
sc> showplatform -v
sc> showlogs -v
sc> showsc -v
sc> showfru -s
sc> showhost
sc> showcomponent
sc> consolehistory -v
sc> consolehistory -v boot
sc> consolehistory -v run
sc> showkeyswitch


19. How to backup disk or slice and restore it

sh> ufsdump 0f /a/var.dump /dev/dsk/c0t0d0s4 && cd /mnt/var ; ufsrestore rf /a/var.dump


Advertisements

2 Responses to “-> cheatsheet”

  1. muneer Says:

    hello,

    kindly send me more cheat sheet code pages


  2. These are really fantastic ideas in on the topic of blogging.
    You have touched some good points here. Any way keep up
    wrinting.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Advertisements
%d bloggers like this: