(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| #!/usr/bin/ruby | |
| LOGIN, PASSWORD = 'your_number', 'your_password' | |
| require 'rubygems' | |
| require 'mechanize' | |
| agent = Mechanize.new | |
| agent.get 'https://wireless.att.com' | |
| login = agent.page.forms_with(:name=>'loginActionForm').first |
| // Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core? | |
| L.TileLayer.Common = L.TileLayer.extend({ | |
| initialize: function (options) { | |
| L.TileLayer.prototype.initialize.call(this, this.url, options); | |
| } | |
| }); | |
| (function () { | |
| # Swapping x, y coords. | |
| from descartes import PolygonPatch | |
| from fiona import collection | |
| from itertools import imap | |
| import logging | |
| from matplotlib import pyplot | |
| log = logging.getLogger() |
| import requests, os, glob, json, sys, webbrowser | |
| you = 'self' | |
| data = 'checkins' | |
| try: os.mkdir(data) | |
| except Exception: pass | |
| cid = 'YOUR_CLIENT_ID' |
| import glob, json | |
| # this script loves this script | |
| # https://gist.github.com/3350235 | |
| points = [] | |
| vids = set() | |
| places = glob.glob("checkins/*.json") | |
| for p in places: |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
| import cx_Oracle | |
| def perform_query(query, bind_variables): | |
| connection = db_pool.acquire() | |
| cursor = connection.cursor() | |
| cursor.execute(query, bind_variables) | |
| result = cursor.fetchall() | |
| cursor.close() | |
| db_pool.release(connection) | |
| return result |
| #!/bin/bash | |
| # | |
| # Script to setup a Elastic Beanstalk AMI with geospatial libraries and postGIS | |
| # | |
| # sh aws_ami_prep.sh > aws_ami_prep.log 2>&1 & | |
| # Go to ec2-user home directory | |
| cd /home/ec2-user | |
| # yum libraries |