Category: Scripting

Just random stuff - Nothing to see here - Move along...

Grab Your External IP on Local Server

$ curl ifconfig.me 205.123.111.222 $ dig +short myip.opendns.com @resolver1.opendns.com 205.123.111.222 $ curl -s http://checkip.dyndns.org/ | grep -o “[[:digit:].]\+” 205.123.111.222 $ curl -s http://checkip.dyndns.org | sed ‘s/[a-zA-Z<>/ :]//g’ 205.123.111.222  

Watching ESXi VMware Server Logs

Easy monitoring script for checking ESXi VMware logs:  Log into the ESXi host console via ssh and create a script called “monitorlog.sh” # cd /var/log # vi monitorlog.sh while : do clear echo “Current time: date” tail -10 vmksummary.log|grep heartbeat|tail -1|awk ‘{print $2, $3 ” Uptime: “$4 ” Total VMs: “$5}’ echo “=======================================================” echo echo…
Read more

Load any external javascript file asynchronously!

Sticking <script></script> tags referring an external resource in the middle of your HTML code will hang the loading of your page while your browser gets the missing script. This is usually a problem with the loading of the AddToAny sharing script and a quantcast tag (which has since been removed). Check to make sure there are…
Read more

Setting up Automatic Backups in cPanel

Using the script provided below you will be able to make automatic backup of your hosting account (domains and MySQL databases). This backup script includes SSL support. This is not necessary if you run the script on the server for which you are generating the backup; but the SSL support could be important if you…
Read more

Transfer a File via PHP

I had an issue come up where GoDaddy shared hosting didn’t allow outbound FTP connections for backups, etc..  Helping someone migrate away from GoDaddy, I didn’t want to download 2 GB of data and re-upload, so threw this quick script together to make it happen: <?php if(!@copy(‘http://source.com/thefile.bz2′,’./thefile.bz2′)) { $errors= error_get_last(); echo “COPY ERROR: “.$errors[‘type’]; echo “<br />\n”.$errors[‘message’]; }…
Read more