Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
pbrisbin / everything.log
Created June 28, 2011 15:10
Disk errors
Jun 28 10:58:45 localhost kernel: [ 1591.698610] ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen
Jun 28 10:58:45 localhost kernel: [ 1591.698615] ata1: SError: { PHYRdyChg }
Jun 28 10:58:45 localhost kernel: [ 1591.698626] ata1: hard resetting link
Jun 28 10:58:51 localhost kernel: [ 1597.520979] ata1: link is slow to respond, please be patient (ready=-19)
Jun 28 10:58:52 localhost kernel: [ 1598.225171] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Jun 28 10:58:53 localhost kernel: [ 1599.421443] ata1.00: configured for UDMA/33
Jun 28 10:58:53 localhost kernel: [ 1599.421456] ata1: EH complete
@pbrisbin
pbrisbin / asound.conf
Created July 1, 2011 22:15
Alsa via oss
# not sure if it works...
pcm.oss {
type oss
device /dev/dsp
}
pcm.!default {
type oss
device /dev/dsp
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module MySite where
import Yesod
import Network.Wai.Handler.Warp (run)
@pbrisbin
pbrisbin / s3.hs
Created July 14, 2011 16:04
Simple getFile and sendFile for Amazon S3 storage
module SimpleS3
( sendFile
, getFile
) where
-- http://hackage.haskell.org/package/hS3
import Network.AWS.AWSConnection
import Network.AWS.S3Object
-- http://hackage.haskell.org/package/wai-app-static
@pbrisbin
pbrisbin / andthen.hs
Created July 18, 2011 14:57
and then
import Data.List (sortBy)
import Data.Ord (comparing)
data Record = Record
{ customer :: String
, item :: String
, qty :: Int
} deriving Show
tableData :: [Record]
@pbrisbin
pbrisbin / threaded_each.rb
Created August 29, 2011 19:05
Array.each where each item is processed in parallel
class Array
def threaded_each &block
results = []
spawned = []
# run block on each item of the array in a separate thread
self.each do |x|
th = Thread.new do
results << block.call(x)
end
@pbrisbin
pbrisbin / output.txt
Created October 19, 2011 13:39
How is tagsoup not broken?
//blue/0/~/ gl tagsoup
/usr/lib/ghc-7.0.3/package.conf.d
/home/patrick/.ghc/x86_64-linux-7.0.3/package.conf.d
tagsoup-0.12.3
//blue/0/~/ cabal info tagsoup | grep deepseq
network -any, process -any, directory -any, deepseq ==1.1.*,
//blue/0/~/ gl deepseq
/usr/lib/ghc-7.0.3/package.conf.d
/home/patrick/.ghc/x86_64-linux-7.0.3/package.conf.d
deepseq-1.2.0.1
@pbrisbin
pbrisbin / gist:1307634
Created October 23, 2011 17:46
trouble installing rvm
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh............
WARNING: found "/usr/lib64", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.
WARNING: found "/usr/lib64", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.
........./home/patrick/.rvm/src/ruby-1.9.3-rc1/ext/tk/extconf.rb:394:in `get_libpath': undefined method `gsub' for nil:NilClass (NoMethodError)
from /home/patrick/.rvm/src/ruby-1.9.3-rc1/ext/tk/extconf.rb:1922:in `<top (required)>'
from ./ext/extmk.rb:174:in `load'
from ./ext/extmk.rb:174:in `extmake'
@pbrisbin
pbrisbin / steps.md
Created December 5, 2011 15:23
Installing ruby-1.8.7 and ree on a system with glibc 2.14

Ruby 1.8.7

rvm install 1.8.7

wait for it to fail

cd .rvm/src/ruby-1.8.7-p352/ext/dl/
ruby mkcallback.rb > callback.func
ruby mkcbtable.rb > cbtable.func

cd

"this is a test of gist-vim
"