This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add these lines in your ~/.bashrc file | |
# Show git branch name | |
force_color_prompt=yes | |
color_prompt=yes | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP to HTTPS | |
return 301 https://$host$request_uri; | |
REDIRECT NON-WWW TO WWW: | |
if ( $host !~ ^www\. ) { | |
return 301 $scheme://www.$host$request_uri; | |
} | |
REDIRECT WWW TO NON-WWW | |
if ( $host ~ ^www\.(?<domain>.+)$ ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo echo "127.0.0.1 $(hostname)" >> /etc/hosts | |
Go the the VPC management console, select the VPC, click on Actions, select Edit DNS Hostnames and select Yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## This EC2 instance will need to be in the 'jenkins-ci-server' IAM Role | |
# get latest updates | |
sudo yum update -y | |
# add Jenkins repo | |
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo | |
# import key from Jenkins CI | |
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# lock script to prevent parallel running | |
scriptname=$(basename "$0") | |
pidfile="/tmp/${scriptname}-lock.pid" | |
exec 200>"$pidfile" | |
flock -n 200 || exit 1 | |
pid=$$ | |
echo $pid 1>&200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check AWS credentials exist | |
if [[ $(aws configure list | grep "*") && $? -eq 0 ]]; then | |
: | |
else | |
echo "Please configure AWS credentials to continue..." | |
aws configure | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |