23 Jan 2019
•
AWS
•
RDS
I was totally unaware about the fact that even a master account doesn’t have all the privileges in an RDS database(MySQL) until I got stuck with this issue. Today, I was asked to create a secondary admin user in one of our production DB with all privileges. The MySQL DB instance was running in AWS RDS. I tried the following command
More …
21 Dec 2018
•
nodeJS
This is something that I have came across while tuning an nginx server which has multiple tomcat instances as upstream. We were trying to adjust the read timeout of the upstream proxies. It is hard to simulate this by stopping the backend as it will throw a 503 bad gateway. So, for simulating this, we used a nodejs script.
More …
15 Dec 2018
•
wordpress
This was an issue I have faced while setting up this blog. I was getting 404 errors for all the post links in this blog when selecting the non default permalink structure with SSL.
More …
04 Dec 2018
•
aws
The Amazon ECS container agent allows container instances to connect to your cluster. If this agent is down for some reason, deployments to the service won’t be reflected in the instance and can cause discrepancy.
Here is a one-liner to check if ECS agent container is running. If it is not running, we are making use of AWS SNS service to send a notification to a topic.
if [ -z $(docker ps -f “name=ecs-agent” -f “status=running” -q) ]; then /usr/bin/aws –region=us-east-1 sns publish –topic-arn “arn:aws:sns:us-east-1:123456789012:Topicname” –message “ECS Agent is not running in $HOSTNAME.”; fi
More …
06 Dec 2017
•
git
This is useful when you are giving SSH access to a server. Basically, we have to append the public key to ~/.ssh/authorized_keys.
More …
04 Mar 2016
•
nginx
In some cases, we might need to throw a custom/different error code for a specific issue. For example, we can throw a different error to the end user even if the backend node is down. We can do that in nginx as in the example below.
server {
listen 8080;
server_name [devopslife.io;](http://us-east-1-nginx1.domain.com;)
error_page 502 503 504 =204 /temperror;
location /temperror {
return 204;
}
}
More …
04 Mar 2015
•
Python
To start a HTTP server on port 8000 (which is the default port), simple type:
More …
04 Jan 2015
•
Uncategorized
- git reset –soft commit_id
- git stash save “message”
- git reset –hard commit_id
- git stash apply stash stash@{0}
- git push —force
10 Dec 2014
•
git
1. Rename your local branch.
If you are on the branch you want to rename:
git branch -m new-name
More …
07 Dec 2014
•
git
More …