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
======================================================================== | |
BYTE UNIX Benchmarks (Version 5.1.3) | |
System: apocalypse.codatory.com: GNU/Linux | |
OS: GNU/Linux -- 2.6.32-5-amd64 -- #1 SMP Fri May 10 08:43:19 UTC 2013 | |
Machine: x86_64 (unknown) | |
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8") | |
CPU 0: Intel(R) Xeon(R) CPU L5420 @ 2.50GHz (5000.4 bogomips) | |
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization | |
CPU 1: Intel(R) Xeon(R) CPU L5420 @ 2.50GHz (5000.2 bogomips) |
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
def make_decision(&block) | |
raw = (0..9).map{ block.call } | |
freq = raw.inject(Hash.new(0)) { |h,v| h[v] += 1; h } | |
raw.sort_by { |v| freq[v] }.last | |
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
#!/bin/bash | |
if [[ `whoami` != 'root' ]]; then | |
echo 'You must run this script with Root permissions.' | |
exit | |
fi | |
apt-get update | |
apt-get upgrade -y | |
apt-get install pointlinux-repos-nonfree |
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/bash | |
if [[ `whoami` != 'root' ]]; then | |
echo 'You must run this script with Root permissions.' | |
exit | |
fi | |
set -E | |
set -o vi |
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/bash | |
# Random sleep up to 55 minutes - so all my VPSes don't back up at the same time and I don't have to manually manage distribution in CRON | |
sleep $(($RANDOM / 10)) | |
export PASSPHRASE='SuperSecretPassphrase' | |
# Export backup location variable | |
backup_location="/home/backups/`hostname`/duplicity" |
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
namespace :import do | |
desc 'Imports ZipCodes from geonames.org' | |
task :zip_codes do | |
require 'zip/zip' | |
require Rails.root.join('config/environment.rb') | |
ZIPFILE = Rails.root.join('tmp/zipcodes.zip') | |
CSV_OPTS = {col_sep: "\t", headers: [:country_code, :postal_code, :place_name, :state_name, :state_code, :county_name, :county_code, :community_name, :community_code, :lattitude, :longitude, :accuracy]} | |
if !File.exist?(ZIPFILE) |
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
ChicagoVPS 2048 MB VPS | |
$40 /year (special) | |
Cachefly 100 MB Download: 3.36M/s in 30s | |
======================================================================== | |
BYTE UNIX Benchmarks (Version 5.1.3) | |
System: rails: GNU/Linux | |
OS: GNU/Linux -- 2.6.32-042stab062.2 -- #1 SMP Wed Oct 10 18:28:35 MSK 2012 |
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
FOr b3 w1ll pR0dUc+, c@ch3d 3n4b|3d, 83 w1t. WI5h 34513r (4(h3d 0R +HE, 15 m1t3 pr3f3|23nc35 n0w, 1T 8@d \/\/3b. |
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
libs = Dir.glob("#{ENV['MY_RUBY_HOME']}/lib/ruby/1.9.1/*.rb").map{|i| i.split('/').last.split('.').first} | |
libs.reject!{|i| i == 'debug'} | |
libs.reject!{|i| i =~ /tk/} | |
libs.reject!{|i| i =~ /^[A-Z]/} | |
libs.each do |lib| | |
puts "Loading #{lib}" | |
require lib | |
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
#!/bin/bash | |
SERVERS=( 8.8.8.8 8.8.4.4 209.244.0.3 209.244.0.4 ) | |
for server in ${SERVERS[@]}; do | |
date -u "+%Y-%m-%d %H:%M UTC : Testing $server" | |
mtr -lrwc 20 -o 'LDRS NBAW V JMXI' $server | |
done |