Tag: BASH
-
BASH, cURL script to retrieve Google Analytics data
Last week I wrote this PowerShell code to retrieve Google Analytics data. Below is similar code in BASH using the cURL command.
-
Update DynDNS from the command line
My router is not updating DynDNS correctly, so I wanted to use a simple cron job to do the same. Here is a simple BASH/Shell script to update DynDNS: IP=$(curl -s icanhazip.com) curl -v -k -u username:password “https://members.dyndns.org/nic/update?hostname=DNSHOSTNAME.dyndns.org&myip=$IP”
-
Using cURL to pull Google Reader starred items – Part 1 xpath
A while ago, I wrote a post about using ruby to parse the xml feed of shared starred items in Google Reader. One thing that I did not like about this solution was that I could not get the URL AND mark the item as un-starred. Since I had been playing with REST in these two…
-
Quick bash script to change .htpasswd passwords across a server
I wanted to change passwords for a users that is in all of our htpasswds. Here is a quick bash find script to do that: for PATH in $(find / -name .htpasswd); do htpasswd -b $PATH username NewPassword; done
-
BASH script to email if WordPress plugins or themes need updating
This one took me all day. But I got it. I wanted to have a script that could look through all WordPress sites and find if there are outdated themes or plugins. All I need to do is slap it into a cron job and I am good to go! Here is the BASH code…
-
OS X: Running a script when a USB drive is inserted
I rsync all my data to a USB drive that I keep at work. I wanted a way to have my rsync script automatically run when I plugged in the drive – kinda like Time Machine. It ended up being pretty simple. All I needed to do is create and AppleScript and attach it to…
-
Running a BASH script when my Laptop is opened at home – Part 2
As I mentioned in this post I should be able to run a script to find my current gateway’s MAC address. With this info, I should be able to tell when I am home, and launch a script. In this post, I talk about sleepwatcher, which runs a script when the machine is woken up. Sleepwatcher…
-
Powershell script to install Cygwin
I like having Cygwin installed on my machine, and since I always re-image, I needed a script to install Cygwin automatically. This will download and install Cygwin and install the openssh package.
-
Running a BASH script when my Laptop is opened at home – Part 1
My laptop hard drive died. I was upset only because there was data on my laptop that had not been moved over to my desktop. My desktop has time machine and is rsynced to several other drives and locations. So I lost data. My own fault because I was not diligent in moving data off…
-
Comparing master and slave MySQL WordPress DBs
My VPS host – Rackspace contacted me the other day to tell me that my host server became unresponsive. After it came back online I went to my MySQL replicated slave to check the status. The /var/log/mysqld.log said: Error reading packet from server: Client requested master to start replication from impossible position This article siad…
