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
#Place this in ~/.bashrc or ~/.bash_profile so that psql can show rows that are wider than the terminal using cursor keys | |
export PAGER=less; | |
export LESS='-iMFXSx4R'; |
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="[email protected]"; | |
EMAIL_MSG="To: [email protected]\nFrom: [email protected]\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
$ rsync --partial --progress -av --rsh=ssh local_file [email protected]:~/ | |
$ rsync --partial --progress -av --rsh=ssh [email protected]:~/remoteFolder/ ./localFolder/ | |
Or shorter version | |
$ rsync -av -P -e ssh SRC DEST | |
If ssh is on a non default port: |
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
# 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 [email protected] --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
Date.prototype.prettyPrint = function () { | |
return ['Jan.', 'Feb.', 'Mar.', | |
'Apr.', 'May', 'Jun.', | |
'Jul.', 'Aug.', 'Sep.', | |
'Oct.', 'Nov.', 'Dec.'][this.getMonth()] + " " + | |
(function (d) { | |
var s = d.toString(), l = s[s.length-1]; | |
return s+(['st','nd','rd'][l-1] || 'th'); | |
})(this.getDate()) + ", " + | |
this.getFullYear() + " " + |
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
export PS1="\[\e]0;\u@\h:\w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$(__git_ps1)\$ " |
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
#!/usr/bin/env node | |
var exec = require('child_process').exec; | |
function cb(error, stdout, stderr) { | |
if (error !== null) { | |
console.log('exec error: ' + error); | |
} | |
} | |
exec('/usr/bin/meld ' + process.argv[3] + ' ' + process.argv[2] , cb); |
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
[user] | |
name = Thalis Kalfigkopoulos | |
email = [email protected] | |
[push] | |
default = simple | |
[diff] | |
external = /home/tkalfigo/.git_meld_diff.js | |
[color] | |
branch = auto | |
diff = auto |
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
find somedir -type f -exec md5sum {} \; | sort -k 34 | md5sum |
OlderNewer