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
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
shelan / ij.sh
Created Feb 25, 2016 — forked from suya55/ij.sh
Open a project in IntelliJ IDEA from your command line! Raw
View ij.sh
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# 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
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
Password:
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
@batok
batok / paramiko_example.py
Created Apr 10, 2012
Paramiko example using private key
View paramiko_example.py
import paramiko
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print "connecting"
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ]
for command in commands:
print "Executing {}".format( command )
You can’t perform that action at this time.