# jpegoptim --max=50 *.JPG; chmod 777 *
# find / -type f -name *.JPG -exec jpegoptim --max=50 {} \;
# find / -type f -name *.JPG -exec chmod 777 {} \;
Thursday, December 20, 2012
Friday, December 7, 2012
Solaris 10 - Add swap file
To Add swap files:
1. mkdir -p /usr/local/swap
2. mkfile 20m /usr/local/swap/swapfile
3. swap -a /usr/local/swap/swapfile
4. echo "/usr/local/swap/swapfile - - swap - no -" >> /etc/vfstab
5. swap -s
1. mkdir -p /usr/local/swap
2. mkfile 20m /usr/local/swap/swapfile
3. swap -a /usr/local/swap/swapfile
4. echo "/usr/local/swap/swapfile - - swap - no -" >> /etc/vfstab
5. swap -s
Thursday, August 16, 2012
Solaris - Add routing table
route -p [add/delete] [hostname] [gateway] -ifp [interface]
p = permanent
p = permanent
Wednesday, August 15, 2012
Wednesday, May 30, 2012
Solaris - how to Resync mirror in raid 1
# metaoffline mirror submirror
# metaonline mirror submirror
From Oracle:
"During a reboot following a system failure, or when a submirror that was offline is brought back online, Solaris Volume Manager performs an optimized mirror resynchronization. The metadisk driver tracks submirror regions. This functionality enables the metadisk driver to know which submirror regions might be out-of-sync after a failure. An optimized mirror resynchronization is performed only on the out-of-sync regions. You can specify the order in which mirrors are resynchronized during reboot. You can omit a mirror resynchronization by setting submirror pass numbers to zero"
# metaonline mirror submirror
Solaris file clean up
1. Crash dump file --> /var/crash/dumpfile
2. Explorer file --> /opt/SUNWexplo/output/*.tar.gz
3. Sar output file --> /var/adm/sa/sar*
4. Patch undo file --> find /var -name undo.Z
(reference : http://www.runningunix.com/2009/02/cleaning-out-var-in-solaris/ )
It is recommended to move those file to other directory instead of remove it.
Solaris - GUI and CLI mode using dtlogin
Stopping dtlogin
# /etc/init.d/dtlogin stop
Starting dtlogin
# /etc/init.d/dtlogin start
To enable dtlogin type command:
# /usr/dt/bin/dtconfig -e
To disable dtlogin
# /usr/dt/bin/dtconfig -d
To kill dtlogin type command:
# /usr/dt/bin/dtconfig -kill
Read man page of dtlogin for more information.
# /etc/init.d/dtlogin stop
Starting dtlogin
# /etc/init.d/dtlogin start
To enable dtlogin type command:
# /usr/dt/bin/dtconfig -e
To disable dtlogin
# /usr/dt/bin/dtconfig -d
To kill dtlogin type command:
# /usr/dt/bin/dtconfig -kill
Read man page of dtlogin for more information.
Monday, May 28, 2012
How to update Sun V240 firmware
1. Download Sun V240 firmware from Sun System Handbook
2. Run explorer and collect output if possible
3. Screen shot current firmware (prtdiag -v)
4. Make sure OBP --> auto-boot=true and boot-device=disk0
5. Run step below at OS level
# unzip 121683-06.zip
# cd 121683-06
# ./unix.flash-update.SunFire240.sh
2. Run explorer and collect output if possible
3. Screen shot current firmware (prtdiag -v)
4. Make sure OBP --> auto-boot=true and boot-device=disk0
5. Run step below at OS level
# unzip 121683-06.zip
# cd 121683-06
# ./unix.flash-update.SunFire240.sh
Sunday, May 27, 2012
How to enable CGI script in Apache
Step 1:
vi /etc/apache2/httpd.conf
add this line
"AddHandler cgi-script .cgi .pl"
save & exit
Step 2:
vi /etc/apache2/sites-enabled/000-default
add "+ExecCGI" under Options line
Options Indexes FollowSymLinks MultiViews +ExecCGI
AllowOverride None
Order allow,deny
allow from all
Step 3:
service apache2 restart
vi /etc/apache2/httpd.conf
add this line
"AddHandler cgi-script .cgi .pl"
save & exit
Step 2:
vi /etc/apache2/sites-enabled/000-default
add "+ExecCGI" under Options line
Options Indexes FollowSymLinks MultiViews +ExecCGI
AllowOverride None
Order allow,deny
allow from all
Step 3:
service apache2 restart
Subscribe to:
Posts (Atom)