View dump-debuginfo
#!/bin/bash
set -eou pipefail
me="$(basename $BASH_SOURCE)"
if [ $# -ne 1 ]; then
echo >&2 usage: "$me" /path/to/binary/to/dump
exit 1
fi
View ifconfig-annotated-strace
######## start up crap ########
execve("/sbin/ifconfig", ["ifconfig"], [/* 16 vars */]) = 0
brk(0) = 0xda6000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f87bbd5d000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106334, ...}) = 0
mmap(NULL, 106334, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f87bbd43000
View rest-client.hs
{-# LANGUAGE OverloadedStrings #-}
-- The Haskell String type is a linked list of characters, and according to the
-- Haskell Report, literal strings have this type. There are better
-- representations like Data.Text and ByteString, which use packed arrays of
-- characters. OverloadedStrings is a language extension that lets you use
-- sting literals in places where these other representations are expected,
-- without needing conversion functions. In this file, that's happening in the
-- object property getters in parseJson -- (.:) takes a Data.Text, and you want
-- to call it more conveniently with a string literal.
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
end
View lazy-bytestring-cycle.hs
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Encoding as E
import qualified Data.ByteString.Lazy as L
mtl = "montréal\n" :: T.Text
long = L.cycle $ E.encodeUtf8 mtl
main = L.putStr long
View watch.rb
require 'formula'
class Watch < Formula
homepage 'https://gitorious.org/procps'
url 'http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.7.tar.xz'
sha1 '8b18d176ce639cd89e969cd815c61a4e5bdf9e82'
def install
system "make", "watch", "PKG_LDFLAGS=-Wl"
bin.install "watch"