Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am greinacker on github.
  • I am greinacker (https://keybase.io/greinacker) on keybase.
  • I have a public key ASAi3rad9qlFlIsUm5fNcEgrlUY8LFlSbnLr6k21B24qmAo

To claim this, I am signing this object:

@greinacker
greinacker / redirects.py
Created March 2, 2016 21:31
Get redirect URLs
# coding: utf-8
import sys
import clipboard
import requests
import webbrowser
url = sys.argv[1]
redir_urls = []
resp = requests.get(url, allow_redirects = False)
@greinacker
greinacker / get_kc.py
Last active December 31, 2018 15:26
Workflow/Pythonista samples for saving/retrieving from keychain
# coding: utf-8
import sys
import keychain
import clipboard
import webbrowser
key = sys.argv[1]
value = keychain.get_password("workflow", key)
if value != None:
@greinacker
greinacker / pythonista-install-boto.py
Created February 9, 2016 22:06 — forked from najibninaba/pythonista-install-boto.py
Pythonista script for installing boto
# Source: https://gist.github.com/najibninaba/5062153
#
# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its
# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:
# import sys; sys.path.append('boto-module')
# import boto.ec2
#
# Credits:
# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588
#
@greinacker
greinacker / ec2_start.py
Created February 9, 2016 21:50
Pythonista EC2 scripts
# coding: utf-8
import sys; sys.path.append('../boto-module')
import boto.ec2
import time
import keychain
import clipboard
import console
import webbrowser
instance_id = "i-123456ab"
@greinacker
greinacker / delete_node.py
Created January 25, 2016 18:32
Pythonista Linode scripts
# coding: utf-8
import sys
import keychain
import console
import clipboard
import webbrowser
import api
return_url = None
if len(sys.argv) >= 2:
@greinacker
greinacker / test.html
Created October 4, 2013 22:45
Horizontal Tradervue widget example
<html>
<head>
<style type="text/css">
#tvw {
width:700px;
text-align:center;
}
#tvw > div {
display: inline-block;
margin: 15px;
@greinacker
greinacker / gist:5017581
Created February 23, 2013 00:11
ruby code for current process memory usage
`ps -o rss= -p #{Process.pid}`.to_i
@greinacker
greinacker / master_pg_hba.conf
Last active September 11, 2023 01:10
PostgreSQL 9.2.x replication
hostssl replication replicator 5.6.7.8 md5
@greinacker
greinacker / 1.rb
Created October 18, 2012 22:32
Per-host Capistrano tasks
role :web, "192.168.1.132", :internal => "10.0.0.1"
role :app, "192.168.1.133", :internal => "10.0.0.2"
role :db, "192.168.1.132", :primary => true
role :db, "192.168.1.134", :no_release => true, :internal => "10.0.0.3"