Skip to content

Instantly share code, notes, and snippets.

@petehamilton
petehamilton / hashcrack.rb
Created February 11, 2013 17:16
Ruby md5 passw3ord cracker. Brute force, character product, recursive yielding and base-n techniques
#! /usr/env/ruby
require "benchmark"
require 'digest/md5'
# The password hash to crack
password_hash = "e1f3ecc31656795a128db19da490c9ec"
# Helper for hashing passwords
def md5(password)
Digest::MD5.hexdigest(password)
@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@Swop
Swop / Screencast to GIF file
Last active December 11, 2015 10:48
Simple steps to create a GIF from a screencast (OSX but works with Linux)
# Install ffmepg (for the screencast) & imagemagick (to optimize the GIF file for web usage)
brew install ffmpeg
brew install imagemagick
# Make the screencast and compress it
ffmpeg -i ScreenFlow.mov -pix_fmt rgb24 output.gif
convert -layers Optimize output.gif output_optimized.gif
# Upload it somewere in the cloud...
# ... and use the file in the desire website. Here's the markdown syntax:
@wobbals
wobbals / AvcEncoder.java
Created October 31, 2012 22:46
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
@solar
solar / install.sh
Created October 16, 2012 10:47
install redis with supervisord
#!/bin/sh
version="2.6.3"
priority="20603"
sudo mkdir -p /var/redis /var/log/redis
curl -sL http://redis.googlecode.com/files/redis-${version}.tar.gz | tar zx
cd redis-${version}/
make
sudo make PREFIX=/usr/local/redis/${version} install
@sandys
sandys / go-mtpfs.md
Created October 13, 2012 12:23
Mount the HTC One X on Linux (Ubuntu 12.04 Precise)
sudo apt-get install golang git mercurial
git clone https://github.com/hanwen/go-mtpfs.git
cd go-mtpfs
go build
sudo mv go-mtpfs /usr/local/sbin/go-mtpfs 
sudo chmod a+x /usr/local/sbin/go-mtpfs
sudo mkdir /media/mtp
sudo chmod 775 /media/mtp
sudo /usr/local/sbin/go-mtpfs -allow-other=true /media/mtp
@arnab
arnab / dynamic-fonts.el
Created September 24, 2012 04:08
Dynamically adjust fonts in emacs based on screen resolution (Retina vs. Thunderbolt)
;; Gist-ed from in https://github.com/arnab/emacs-starter-kit
(defun fontify-frame (frame)
(interactive)
(if window-system
(progn
(if (> (x-display-pixel-width) 2000)
(set-frame-parameter frame 'font "Inconsolata 19") ;; Cinema Display
(set-frame-parameter frame 'font "Inconsolata 16")))))
@lucifr
lucifr / image_process.bash
Created September 20, 2012 05:49
a bash script for Alfred Extension to process screenshot.
#!/bin/bash
#
# requirements:
# - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx
# - image_optim: https://github.com/toy/image_optim
# - a scp supported host with ssh key paired
# setting up the enviroment
export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH
@pasela
pasela / README.md
Created August 22, 2012 06:18
mintty: A soft pastel color theme(xoria256) for mintty

A soft pastel color theme for mintty

This is ported version of color theme xoria256.

screenshot

Settings

Merge mintty-color-xoria256-rc into your .minttyrc