Skip to content

Instantly share code, notes, and snippets.

View drdee's full-sized avatar

Diederik van Liere drdee

View GitHub Profile
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dsc
dsc / git-fat-pack.sh
Created June 13, 2012 17:53
Permanently remove crap from a git repo.
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@dsc
dsc / jconsole-proxy.sh
Created August 7, 2012 01:15
jconsole via ssh proxy
#!/bin/bash
#/ jc -- jconsole via ssh proxy
#/
#/ Usage: jc [options] HOST JMX_PORT [PROXY_PORT=JMX_PORT] [JMX_HOST=HOST]
#/
#/ Starts a SOCKS proxy via ssh to connect to a
#/ JVM running on a remote and protected machine.
#/
#/ Arguments:
#!/bin/bash
for repo in $(cat repos.txt); do
repodir=$(perl -pe 's!/!-!g;' -e 's/^analytics-//' <<< "$repo")
echo git clone --mirror ssh://gerrit.wikimedia.org/$repo.git $repodir
if git clone --mirror ssh://gerrit.wikimedia.org/$repo.git $repodir; then
echo
else
break
fi
done
@docwhat
docwhat / keychain2certfile.rb
Last active November 17, 2015 01:54
Creates an SSL_CERT_FILE on OSX (when using Homebrew) that won't break JRuby. Make sure you run this with normal ruby, not JRuby! See https://github.com/jruby/jruby-openssl/issues/56
#!/usr/bin/env ruby
# General idea stolen with no regret from Homebrew's OpenSSL formula.
require 'optparse'
require 'forwardable'
require 'shellwords'
require 'openssl'
require 'digest/md5'
require 'digest/sha1'
@andyrbell
andyrbell / scanner.sh
Last active June 16, 2024 12:48
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@tamiroze
tamiroze / sql2sf.py
Last active May 13, 2024 20:06
Converts Oracle, SQL-Server, and other DDL to Snowflake DDL
#!/usr/bin/python
# $Id: $
# Converts Oracle, SQL-Server, and other DDL to Snowflake DDL
def usage():
print """\
# Usage: sql2sf.py input-file [output-file]
"""