Archive for the ‘Tips’ Category.
December 21, 2009, 10:23 am
One annoying feature of VMware Infrastructure Client 2.5, used for connecting to ESX and ESXi hosts, is the fact that it likes to remember any IP addresses and names of connections in the login screen. While I appreciate its helpfulness, when you have a dozen machines used for testing no longer being accessed, I got tired of looking at them in the drop-down menu. To delete any of the old connections, open up regedit.
Start -> Run -> regedit
CTRL+F or Edit -> Find
Type in “RecentConnections” and your VMware recent connections list should pop up somewhere under HKU registry. Just open this up and delete any hosts you don’t want to see anymore.
December 17, 2008, 10:47 am
For whatever reason, I had a hard time finding how to add DNS search suffix lists to a dhcp client in Linux. So I’m adding it here, so I can easily find how to do so.
# vim /etc/dhclient-eth0.conf
supersede domain-name "domain1.com domain2.com domain3.com";
Save the file and restart the network.
# service network restart
Then cat the contents of /etc/resolv.conf and you should see the changes.
# cat /etc/resolv.conf
search domain1.com domain2.com domain3.com
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
November 12, 2008, 9:36 am
I had to use Zamzar today to convert a .pptx to a ppt and odp file. It worked well. I’m not sure I trust sending documents that contain personal or sensitive information out, but for something like a simple product presentation, I think it worked fine.
Upload the file, and then you can choose the type of conversion you want done, and then they e-mail you where to download the file after the conversion is done.
http://www.zamzar.com/
October 8, 2008, 1:44 pm
Like my last post mentioned, I had a script to download ClamWin’s daily and main update files to a local server, where I point my local ClamWin installations to update from. The old way simply downloaded the file regardless if the file had actually changed or not, which resulted in a lot of bandwidth waste over time.
I re-worked the script to use zsync so file comparisons are actually done, just like rsync. Here’s the script in case anyone wants it. Just a Bash script, so make it better if you want, or don’t. Put it in crontab or something so it runs every so many hours.
# crontab -e
01 */4 * * * /usr/local/bin/mirror_clamav_zsync
#!/bin/bash
#Mirror 1 & 2
MIRROR1="database.clamav.net"
MIRROR2="db.local.clamav.net"
#Daily file
DAILY="/var/www/html/daily.cvd"
#Separate .zsync files for each mirror
ZSYNCD1="/var/www/html/daily.cvd.zsync"
ZSYNCD2="/var/www/html/daily.cvd.local.zsync"
#Main file
MAIN="/var/www/html/main.cvd"
#Separate ./zsync files for each mirror
ZSYNCM1="/var/www/html/main.cvd.zsync"
ZSYNCM2="/var/www/html/main.cvd.local.zsync"
#Your email address for failures
EMAIL=you@youremail.com
#Log files
DAILYLOG='/var/www/html/logs/clamsync_daily.log'
MAINLOG='/var/www/html/logs/clamsync_main.log'
#Ping mirror 1, if successfull, do the zsync.
if /bin/ping -c 1 -w 1 $MIRROR1 >/dev/null; then
cd /var/www/html
/usr/bin/zsync -i $DAILY $ZSYNCD1 -o $DAILY > $DAILYLOG
/usr/bin/zsync -i $MAIN $ZSYNCM1 -o $MAIN > $MAINLOG
else
#Ping mirror 2 if mirror 1 fails, if successful do the zsync.
if /bin/ping -c 1 -w 1 $MIRROR2 >/dev/null; then
cd /var/www/html
/usr/bin/zsync -i $DAILY $ZSYNCD2 -o $DAILY > $DAILYLOG
/usr/bin/zsync -i $MAIN $ZSYNCM2 -o $MAIN > $MAINLOG
#If both mirror 1 & 2 are down, send an e-mail message to let you know.
else
/usr/bin/printf "Both main and daily updates failed. Both mirrors appear to be down." | /bin/mail -s "Virus Update Sync Failed" $EMAIL
exit 0
fi
fi
#Allow Apache to own so it dishes it out correctly.
/bin/chown -R apache.apache /var/www/html/logs /var/www/html/*.cvd
October 7, 2008, 7:57 am
I’ve been using a script to copy ClamWin virus database files manually every day, twice a day, so I can update clients locally. The script doesn’t have any logic to figure out whether the contents of the files have changed, though, so it just grabs the entire file regardless of changes — unlike rsync.
The problem is that rsync doesn’t work so well across HTTP, so I found zsync. It’s kind of confusing to use compared to rsync, so here you go.
You’ll need to create an actual .zsync file from which zsync uses to compare notes on the URL and the file you already have. If you already have rpmforge’s repo configured, go ahead and install it. Otherwise, look on Dag’s site on how to use third-party repos.
# yum install zsync
# cd /download/path
# zsyncmake -u 'http://database.clamav.net/daily.cvd' daily.cvd
# zsync -i daily.cvd daily.cvd.zsync
That’s it. Now you can kind of replicate rsync behavior to speed up HTTP transfers, very beneficial in a script. Just to do the math, I’ve been downloading the main.cvd from ClamWin (17MB) every single day, twice a day, regardless if it changes or not. That’s about 240MB of unnecessary traffic every single week for my company and for the ClamWin team.
Now I just need to edit my script to take advantage of zsync.