Skip to content

Instantly share code, notes, and snippets.

@brianboyer
brianboyer / import_tix.py
Created March 16, 2012 16:16
Unfuddle ticket generator
import csv, os.path
import os
import httplib, base64
import getpass
username = raw_input("Username:")
password = getpass.getpass("Password:")
subdomain = raw_input("Subdomain:")
project = raw_input("Project id:")
filename = raw_input("Tickets file:")
@marcelduran
marcelduran / gist:1e91b64849e4c0572de2
Created May 14, 2014 18:09
PhantomJS script to pseudo-retina screenshots
var page = require('webpage').create(),
address, output, size;
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg);
};
if (phantom.args.length < 2 || phantom.args.length > 6) {
console.log('Usage: rasterize.js URL filename WxH retina ua');
phantom.exit();
@ismasan
ismasan / phantom_js_url_cycle.js
Created May 15, 2011 15:24
Super easy web screen scraping with Phantom.js. Screenshots example.
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Cycle array of URLs and process with phantom.js (http://www.phantomjs.org/)
Adds Array.prototype.forEachWebPage() iterator.
EXAMPLE:
Save screenshots. Command line:
phantomjs phantom_js_url_cycle.js ./screenshots
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[
@kixorz
kixorz / ec2hostname.rb
Last active June 3, 2022 11:27
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
@jfriv
jfriv / prod-rds-snap-restore-to-dev-temp.sh
Created August 16, 2016 20:03
RDS manual snapshot and restore script
#!/bin/bash
# set up some variables
NOW_DATE=$(date '+%Y-%m-%d-%H-%M')
RESTORE_FROM_INSTANCE_ID=<source name>
TARGET_INSTANCE_ID=<target name>
TARGET_INSTANCE_CLASS=db.m4.large
VPC_ID=<vpc subnet id>
NEW_MASTER_PASS=<root password>
@jdowning
jdowning / ami-clean.sh
Last active December 26, 2023 20:09
Script to clean up Ubuntu EC2 instance before packaging as an AMI
#!/bin/bash
# This script cleans up your EC2 instance before baking a new AMI.
# Run the following command in a root shell:
#
# bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh)
function print_green {
echo -e "\e[32m${1}\e[0m"
}
@jberkus
jberkus / gist:6b1bcaf7724dfc2a54f3
Last active January 7, 2024 21:26
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@limepanda
limepanda / kvm-migration.txt
Last active January 26, 2024 23:26
migrate qcow2 image to zfs volume
qemu-img convert -O raw <infile.(vdi|vmdk|$whatever)> /dev/zvol/rpool/data/<vmid>-disk0
@briantjacobs
briantjacobs / storytelling_from_space.md
Last active February 18, 2024 10:02
Storytelling from Space

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

  • Landsat archive
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages