changelin.sh
by dervish on Jul.12, 2011, under Scripts
#!/bin/sh
# Change user password across a list of servers.
# 20100421 – Created by Jamey Hopkins
# 20110712 – Check if login exists before changing password
# Exit if login or password is blank
#
# note: be sure account.info gets removed from remote server if script is aborted
#
echo
echo “Change Users Linux/AIX Password”
echo
if [ “$1” = “” ]
then
echo “Need server list.”
echo “example: $0 servers.txt”
echo
exit
fi
if [ ! -f $1 ]
then
echo “Server list $1 not found.”
echo
exit
fi
# list seems good, accept it
LIST=$1
echo -n “Enter users login: ”
read LOGIN
if [ “$LOGIN” = “” ]
then
echo “user account can not be blank”
echo
exit
fi
echo “Enter new password”
echo -n “Password: ”
stty -echo
read PASS1
stty echo
echo
echo “Enter password again”
echo -n “Password: ”
stty -echo
read PASS2
stty echo
echo
if [ “$PASS1” != “$PASS2” ]
then
echo “password mismatch”
echo
exit
fi
if [ “$PASS1” = “” ]
then
echo “passwords can not be blank”
echo
exit
fi
echo “$LOGIN:$PASS1” >account.info
echo
# let’s roll
for X in `cat $LIST`
do
echo “$X: setting new password for $LOGIN”
VALID=`ssh $X “grep ^$LOGIN: /etc/passwd | cut -f1 -d:”`
if [ $VALID ]
then
scp ./account.info $X: >/dev/null
ssh $X “cat account.info | sudo /usr/sbin/chpasswd” >/dev/null
# clean up password file (be sure to manually remove if script gets aborted)
ssh $X rm account.info
else
echo “Account doesn’t exist. Skipping….”
fi
done
# clean up password file
rm account.info
echo
TPVMLPD: Device type not supported
by dervish on Jun.28, 2011, under Linux, VMware
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2001254
Linux virtual machine reports the error: TPVMLPD: Device type not supported
Symptoms
- Virtual machine running Linux reports the error:TPVMLPD: Device type not supported
Resolution
- Take a backup of the vmware-tools startup script using the command:cp /etc/init.d/vmware-tools /etc/init.d/vmware-tools.backup
- Open the /etc/init.d/vmware-tools script using a text editor. For example, to open the script using the vi editor, run this command:vi /etc/init.d/vmware-tools
- Comment this entry:#/usr/bin/tpvmlpd
- Run this command to restart VMware Tools:/etc/init.d/vmware-tools restart
Google Toolbar Disabled by Firefox 5
by dervish on Jun.27, 2011, under Linux, Windows
How to re-enable the Google Toolbar in Firefox 5.
Solution: Change maxVersion in the install.rdf file to 5.*. Do a search if your not sure where the file is located.
Linux:
– Edit ~user/.mozilla/firefox/mhznvz4j.default/extensions/\{3112ca9c-de6d-4884-a869-9855de68056c\}/install.rdf
– Change <em:maxVersion>4.*</em:maxVersion> to <em:maxVersion>5.*</em:maxVersion> and save.
– Start Firefox. Toolbar should start normally.
Windows:
The same ./extensions/\{3112ca9c-de6d-4884-a869-9855de68056c\}/install.rdf file can be edited in Windows to restore the Google Toolbar.
Or:
about:config
nightly.disableCheckCompatibility=false
extensions.checkCompatibility=false
Admin Sarcasm On Why The Server Is So Slow
by dervish on Jun.22, 2011, under Jokes, Politics
Per section 6.1 Navigational Deflector of the starship maintenance manual, I think it’s encountering slip stream collisions due to failure to properly install secondary deflector. Suggest installation/repair of secondary deflector to assist stabilization and performance enhancement.
“When entering into Quantum Slip Stream speeds the Auxiliary deflector system plays a critical role in establishing a stable slip stream conduit through which matter can pass. The Ventral deflector contains a series of 4 graviton flux inverters which allow the near perfect stabilization of a slip stream conduit without the need for perpetual polaric modulation by the main deflector system. The entire deflector network is tied directly into the compute and NAV COM core which then ties into the slip stream generator and the Flight Control data processors. While slip stream speeds can be attained without the use of the secondary deflector it severely limits the vessels flight time to three minutes every six hours, and greatly increases the risk of slip stream collision.”
Red Hat 5 – hdc: open failed: No medium found
by dervish on Jun.21, 2011, under Red Hat
Error:
Starting monitoring for VG VolGroup00: /dev/hdc: open failed: No medium found
Fix:
[root@rh5-32 cache]# vgscan
Reading all physical volumes. This may take a while…
Found volume group “VolGroup00” using metadata type lvm2
Before:
[root@rh5-32 ~]# /etc/init.d/lvm2-monitor restart
Stopping monitoring for VG VolGroup00: /dev/hdc: open failed: No medium found
6 logical volume(s) in volume group “VolGroup00” unmonitored
[ OK ]
Starting monitoring for VG VolGroup00: /dev/hdc: open failed: No medium found
6 logical volume(s) in volume group “VolGroup00” monitored
[ OK ]
/etc/lvm/cache/.cache shows hdc:
# This file is automatically maintained by lvm.
persistent_filter_cache {
valid_devices=[
“/dev/VolGroup00/LogVol00_home”,
“/dev/mapper/VolGroup00-LogVol00_home”,
“/dev/VolGroup00/LogVol00_usr”,
“/dev/VolGroup00/LogVol00_var”,
“/dev/mapper/VolGroup00-LogVol00_var”,
“/dev/mapper/VolGroup00-LogVol00_usr”,
“/dev/sda1”,
“/dev/mapper/VolGroup00-LogVol00_root”,
“/dev/hdc”,
“/dev/VolGroup00/LogVol00_root”,
“/dev/VolGroup00/LogVol00_tmp”,
“/dev/root”,
“/dev/mapper/VolGroup00-LogVol00_tmp”,
“/dev/sda2”,
“/dev/mapper/VolGroup00-LogVol00_swap”,
“/dev/VolGroup00/LogVol00_swap”
]
}
After:
[root@rh5-32 cache]# /etc/init.d/lvm2-monitor restart
Stopping monitoring for VG VolGroup00: 6 logical volume(s) in volume group “VolGroup00” unmonitored
[ OK ]
Starting monitoring for VG VolGroup00: 6 logical volume(s) in volume group “VolGroup00” monitored
[ OK ]
New /etc/lvm/cache/.cache:
[root@rh5-32 cache]# cat /etc/lvm/cache/.cache
# This file is automatically maintained by lvm.
persistent_filter_cache {
valid_devices=[
“/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0-part1”,
“/dev/ram11”,
“/dev/VolGroup00/LogVol00_home”,
“/dev/mapper/VolGroup00-LogVol00_home”,
“/dev/ram10”,
“/dev/ram”,
“/dev/disk/by-uuid/59b6dbd6-938b-4b6c-9b3d-570403ab5aff”,
“/dev/VolGroup00/LogVol00_usr”,
“/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0-part2”,
“/dev/ram12”,
“/dev/VolGroup00/LogVol00_var”,
“/dev/mapper/VolGroup00-LogVol00_var”,
“/dev/mapper/VolGroup00-LogVol00_usr”,
“/dev/ram6”,
“/dev/ram13”,
“/dev/ram14”,
“/dev/ram5”,
“/dev/ram1”,
“/dev/sda1”,
“/dev/ramdisk”,
“/dev/mapper/VolGroup00-LogVol00_root”,
“/dev/VolGroup00/LogVol00_root”,
“/dev/ram0”,
“/dev/VolGroup00/LogVol00_tmp”,
“/dev/root”,
“/dev/mapper/VolGroup00-LogVol00_tmp”,
“/dev/disk/by-label/boot”,
“/dev/ram2”,
“/dev/sda2”,
“/dev/ram8”,
“/dev/ram9”,
“/dev/ram15”,
“/dev/mapper/VolGroup00-LogVol00_swap”,
“/dev/VolGroup00/LogVol00_swap”,
“/dev/ram3”,
“/dev/ram4”,
“/dev/ram7”
]
}