Skip to content

Instantly share code, notes, and snippets.

View blovett's full-sized avatar

ben lovett blovett

View GitHub Profile
@blovett
blovett / check_cloudflare.rb
Created February 25, 2017 03:41 — forked from kamaljoshi/check_cloudflare.rb
This script collects domains from your Chrome history for the default profile and checks to see if they are being proxied through Cloudflare by checking presence of a header.
# Except sqlite3 all the libraries are standard that should be present with a Ruby installation.
# If you don't have sqlite3 installed. Use `gem install sqlite3`
require 'fileutils'
require 'sqlite3'
require 'uri'
require 'net/http'
require 'set'
require 'thread'

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

#!/bin/bash
while true; do
kill -9 $RANDOM
done
@blovett
blovett / install_homebrew.rb
Created December 16, 2011 02:49 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/blovett/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
@blovett
blovett / flac2mp3
Created November 13, 2011 02:38 — forked from borzilleri/flac2mp3
FLAC2Mp3 Converter, improved metadata handling, converts all flacs in current directory.
#!/usr/bin/ruby
# https://gist.github.com/1361100
ID3_TAGS = {
"TITLE" => "tt",
"ARTIST" => "ta",
"ALBUM" => "tl",
"DATE" => "ty",
"GENRE" => "tg",
"TRACKNUMBER" => "tn",