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
syntax on | |
set number | |
set expandtab | |
set tabstop=2 shiftwidth=2 | |
set smarttab | |
set autoindent | |
set ignorecase | |
set smartcase | |
set hlsearch |
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
#C-a as prefix and free C-b | |
set -g prefix C-a | |
unbind C-b | |
# Send C-a to application by pressing it twice | |
bind C-a send-prefix | |
# Reload configuration file | |
unbind r | |
bind r source-file ~/.tmux.conf \; display "Configration file .tmux reloaded!" |
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 | |
set -e | |
ROOT_DIR=versions/$(date +%Y%m%d_%H%M%S) | |
read -p "Enter tag name: " TAG | |
read -p "Enter Bitbucket Username: " USERNAME | |
read -sp "Enter Bitbucket Password: " PASSWORD | |
echo git clone https://${USERNAME}@GIT_URL $ROOT_DIR --depth 1 | |
git clone https://${USERNAME}:${PASSWORD}@GIT_URL $ROOT_DIR --depth 1 |
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
# Support for one-time run only, if somethin happend in middle of the process | |
# Use comment to skip the success commands | |
apt-get update | |
# Variables | |
LOCALE="en_US.UTF-8" | |
TZ="Asia/Singapore" | |
USER="ubuntu" |
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 | |
DB_USER=username | |
DB_PASS=password | |
BACKUP_DIR=absolute_dirpath/ #don't forget the trailing slash | |
DIR_NAME=$(date +%Y%m%d_%H%M%S) | |
NUM_BACKUP=14 | |
DATABASES=$(mysql -u${DB_USER} -p${DB_PASS} -e 'show databases;' 2>&1) | |
if [[ $DATABASES == *"ERROR"* ]]; then |
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 | |
databaseName="$1" | |
rootUser="root" | |
rootPass="pass" | |
user=$databaseName | |
userPassword=$(date +%s | sha256sum | base64 | head -c 15 ; echo) | |
runMySql() { | |
echo $(/usr/bin/mysql -u$rootUser -p$rootPass -e "$1;" 2>&1) |
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
server { | |
listen 80; | |
set $project_dir /home/wico/Projects; | |
server_name ~^(?<project>.+)\.lvh\.me$; | |
index index.php index.html index.htm; | |
root $project_dir/$project/public; | |
client_max_body_size 1G; |
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
Show hidden characters
{ | |
"always_prompt_for_file_reload": false, | |
"always_show_minimap_viewport": false, | |
"animation_enabled": true, | |
"atomic_save": true, | |
"auto_close_tags": true, | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": false, | |
"auto_complete_delay": 50, | |
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin", |
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
server { | |
listen 80; | |
listen 8888; | |
server_name localhost; | |
index index.php index.html index.htm; | |
root /path/to/root; | |
autoindex on; |
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/sh | |
CONFIG_FILE="/etc/nginx/sites-available/project" | |
DIR=$1 | |
if [ $# -eq 0 ] | |
then | |
DIR='.' | |
fi |