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
Uncategorized
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
moved to SLES
After an accident… kraftek.com moved to SLES, maybe moving back to Slackware 11 in the near future.
217/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
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
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
get your nokia phone serial number without removing the battery
Sometimes you need to find out your nokia phone serial number, but you have to turn it off and remove the battery to get
it from the label.
You can get it from the phone screen just dialing
*#06#
Do not press “send”
271/433
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
no java console option on Dell DRAC 5
If your dell DRAC 5 card does not give you the option of a Java Console, you might have an old DRAC firmware, older
than 1.40 perhaps.
You should check in the properties tab the firmware version. If it is older than 1.40, you can get 1.45 from
dell’s page
62/433
63/433
http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R209365&System ID=PWE_2950&servicetag=&os=LIN4&osl=en&deviceid=8735&devlib=0&typecnt=0&vercnt=6&catid=-1&impid=-1&formatcnt=5&libid=36&fileid=293703
that will be an .exe file, so download it into a windoze PC and run it. It will uncompress and give you a file
called “firmimg.d5”
You will use that file to upgrade your drac firmware.
64/433
transfer it to the server in question. if you have linux and all the OM tools installed, you just need to run this
command while you are in the directory where you put the “firmimg.d5” file.
# racadm fwupdate -p -u -d .
That will upgrade your DRAC5 firmware to level 1.45, which includes the java console feature. Now enjoy
your console.
65/433
NFS taking >1 minute to mount each share
If your redhat NFS client takes too long to mount, but it does mount the shares, it may need portmap to be turned on:
# chkconfig –level 2345 portmap on
# /etc/init.d/portmap start
This will make the mounts come up almost instantly
122/433