Skip to content

Instantly share code, notes, and snippets.

Shelan Perera shelan

Block or report user

Report or block shelan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
henriquemenezes / postgresql-set-id-seq.sql
Created Mar 31, 2016
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
View postgresql-set-id-seq.sql
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
shelan /
Created Feb 25, 2016 — forked from suya55/
Open a project in IntelliJ IDEA from your command line! Raw
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
# Setup your working directory. Edit 'work' to your working directory.
working_dir=`ls -1d ~/work/$1 | head -n1`
# were we given a directory?
if [ -d "$1" ]; then
kingbin / gist:9435292
Last active Oct 31, 2019
Manually Start/Stop PostgresSQL on Mac
View gist:9435292
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
batok /
Created Apr 10, 2012
Paramiko example using private key
import paramiko
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem")
c = paramiko.SSHClient()
print "connecting"
c.connect( hostname = "", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/", "/home/ubuntu/" ]
for command in commands:
print "Executing {}".format( command )
You can’t perform that action at this time.