This file contains hidden or 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 | |
if [[ $TMUX != "" && `/usr/bin/tmux show-options 2> /dev/null | grep "^status off$"` ]]; then | |
/usr/bin/tmux set status on \; $@ &> /dev/null | |
else | |
if [[ $1 == "--nostatus" ]]; then | |
/usr/bin/tmux -2 new-session \; set status off | |
else | |
/usr/bin/tmux -2 $@ | |
fi | |
fi |
This file contains hidden or 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/bash | |
if [[ -t 0 && -t 1 && -t 2 && $# == 0 ]]; then | |
exec tmux -q -2 set -g default-shell /bin/zsh \; new-session | |
else | |
exec /bin/bash "$@" | |
fi |
This file contains hidden or 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
import os | |
import tempfile | |
import subprocess | |
import errno | |
def _popen(cmd, stdin=None, stdout=None, stderr=None, notty=False): | |
if notty: | |
try: | |
p1 = subprocess.Popen(cmd, stdin=stdin, | |
stdout=subprocess.PIPE, |
This file contains hidden or 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 | |
def to_human(t) | |
ms = ((t-t.floor)*10).floor | |
sec = t.floor | |
hour = (sec/3600).floor | |
sec -= hour * 3600 | |
min = (sec/60).floor | |
sec -= min * 60 | |
sprintf "%02d:%02d:%02d.%01d", hour, min, sec, ms |
This file contains hidden or 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 | |
def to_human(t) | |
ms = ((t-t.floor)*10).floor | |
sec = t.floor | |
hour = (sec/3600).floor | |
sec -= hour * 3600 | |
min = (sec/60).floor | |
sec -= min * 60 | |
sprintf "%02d:%02d:%02d.%01d", hour, min, sec, ms |
This file contains hidden or 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 | |
pid = fork do | |
Process.setsid # get immune to our parent's TTY signals | |
Signal.trap("CLD") { exit } # mplayer died | |
IO.popen(['mplayer', *ARGV], :err => [:child, :out]) do |io| | |
begin | |
loop do | |
begin | |
IO.copy_stream(io, STDOUT) |
This file contains hidden or 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/bash | |
CMD="qemu" | |
INPUT="" | |
while (($#)); do | |
case $1 in | |
--input|-i) INPUT=$2; shift;; | |
*) echo "Halp";; | |
esac |
This file contains hidden or 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 | |
# Gemfile | |
# source 'https://rubygems.org/' | |
# gem 'stretcher', git: 'git://github.com/PoseBiz/stretcher.git' | |
# gem "ruby-progressbar", :require => false | |
# gem 'multi_json' | |
# gem 'oj' |
This file contains hidden or 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 'openssl' | |
require 'tempfile' | |
# How to use: | |
# cd assets/data | |
# find . -type f -print0 | xargs -L1 -0 ./decrypt.rb | |
input_path = ARGV[0] |
This file contains hidden or 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 nginx nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error_log info; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
OlderNewer