This file contains 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 -x | |
PG_DATA_DIR="/home/postgresql/data"; | |
DEST_HOST="example.com"; | |
DEST_DIR="/home/remote_user/WAL_ARCHIVE"; | |
SCP_USERNAME="remote_user"; | |
# uses ssmtp to send email [for setup see: http://www.havetheknowhow.com/Configure-the-server/Install-ssmtp.html] | |
EMAIL_RECIPIENT="myself@example.com"; | |
EMAIL_MSG="To: myself@example.com\nFrom: myself@example.com\nSubject: Replication error\n\n"; | |
#in case of error, how long to sleep before retrying |
This file contains 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
var crypto = require("crypto") | |
function encrypt(key, data) { | |
var cipher = crypto.createCipher('aes-256-cbc', key); | |
var crypted = cipher.update(data, 'utf-8', 'hex'); | |
crypted += cipher.final('hex'); | |
return crypted; | |
} |
This file contains 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
CREATE AGGREGATE array_accum (anyarray) | |
( | |
sfunc = array_cat, | |
stype = anyarray, | |
initcond = '{}' | |
); |
This file contains 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
\set QUIET 1 | |
\pset null '(null)' | |
\pset linestyle unicode | |
\pset border 2 | |
\timing | |
\set ON_ERROR_ROLLBACK interactive | |
\set HISTFILE ~/.psql_history- :HOST - :DBNAME | |
\set HISTSIZE 2000 | |
\set PROMPT1 '%n@%/[%M:%>] # ' | |
\set PROMPT2 '> ' |
This file contains 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 this file as ~/.git-prompt-colors.sh | |
# This is the custom theme template for gitprompt.sh | |
override_git_prompt_colors() { | |
GIT_PROMPT_THEME_NAME="Custom" | |
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${ResetColor} ${Yellow}${PathShort}${ResetColor}" | |
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" | |
GIT_PROMPT_END_USER=" \n${Green}[${USER}@${HOSTNAME%%.*}] ${Time12a}${ResetColor} $ " | |
} |
This file contains 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
# alias gitlo='git log --no-walk --tags --pretty="%h %d %s" --decorate=full --oneline' | |
alias gitlo='git log --pretty="%h %ad %d %s (%an)" --decorate=full --graph -n 30 | grep -E --color "^|tag: "' | |
alias gitloa='git log --no-walk --tags --pretty="%h %d %s" --decorate=full --author=youremail@foo.com --oneline' | |
alias gitbra="git branch -vva" | |
alias gitsta="git status" | |
alias gitdif="git diff --color-words" | |
alias gitlosum="git log --stat --summary" | |
alias gitdifstat="git diff --stat --summary" | |
alias gitpull="git pull --rebase" | |
alias gitpru="git remote prune origin" |
This file contains 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
# pretty terminal system info | |
/usr/bin/neofetch | |
# sudocabulary [https://github.com/badarsh2/Sudocabulary] | |
chmod +x ~/.vocab | |
~/.vocab |
This file contains 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
var el = document.createElement('script'); | |
el.src = "https://raw.githubusercontent.com/lodash/lodash/3.10.1/lodash.min.js"; | |
el.type = "text/javascript"; | |
document.head.appendChild(el) |
This file contains 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 strict'; | |
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev | |
var gulp = require('gulp'), | |
clean = require('gulp-clean'), | |
cleanhtml = require('gulp-cleanhtml'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
stripdebug = require('gulp-strip-debug'), |
This file contains 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 | |
# | |
# Bash script to setup headless Selenium (uses Xvfb and Chrome) | |
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04 | |
# Add Google Chrome's repo to sources.list | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
# Install Google's public key used for signing packages (e.g. Chrome) | |
# (Source: http://www.google.com/linuxrepositories/) |
NewerOlder