Skip to content

Instantly share code, notes, and snippets.

View indirect's full-sized avatar

André Arko indirect

View GitHub Profile
[andre /usr/local]$ sudo mkdir Rubygems
[andre /usr/local]$ sudo chown andre:staff Rubygems/
[andre /usr/local]$ export GEM_HOME=/usr/local/Rubygems
[andre /usr/local]$ export PATH=/usr/local/Rubygems/bin:$PATH
# now you can install gems to /usr/local/Rubygems without sudo
[andre /usr/local]$ gem install oniguruma -- --with-onig=/usr/local
Building native extensions. This could take a while...
Successfully installed oniguruma-1.1.0
1 gem installed
@indirect
indirect / source.rake
Created September 29, 2009 18:47
rake tasks to fix whitespace
def find_and_replace_in_source_files(find, replace)
extensions = %w[.rhtml .rxml .erb .builder .rb .css .js .rake]
files = Dir["**/*"]
files.each do |file_name|
next if (file_name =~ /^vendor/) || !extensions.include?(File.extname(file_name))
text = File.open(file_name, 'r'){ |file| file.read }
changed = text.gsub!(find, replace)
File.open(file_name, 'w'){|file| file.write(changed)} if changed
end
[andre /Volumes/Wesabe/pfc](r996)$ file /usr/bin/ruby
/usr/bin/ruby: Mach-O universal binary with 3 architectures
/usr/bin/ruby (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/ruby (for architecture i386): Mach-O executable i386
/usr/bin/ruby (for architecture ppc7400): Mach-O executable ppc
[andre ~/sw/homebrew](ruby-readline)$ brew install readline
==> Downloading ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz
File already downloaded and cached
==> Patching
patching file support/shobj-conf
Hunk #1 succeeded at 152 with fuzz 2.
==> ./configure --prefix=/usr/local/Cellar/readline/6.0 --mandir=/usr/local/Cellar/readline/6.0/share/man --infodir=/usr/local/Cellar/readli
==> make install
==> Caveats
readline is keg-only. This means it is not symlinked into Homebrew's
[andre ~/sw/homebrew](ruby-readline)$ brew install readline -d -v
==> Build Environment
CFLAGS: -O3 -march=core2 -m64 -mmmx -msse4.1 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.6
LDFLAGS: -arch x86_64
MAKEFLAGS: -j2
Formula already installed: /usr/local/Cellar/readline/6.0
==> Kernel.exit
[andre /private/tmp/homebrew-ruby-readline-v1_8_7_72-RbGv]$ gcc test.c
Undefined symbols:
"_readline", referenced from:
_main in ccXnDbsC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
[andre /private/tmp/homebrew-ruby-readline-v1_8_7_72-RbGv]$ gcc -lreadline test.c
[andre /private/tmp/homebrew-ruby-readline-v1_8_7_72-RbGv]$ ./a.out
Segmentation fault
Format Mode Description
-------------------------------------------------------------------------------
A* rw+ Raw alpha samples
AI rw- Adobe Illustrator CS2
ART* rw- PFS: 1st Publisher Clip Art
ARW r-- Sony Alpha Raw Image Format
AVI* r-- Microsoft Audio/Visual Interleaved
AVS* rw+ AVS X image
B* rw+ Raw blue samples
BGR* rw+ Raw blue, green, and red samples
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/base.rb:2077:in `sanitize_sql'
from /Volumes/Wesabe/pfc/config/initializers/active_record_retry_once.rb:5:in `execute'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/mysql_adapter.rb:561:in `configure_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/mysql_adapter.rb:552:in `connect'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/mysql_adapter.rb:199:in `initialize'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/mysql_adapter.rb:74:in `new'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/mysql_adapter.rb:74:in `mysql_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
@indirect
indirect / com.mysql.mysqld.plist
Created December 4, 2009 19:41
mysql binary launchd plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/usr/local/mysql/bin/mysqld_safe</string>
@indirect
indirect / snippet.rb
Created January 29, 2010 18:27
.screenrc
# Invoke screen with:
# /usr/bin/screen -xRR -S main -p bash
# '-xRR -S main' -- force join (or create) session named main
# '-p bash' -- open new screens to a window named bash, if one exists
## Screen Options ##
shell -/bin/bash # Tell screen your default shell. - makes bash read .profile
startup_message off # Turn off start message
msgwait 1 # Set messages timeout to one second
nethack on # Turn on nethack error messages