Howto to install AWS CodeDeploy agent on EC2 instance

Howto to install AWS CodeDeploy agent on EC2 instance

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 […]

Read More

Bower ECMDERR fixed

Bower ECMDERR fixed

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 […]

Read More

Compress PDF on OS X in Terminal

Compress PDF on OS X in Terminal

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 […]

Read More

Sudo access to a user in Linux

Sudo access to a user in Linux

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 […]

Read More

DynamoDB for Javascript – cheatsheet

DynamoDB for Javascript – cheatsheet

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, […]

Read More

Nginx SSL configuration

Nginx SSL configuration

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 […]

Read More

Remove puppet node license

Remove puppet node license

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 […]

Read More

WordPress Nginx Permalinks Rewrite

WordPress Nginx Permalinks Rewrite

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 […]

Read More

moshi moshi mm03 bluetooth handset

moshi moshi mm03 bluetooth handset

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 […]

Read More

Mysql Add User Privileges

Mysql Add User Privileges

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 […]

Read More

Howto Install New Relic on Localhost

Howto Install New Relic on Localhost

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 […]

Read More

Revert Git Revision HOWTO

Revert Git Revision HOWTO

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 […]

Read More

mysqldump mysql 5.6 problem solved

mysqldump mysql 5.6 problem solved

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 […]

Read More