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
package de.nerdno.rpc.view; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.MotionEvent; |
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
#!/usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
echo "$(basename $0) <claim-token>" | |
echo -e "\nGet claim token here: https://www.plex.tv/claim/" | |
exit 1 | |
fi | |
claim_token=$1 |
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
# Assumes the database container is named 'db' | |
DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
DB_HOSTNAME=db | |
DB_USER=postgres | |
LOCAL_DUMP_PATH="path/to/local.dump" | |
docker-compose up -d db | |
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
docker-compose stop db |
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
function git_daily --description 'Daily stats for given git branch' | |
# git log --since=1.day --author='<YOUR_EMAIL>' --shortstat $argv | awk '/^ [0-9]/ { f += $1; i += $4; d += $6 } END { printf("%d files changed, %d insertions(+), %d deletions(-)", f, i, d) }' | |
git log --since=12.hours --author='<YOUR_EMAIL>' --shortstat $argv | awk '/^ [0-9]/ { f += $1; i += $4; d += $6 } END { printf("%d files changed, %d insertions(+), %d deletions(-)", f, i, d) }' | |
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
bind r source-file ~/.tmux.conf | |
# remap prefix to Control-a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
set -g default-terminal "screen-256color" |
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
# ---------------------- | |
# variables | |
# ---------------------- | |
PATH="$PATH:/opt/local/bin:/opt/local/sbin:/usr/games:/usr/local/mysql/bin:/usr/local/sbin" | |
MANPATH="$MANPATH:/opt/local/man" | |
IRB_HISTORY_FILE=$HOME/.irb_history | |
LESS='-M -R -X' | |
# ---------------------- |
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
function mount_iso() { | |
local iso_file | |
local mnt_directory | |
local opt | |
while getopts f:d:h opt; do | |
case $opt in | |
(h) | |
print "Options:" | |
print " -f <file.iso>" |
NewerOlder