sshd[419]: error: Failed to allocate internet-domain X11 display socket.

If you cannot get ssh X11 forwarding to work even when you configured your sshd_config properly, and you get the
message “sshd[419]: error: Failed to allocate internet-domain X11 display socket.” in your console… you need to disable
openssh’s ipv6 mode.
add this to your sshd_config file:
ListenAddress 0.0.0.0
And change your init script to pass the “-4” option to sshd, as:
case $1 in
‘start’)
create_key $SSHDIR/ssh_host_rsa_key rsa
create_key $SSHDIR/ssh_host_dsa_key dsa
/opt/acs/sbin/sshd -4 &
;;
Restart sshd and you’ll have X11Forwarding working
86/433

Restore file from TSM

Issue
# dsmc rest -pick=yes /some/file /destination/file
This will show you a menu of different backup dates for /some/file, and after you pick one, you will be able to
restore it
To restore from a file list, include inactive copies and do not replace files:
# dsmc restore -replace=no -ina -filelist=f
Hey!, and if you have access to X on that server you can also use the gui:
# dsm
Thanks to Fergus O’Hea
208/433

Add a network printer in solaris 9

bash-2.05# lpadmin -p chubbchkprt -v /dev/null
bash-2.05# lpadmin -p chubbchkprt -m netstandard
bash-2.05# lpadmin -p chubbchkprt -o dest=10.12.7.250:9100 -o protocol=TCP
bash-2.05# lpadmin -p chubbchkprt -I any
bash-2.05# accept chubbchkprt
destination “chubbchkprt” now accepting requests
bash-2.05# /usr/bin/enable chubbchkprt
printer “chubbchkprt” now enabled
new printer
bash-2.05# lpstat -p chubbchkprt
printer chubbchkprt is idle. enabled since Tue Sep 30 19:57:42 2008. available.
94/433

disable dm_multipath

if, when you do a lsmod you find dm_multipath, but your multipath.conf says it’s disabled…
# mv /etc/multipath.conf /etc/multipath.conf.old
# init 6
you’ll see the module disappear on next reboot
linux boots to fsck and you don’t know the root password
if you are at the console, and you booted up a crashed server, and it wants you to type the root password because it
needs a fsck, reboot it and pass the “fastboot” option to grub. It will not fsck on boot.
55/433

Create LVM structures

for eaach disk to include in a volume group, initialize it as a LVM disk:
pvcreate /dev/sdX
create a volume group with that disk:
vgcreate myvg /dev/sdX
Create a 20gb volume called “myvol” inside the “myvg” volume group:
lvcreate -L 20g -n myvol myvg
Make a filesystem in the new volume:
mkfs.ext3 /dev/mapper/myvg-myvol
26/433

Calculate ETA of a file transfer

You are transferring a 7.2Gb file using scp on a wan, you want to know at some moment how much more time you will
have to wait until it is transferred, i wrote a script to give an average, it must be run on the file receiving server.
#!/bin/ksh
FS=7343108 #— the filesize
f=/app/db/oracle/u01/oracle/rmanbackupsets/v9jlbbu9_1_3 #— the file that is growing..
s1=`du -s $f |awk ‘{ print $1 }’`
echo “…sleeping 10”
sleep 10
s2=`du -s $f | awk ‘{ print $1 }’`
delta=`echo “${s2} – ${s1}” | bc`
echo “Bytes transferred in 10 secs : $delta”
REMAINING=`echo “$FS – $s2” | bc`
echo “Original Filesize : $FS”
echo “Remaining : $REMAINING”
ETA=`echo “scale=3;(($REMAINING / $delta) / 6)/60” | bc`
echo “Hours remaining for transfer $ETA”
du -sh $f
98/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

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