This script will install the latest version of AWS CodeDeploy agent on your EC2 instance running Ubuntu. First, let’s create a bash script that will do this for us nano install_code_deploy_agent.sh Add this into your script: #!/bin/bash sudo apt-get update sudo apt-get install python-pip python-pip ruby2.0 wget -y cd /home/ubuntu wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install chmod +x ./install […]
One of my automated builds suddenly failed with an unusual error that says ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/angular/bower-angular.git", exit code of #69 Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. As the error suggests, the quick fix is to re-Agree to the Xcode/iOS license and […]
For my own reference, GhostScript is a great tool to compress those huge PDF files that your scanner generates. In order to use GhostScript PDF compressor, you need to install GhostScript first: brew install ghostscript Then you can run the following command to compress your original file to a smaller file gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook […]
The following command will give sudo access to a user on a linux machine: sudo printf "myuser ALL = NOPASSWD: ALL\n# User rules for myuser\nmyuser ALL=(ALL) NOPASSWD:ALL\n" | sudo tee /etc/sudoers.d/myuser > /dev/null && sudo chmod 440 /etc/sudoers.d/myuser Where myuser is the username you are granting privileges to. The command will also apply the correct […]
The following snippets can be used for interacting with AWS DynamoDB using AWS Javascript API. PutItem var params = { TableName: 'table_name', Item: { // a map of attribute name to AttributeValue attribute_name: { S: 'STRING_VALUE' } // more attributes... }, Expected: { // optional (map of attribute name to ExpectedAttributeValue) attribute_name: { Exists: true, […]
I just got a notification about the SSLv3 POODLE Vulnerability and the suggested fix is to disable SSLv3 protocol from your server that supports SSLv3. If you have your SSL certificate configured on you AWS Elastic Load Balancer, you can quickly apply this fix by logging into your AWS management console and click on your […]
The following Nginx SSL configuration gives me PCI compliance as well as protection against BEAST attacks. This configuration also ensures that forward secrecy is applied in the SSL layer. More information on forward secrecy here. So this is what my typical few lines of SSL configuration would look like in Nginx vhost: server { listen […]
If you are using Puppet Enterprise, you are limited to 10 nodes before you have to start paying for each node you provision. When you terminate a puppet node, it won’t de-register itself from the node license. To remove puppet node license you need to manually deactivate the node from the PuppetDB and the way […]
I have just spent quite a bit of time migrating old permalinks on client’s blog from “Day and Name” permalink structure to “Post name” permalink structure. The website is powered by Nginx webserver and I was looking for a simple WordPress Nginx Permalinks Rewrite that will do this for me. After digging through the Nginx […]
French designer David Turpin’s Moshi Moshi MM03 Bluetooth Handset is an ergonomically designed, high gloss-textured bluetooth handset that lets you pair and simultaneously operate two different Bluetooth devices such as a phone and a laptop to make VOIP or mobile calls. The MM03 comes with a recharging base for the handset, and a silicon mat […]
Occasionally, you may want to update specific posts to have all links attributed with rel=”nofollow”. For example, if you have sponsored posts on your site you may want them to have the rel=”nofollow” attribute so that google does not index those external links on your site. I client of mine asked me to do this […]
I’ve tried numerous 3rd party iPhone chargers and none of them lasted for more than a few charges. iPhone would simply refuse to accept 3rd party chargers after a while. I got the MiLi Power Spring 5 Charging Case a few weeks ago and it’s been working like a charm. Not only does MiLi Power […]
I have to admit I am obsessed with web performance, and I spend a lot of time analysing server-side performance graphs. Recently I noticed a significant spike in database CPU usage as well as the web server CPU usage on one of my many websites. Almost all of my websites are on WordPress 3.7.1 (at […]
Being a scuba diving instructor in my spare time, I tend to spend a lot of time on boats and on the water. I own a iPhone 5 and I had to replace my old one because it accumulated a lot of salt in the charger connection socket. The socket eventually corroded and prevented my […]
This is a quick MySQL snippet that allows me to add user privileges to a MySQL database. The script will create a user first, then it will grant various privileges to that user. CREATE USER 'sqluser'@'%' IDENTIFIED BY 'sqlpassword'; GRANT USAGE ON *.* TO 'sqluser'@'%' IDENTIFIED BY 'sqlpassword' WITH MAX_QUERIES_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 […]
I’m sure you’ve all used or at least heard of New Relic application monitoring tool. If you haven’t, you’ve been living in a cave for the last couple of years 🙂 It’s a great tool for pinpointing bottlenecks in your application. However, most people have this tool installed on their production systems only. What if […]
To delete launch config in AWS programatically is something I left out in one of my previous posts – Scaling WordPress in Amazon Cloud. In that post I explained how I create an AMI snapshot of a WordPress instance after each deployment. This ensures that I have an up to date AMI (frozen pizza model) […]
I’ve had to revert my Git commits a number of times and to revert git revision involves executing a few commands in a terminal window. To save me time googling for the solution I’ll add it in here for my future reference. To revert your Git repository to a specific revision number you need to […]
If you have recently upgraded your MySQL version to 5.6, your mysqldump command will probably throw the following error: mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 […]
Bash Status Code The following script is for my own reference. It’s a simple script that pings a URL and looks for a bash status code of 200. If the response does not return the status code of 200, it will add an entry to a log file. Inside that block of code you can […]