Category: ShellScript
-
Code to query Azure Load Balancer Metrics to verify Availability (VipAvailability )
This one was fun to put together. I wanted to write code to query the status of an Azure Load Balancer. I couldn’t find much out there. This code query’s the Azure Load Balancer’s Metrics for VipAvailability – through the REST API. If it returns 100 then are good to go. Anyting else, then there may…
-
Note to self: cURL with data-urlencode for GET/QuerySting values
I know I would loose this if I didn’t blog it. With cURL, you can use “–data-urlencode” with query string params and a GET if you include the “-G” parameter. Of course you still have to escape things out, I just found it easer to add all the QueryString params separately. All the examples I…
-
Using git and a post-recive to update production node.js apps.
I have been trying to figure out the best way to deploy and maintain node.js apps in development and production. If I have a local git repo on my machine, and I want to push it to production, what is the best way to do this? I don’t think the .git files should be there.…
-
Extract ADFS signing certificate from the Federation Metadat URL
I did not write this, but I liked it, so I thought I would pass it on! Use this script to extract the ADFS signing certificate from the FederationMetadat url (https://sts.yourserver.com/FederationMetadata/2007-06/FederationMetadata.xml): https://raw.githubusercontent.com/bergie/passport-saml/master/docs/adfs/retrieve_adfs_certificate.sh
-
Connecting to the Salesforce REST api using cURL
My company decided to use Salesforce. I have worked with Microsoft CRM, but not Salesforce yet. When learning about a new application, I like to see how I can access the data. PowerShell and cURL are the simplest way for me to understand how to connect to a REST api. First step is getting an…
-
Grep to Remove Spaces and Comments (#)
Sometimes I just want to look at the content of a config file and not all the descriptions.
-
Raspberry Pi, Raspbian Jessie (based on Debian Jessie) disable AutoLogin GUI & Console
I did NOT want my Raspbian Jessie install to automatically boot into the GUI, and I did Not want it to autologin. I know I can run raspi-config to change it, but I like to script things! I finally tracked down the code for the new raspi-config that supports systemd. It can be found here . Here are…
-
BASH script to change the Security Keys and SALTs in a wp-config.php file
I wanted to automatically change the Security Keys/SALTS when provisioning a new WordPress site. WordPress.com has a service that spits back random values. (https://api.wordpress.org/secret-key/1.1/salt/). The script below CURLs the values and then modifies a wp-config.php file with the new random values. Don’t remember where I got the pieces of this, but here it is, I…
-
Installing WordPress via shell script(BASH)
We have been using a provisioning script that downloads the latest wordpress zip file, extracts into the right location it and sets up the DB connection. I wanted to take it a step further and eliminate the install.php page. The one that looks like this: So i sat down to figure out how to…
-
Activating and deactivating WordPress plugins from a shell script (BASH)
I needed to update my WordPress site provisioning script to download, install and activate a WordPress plugin. The download is the easy part (I just use wget). But how do I activate the plugin. This is what I cam up with: And to be complete, to deactivate:
