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
ssh -L 9999:localhost:9999 host1 ssh -L 9999:localhost:1234 -N host2 |
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
33 * * * * wget 'http://update.zerigo.com/dynamic?host=example.zerigo.com&[email protected]&password=f7f9c95662ebc538' -O /dev/null |
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
num(1). | |
num(2). | |
num(3). | |
triple(X,Y,Z) :- X=\=Y,X=\=Z,Y=\=Z. | |
allnumbers(X,Y,Z) :- num(X),num(Y),num(Z). | |
ct(X,Y,Z) :- allnumbers(X,Y,Z), triple(X,Y,Z). | |
sudoko(A,B,C,D,E,F,G,H,I) :- ct(A,B,C),ct(D,E,F),ct(G,H,I),ct(A,D,G),ct(B,E,H),ct(C,F,I). |
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 'dnssd' | |
require 'timeout' | |
begin | |
timeout 3 do | |
DNSSD.browse! '_airvideoserver._tcp.', 'local' do |r| | |
puts "Found HTTP service: #{r.name}" | |
resolver = DNSSD::Service.new | |
resolver.resolve(r) do |resolved| |
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
lsof -i | grep LISTEN |
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
awk '{ if ( match($0, "^pattern") ) { printf "%s\n%s\n", $0, "new TEXT" } else { print } }' input_file.text |
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
encrypt: | |
tar -cj directory | openssl des3 -salt > encrypted.tarfile | |
decrypt: | |
cat encrypted.tarfile | openssl des3 -d -salt |tar -xvj |
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/ksh | |
function proxy(){ | |
export http_proxy="http://localhost:8080/" | |
export https_proxy="http://localhost:8080/" | |
export ftp_proxy="http://localhost:8080/" | |
export no_proxy="localhost,127.0.0.1,localaddress" | |
echo -e "\nProxy environment variable set." | |
} | |
function proxyoff(){ |
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
final SimpleDateFormat formatter = SimpleDateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US); | |
final String pattern = formatter.toLocalizedPattern(); |
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 | |
set -u | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
APP_ROOT=/home/deploy/public_html/rm/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
ENV=production |