This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
client_jar="`dirname $0`/minecraft.jar" | |
max_heap_size="1024M" | |
initial_heap_size="512M" | |
java -Xms$initial_heap_size -Xmx$max_heap_size -cp $client_jar net.minecraft.LauncherFrame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((player.inShuffle() && player.playedSongCount() > 0 && !player.isDirty() && this.main.playerScreen.playButtonAvailable()) || | |
(!player.inShuffle() && ((player.getQueueIndex() - 1) >= 1) && !player.isDirty() && this.main.playerScreen.playButtonAvailable())) { | |
// What the fuck just happened up there? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind r source-file ~/.tmux.conf | |
bind k up-pane | |
bind j down-pane | |
set-option -g status-keys vi | |
# Increase this if running shell commands from this config. | |
set -g status-interval 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatically reconnects an ssh session on $interval. | |
# To halt this function, do this: touch $HOME/.ssh_stop_reconnect | |
function auto_ssh() { | |
stop_file="$HOME/.ssh_stop_reconnect" | |
interval=5 | |
if [[ -f $stop_file ]]; then | |
echo "Cleaning restart file: $stop_file" | |
rm -f $stop_file | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' if RUBY_VERSION =~ /1\.8/ | |
require 'rack' | |
require "#{File.dirname(__FILE__)}/webapp" | |
if __FILE__ == $0 | |
def usage | |
STDERR.puts("Usage: #{$0} <webrick, thin, mongrel>") | |
exit | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = YOUR NAME | |
email = YOUR EMAIL | |
[github] | |
user = GITHUB_USERNAME | |
token = GITHUB_TOKEN | |
[core] | |
pager = less -FMRX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
dependencies = %w{ | |
ipaddr | |
geokit | |
optparse | |
} | |
begin | |
dependencies.each { |lib| require lib } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'ipaddr' | |
require 'optparse' | |
# Simple script which adds the given IPs to /etc/hosts.deny (or the specified file). | |
class DenyIP | |
DEFAULT_DENY_FILE = '/etc/hosts.deny' | |
def self.run!(*args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NerdNode | |
# Rack app to reject common bot attacks. Returns a random HTTP status and content type, along with some LOLs. | |
# | |
# Usage: | |
# use NerdNode::BotProtector, /phpmyadmin\/scripts|mysql\/scripts/ | |
# | |
# # ...or use the Regexp helper which takes an array of URL strings... | |
# blacklist = BotProtector.build_regex(['phpmyadmin/scripts', 'mysql/scripts']) | |
# use NerdNode::BotProtector, blacklist | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Command line tool to send something to the Gnome Trash (with restore info). | |
# TODO: Support trashing files of the same name. | |
class Janitor | |
TRASH_DIR = File.expand_path(File.join(ENV['HOME'], '.local/share/Trash')) | |
FILES_DIR = File.join(TRASH_DIR, 'files') | |
INFO_DIR = File.join(TRASH_DIR, 'info') |