Skip to content

Instantly share code, notes, and snippets.

View bleything's full-sized avatar
🤡
Computerin'

Ben Bleything bleything

🤡
Computerin'
View GitHub Profile
=== CPU cache information ===
CPU /sys/devices/system/cpu/cpu0 Level 1 Cache: 32K (Data)
CPU /sys/devices/system/cpu/cpu0 Level 1 Cache: 32K (Instruction)
CPU /sys/devices/system/cpu/cpu0 Level 2 Cache: 256K (Unified)
CPU /sys/devices/system/cpu/cpu0 Level 3 Cache: 12288K (Unified)
CPU /sys/devices/system/cpu/cpu1 Level 1 Cache: 32K (Data)
CPU /sys/devices/system/cpu/cpu1 Level 1 Cache: 32K (Instruction)
CPU /sys/devices/system/cpu/cpu1 Level 2 Cache: 256K (Unified)
CPU /sys/devices/system/cpu/cpu1 Level 3 Cache: 12288K (Unified)
CPU /sys/devices/system/cpu/cpu10 Level 1 Cache: 32K (Data)
Memtest86+ v4.20
Core i7 (32nm) 2394 MHz
L1 Cache: 32K 79801 MB/s
L2 Cache: 256K 31500 MB/s
L3 Cache: 12288 21963 MB/s
Memory : 96G 6879 MB/s
@bleything
bleything / gist:850430
Created March 2, 2011 03:41
do not delete!
$ rake
(in /Users/ben/projects/oss/ben_string)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_ben_string.rb"' --
./lib/ben_string.rb:26:in `append_features': cyclic include detected (ArgumentError)
from ./lib/ben_string.rb:26:in `include'
from ./lib/ben_string.rb:26
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
from ./test/test_ben_string.rb:2
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
@bleything
bleything / ubuntu-lucid-ree.erb
Created February 17, 2011 19:02
A chef bootstrapper that provisions the machine with REE
<%# chef bootstrap script %>
<%# made by Estately, Inc. placed in the public domain. %>
bash -c '
<%# let's get this party started %>
apt-get update
apt-get -y install build-essential wget
<%# install REE if necessary %>
@bleything
bleything / passwords.rake
Created February 9, 2011 21:48
A Rakefile for managing an encrypted password file
########################################################################
### Rakefile for encrypted passwords
########################################################################
#
# Here's a little Rakefile to manage your encrypted password file! It's
# really easy to use:
#
# 1) put the email addresses of the keys you want in AUTHORIZED_USERS
# 2) create a passwords.txt (and ignore it in your SCM)
# 3) run `rake passwords:encrypt`

Trick The First: filtering ps

So you know how ps piped to grep shows you the grep command?

$ ps auxww | grep bash
ben      64291   0.0  0.0  2435036    372 s001  R+   11:48AM   0:00.00 grep bash
ben      61887   0.0  0.0  2435468   1896 s001  S    11:38AM   0:00.13 -bash
ben      61376   0.0  0.0  2435468   1888 s000  S+   10:46AM   0:00.06 -bash
# A faster version of which, that also prints ALL versions in your PATH,
# and accepts wildcards, e.g.: which '*uu*'. Silent if nothing found.
# Only works if test -x works...
# Modifyed by davida to only return the first match
function which() {
case $# in
0) echo Usage: which cmd ...; return 1;;
esac
dirs=`echo $PATH|sed 's/^:/. /
We couldn’t find that file to show.
#!/usr/bin/env ruby
require 'time'
begin
require 'rubygems'
require 'gruff'
rescue LoadError
$stderr.puts "git-statgraph requires RubyGems and the rmagick and gruff gems"
exit 1
require 'json'
namespace :databags do
desc "Update databags on server from disk"
task :push do
Dir[ 'data_bags/**/*json' ].each do |file|
bag = file.split('/')[1]
sh "knife data bag from file #{bag} #{file}"
end
end