Skip to content

Instantly share code, notes, and snippets.

View imagescape's full-sized avatar

Imaginary Landscape, LLC imagescape

View GitHub Profile
@imagescape
imagescape / gist:2763055
Created May 21, 2012 16:08
Git remove large zipfile
/proj.bkp2$ git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5
b1bec83ec786b25d0027ad3e12548877291502b1 blob 17932 3299 481049
10bc64b243092ba8219f2e6c1580652f2fbd9b57 blob 20126 20026 208912
cf181fa1c4d9aa95de1727f432b7672abaa618b7 blob 40725 10369 428964
e810b9252692ae790905e60edab5ca6eff35e573 blob 41857 10222 171630
668eb6ed5b5c4a8145602752d4cb12f33b24ee7f blob 31760199 30081667 494141
/proj.bkp2$ git rev-list --objects --all | grep 668eb6ed5b5c4a8145602752d4cb12f33b24ee7f
668eb6ed5b5c4a8145602752d4cb12f33b24ee7f ibrowser/static/ibrowser/img/fugue-icons-3.3.4-src.zip
/proj.bkp3$ git repack -A -d
Counting objects: 1168, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1020/1020), done.
Writing objects: 100% (1168/1168), done.
Total 1168 (delta 687), reused 105 (delta 32)
/proj.bkp3$ git prune
/proj.bkp3$ git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5
package main
import "fmt"
import "time"
import "runtime"
const (
MAX_UPDATES = 50
MAX_FRAMES = 25
)
let b = do OutOfKittens.protect {
do_some_stuff();
that_might_raise();
out_of_kittens();
};
do b.handle |t| {
UseAardvarksInstead
}
#!/bin/bash
"$@";
notify-send "Complete:" "$*" &
playsound "$NOTIFY_SOUND" > /dev/null &
#!/usr/bin/env python
import os, sys, argparse, subprocess
from fabric.api import *
def get_args():
parser = argparse.ArgumentParser(description='Run bash commands on a remote host. Get notified when its done.')
parser.add_argument('hoststring', type=str, nargs=1,
help='ssh user@host string')
#!/usr/bin/env python
import os, sys, argparse, subprocess
from fabric.api import *
DONESND = os.environ.get('NOTIFY_DONE_SOUND', None)
ERRORSND = os.environ.get('NOTIFY_ERROR_SOUND', DONESND)
DEVNULL = open(os.devnull, 'w')
@imagescape
imagescape / Install Openssh from Source
Created April 8, 2013 14:37
Install openssh in an alternate location from source
# We will assume installation in the /opt/ directory
mkdir /opt/openssh/
cd /opt/openssh/
# gather and install the dependencies
wget http://zlib.net/zlib-1.2.7.tar.bz2
tar jxvf zlib-1.2.7.tar.bz2
cd zlib-1.2.7
./configure --prefix=/opt/openssh/dist/
@imagescape
imagescape / UpgradeDjango.md
Last active June 27, 2018 12:16
Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.

Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.

Change to DATABASES variable in settings.py.

Django now supports multiple databases and changes are needed to how the database connections are defined.

  • Changed in Django 1.2
  • Change Required by Django 1.4
  • Source: