PictureGallery

this
, and you have a j2ee appserver (tomcat), get the source:
PictureGallery-netbeans-src.tar. gz
, unpack it, you’ll find a “.war” file inside, that is what you should put inside
the “webapps” folder inside tomcat.
The only setting you might need to change is the location of your pictures. Find the jsp called “index.jsp” and
modify the variable “base” there.
164/433

Create/grow volume with maxsize (Veritas)

Create volume of maxsize (max size of all the DG’s disks):
# vxassist -g ora2dg maxsize
Maximum volume size: 39522304 (19298Mb)
# vxassist -g ora2dg make oratmp 39522304
# mkfs -F vxfs /dev/vx/rdsk/ora2dg/oratmp
# mkdir /db/prd3/archive_test2
# mount -F vxfs /dev/vx/dsk/ora2dg/oratmp /db/prd3/archive_test2
Grow a volume to maxgrow:
# vxassist -g ora1dg maxgrow archive_temp
Volume archive_temp can be extended by 10772480 to 94658560 (46220Mb)
# vxresize -g ora1dg archive_temp +4g
255/433

Apache mod_proxy, to publish your intranet apps without migrating them

Imagine you want to publish a webapp from your intranet, without moving it from your internal server, just adding some
url to your existing external webserver and mapping it to the internal server, that is what mod_proxy does.
http://www.kraftek.com/orca/orcallator/
) , thanx to my vpn and mod_proxy.
First you have to compile apache to have proxy modules and friends:
# ./configure –enable-so –enable-mods-shared=”all proxy proxy_http proxy_ftp proxy_connect headers
deflate mod_deflate mod_ssl”
# make && make install
Get mod_proxy_html from http://apache.webthing.com/mod_proxy_html/, and build it into apache
# /usr/local/apache2/bin/apxs -c -I/usr/include/libxml2 -i mod_proxy_html.c
Edit your httpd.conf and, in my case, to map orca’s directory, I wrote this:
ProxyRequests off
ProxyPass /orca/ http://dell/orca/
<Location /orca/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /orca/
ProxyHTMLURLMap /orca /orca
RequestHeader unset Accept-Encoding
</Location>
voila!, got http://www.kraftek.com/orca/orcallator/ mapped to an internal machine called “dell”, now you can
see some pages from my internal machine!
I hated the fact that i needed to mirror the whole orca directory overnight… Now I don’t need to do that!
288/433

How to know if my linux is running at 64 or 32 bits?

Issue:
# uname -m
i386 or i686 ==> 32 bit
x86_64 ==> 64bit
Netbackup 4.5 linux client not backing up >2Gb files
If you cannot upgrade to netbackup client 5.x or 6.x and you have this error message:
13:33:12.827 [313] <4> bpbkar: INF – Processing /dir/bigfile
13:33:12.836 [313] <8> bpbkar: WRN – Cannot process path /dir/bigfile: Value too lar ge for defined data
type. Skipping.
Please refer to http://seer.support.veritas.com/docs/256923.htm
and install the client version that supports +2Gb file sizes
Linux Client (v2.4) on NBU 4.5FP4
209/433

Cron entry to reboot a server the first Sunday of every month

This cannot be expressed in the typical crontab syntax, so we run a script every sunday in the crontab:
00 11 kraftek.html POSTS rescue rescued.html rescued.txt x y z kraftek.html POSTS rescue rescued.html rescued.txt x y z 0 root /scripts/monthlyreboot.ksh > /var/log/rebootlog 2>&1
The script checks if this is the first sunday of the current month, if it is, it performs a reboot, the contents of
/scripts/monthlyreboot.ksh are:
#!/bin/ksh
# get today’s month and year
T=`date +%m” “%Y | sed ‘s/^0//’`
# get this month’s first sunday
S=`cal $T | cut -c 1-2 | sed ‘s/ //g’ | grep . | head -2 | tail -1`
# get what day of the month today is
D=`date +%d | sed ‘s/^0//’`
echo -n “`date` — the day is $D, first sunday of $T is $S”
if [ $D -eq $S ];then
echo “, so we are going to reboot”
sleep 3
/sbin/shutdown -t 00 -r now
else
echo “, no reboot today”
fi

when “unzip” in solaris 10 cannot uncompress 10_Recommended.zip

There is a bug for unzip in some versions of solaris 10, when uncompressing the 10_Recommended.zip, it indicates the
file is corrupted.
To overcome this, if you have java installed in the server, you can use jar to uncompress the bundle.
As root do:
# jar xvf 10_Recommended.zip
The files are extracted without the permissions, so fix them
# cd 10_Recommended
# find . -name postpatch -exec chmod 744 {} ;
# find . -name prepatch -exec chmod 744 {} ;
#chmod 755 install_cluster*
And you’re now ready to patch
Thanks to Tim Benoit
66/433

Create a bridge interface in the host to use it in VirtualBox

To have a host ip inside your VirtualBox guest OS, you must create it a tap interface in the HOST OS, i wrote two scripts
to create the needed interface, and to remove it (tapstart.ksh/tapstop.ksh)
These scripts are made for Slackware 12(the host os), since it has no config files for tap/tun/bridge interfaces
in /etc afaik.
TAPSTART.KSH:
#!/bin/ksh
## The real interface, this should already have an ip, in this case it is
## a static ip
REAL=eth1
REALIP=172.16.1.88
NETMASK=255.255.0.0
GATEWAY=172.16.0.1
## The bridge interface, this will have the REALIP once all is setup
BRIDGE=br0
## The tap interface, we’ll use this device inside VirtualBox
TAP=tap0
mkdir /dev/net
mknod /dev/net/tun c 10 200
groupadd umlnetwork
chgrp umlnetwork /dev/net/tun
chmod g+rw /dev/net/tun
modprobe tun
brctl addbr $BRIDGE
ifconfig $REAL 0.0.0.0 promisc up
brctl addif $BRIDGE $REAL
tunctl -t $TAP -u root
brctl addif $BRIDGE $TAP
ifconfig $TAP up
ifconfig $BRIDGE inet $REALIP netmask $NETMASK
route add default gw $GATEWAY $BRIDGE
chmod 0666 /dev/net/tun
TAPSTOP.KSH:
#!/bin/ksh
## the tap,bridge and real interface as configured in tapstart.ksh
TAP=tap0
BRIDGE=br0
REAL=eth1
REALIP=172.16.1.88
NETMASK=255.255.0.0
ifconfig $TAP down
101/433
tunctl -d $TAP
ifconfig $BRIDGE down
brctl delbr $BRIDGE
ifconfig eth1 inet $REALIP netmask $NETMASK up
Now all we have to do in virtual box is select “host” networking, use “tap0″ as the interface and use
‘tapstart.ksh” and “tapstop.ksh” as the networking start/stop scripts.
Your Guest OS’s nic can be configured to use dhcp, for instance, and will get an address from your LAN’s
dhcp server.
102/433

Suntrunking 1.3 install

This is only how the install looks on solaris 9, not much options. It looks as it can be used only on qfe, ce and ge
interfaces. We’ll later see how to configure it
bash-2.05# pwd
/tmp/SUNTRUNKING/suntrunking
bash-2.05# ls
Copyright FR_Copyright README Solaris_8 install
Docs License Solaris_7 Solaris_9 remove
bash-2.05# ./install
Sun Trunking 1.3 Utility Installation.
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Checking for existing Sun Trunking 1.3 Utility packages…
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Checking for supporting Ethernet drivers and patches…
This script is about to take the following actions:
– Install Sun Trunking 1.3 Utility packages.
– Install Vlan Ethernet Utility: 114600-02 required patch(es).
– Install Gigabit Ethernet: 113361-06 required patch(es).
Press return to continue, or ‘Q’ followed by a return to quit:
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Installing patch 114600-02 for Solaris 9…
Checking installed patches…
Verifying sufficient filesystem capacity (dry run method)…
Installing patch packages…
Patch number 114600-02 has been successfully installed.
See /var/sadm/patch/114600-02/log for details
244/433
Patch packages installed:
SUNWvld
SUNWvldu
SUNWvldx
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Installing patch 113361-06 for Solaris 9…
Checking installed patches…
This patch is obsoleted by patch 112233-12 which has already
been applied to this system.
Patchadd is terminating.
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Installing Sun Trunking 1.3 Utility packages…
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
==================================================================
Please modify /etc/opt/SUNWconn/bin/nettr.sh to set up trunking configuration.
Please create /etc/hostname.qfeN entries for QFE trunk heads.
Please create /etc/hostname.geN entries for GEM trunk heads.
Please create /etc/hostname.ceN entries for CE trunk heads.
Reboot your system.
==================================================================
Installation of <SUNWtrku> was successful.
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Installation of <SUNWtrkm> was successful.
kraftek.html POSTS rescue rescued.html rescued.txt x y z
Done.
A log of this Install can be found at:
/var/tmp/Trunking.install.2006.07.25
245/433