Skip to content

Instantly share code, notes, and snippets.

View thewoolleyman's full-sized avatar

Chad Woolley thewoolleyman

View GitHub Profile
@thewoolleyman
thewoolleyman / just_started_working
Created October 22, 2010 16:54
mysql_snow_leopard_homebrew_gem_compile_problems.markdown
To follow up, this just "started working". I had introduced an unrelated error with debugging code in mkmf.rb. Once I removed that, everything compiled.
I suspect this (plus a reboot) was the magic fix:
Specified 64-bit arch in boot plist:
$ sudo vi /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
# add: "<string>arch=x86_64</string>"
Change the URL for rubygems_1.3.7_ur in ~/.rvm/config/db to http://rvm.beginrescueend.com/src/rubygems-1.3.7.tgz
and/or download http://rvm.beginrescueend.com/src/rubygems-1.3.7.tgz into ~/.rvm/archives
+++(/home/ubuntu/.boxbuilder/boxbuilder:285): install_rvm_ruby(): echo '
system:
system:
uname: "Linux domU-12-31-38-00-5D-E2 2.6.32-305-ec2 #9-Ubuntu SMP Thu Apr 15 08:05:38 UTC 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.0.14 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"
$ ./subshell_var_passing1 # why is var empty in the subshell?
local output: var=/tmp/aaa var2=/tmp/aaa
subshell output: var= var2=/tmp/aaa
#/usr/bin/env bash
# attempt to mount, unmount, remount, and use centos 5.5 stage2.img on loopback device under centos 5.5
# mirrors.usc.edu/pub/linux/distributions/centos/5.5/os/x86_64/images/stage2.img
$_loopback_device='/dev/loop4'
$_loop_mount='/mnt/loop4'
$_image='/mnt/stage2.img'
$_image_fs_type='squashfs'
/home/centos/.rvm/bin/rvm install 1.8.7-p174
/home/centos/.rvm/rubies/ruby-1.8.7-p174, this may take a while depending on your cpu(s)...
ruby-1.8.7-p174 - #fetching
ruby-1.8.7-p174 - #extracting ruby-1.8.7-p174 to /home/centos/.rvm/src/ruby-1.8.7-p174
Error running '\''bunzip2 < '\''/home/centos/.rvm/archives/ruby-1.8.7-p174.tar.bz2'\'' | tar xf - -C /tmp/rvm_src_6449'\'', please check /home/centos/.rvm/log/ruby-1.8.7-p174/extract.error.log
There has been an error while trying to extract the source. Halting the installation.
There has been an error fetching the ruby interpreter. Halting the installation.
$? was zero after this
thewoolleyman: # export a=1 && eval 'sudo' '/usr/bin/env a=2 echo $a'
[11:26am] evalbot: thewoolleyman: bash: sudo: command not found
[11:26am] sn18: kolpur: because thats not positional parameter
[11:26am] thewoolleyman: why does that print '1' instead of '2'?
[11:26am] yrgd joined the chat room.
[11:26am] taylanub: 'foo=bar echo $foo' won't work because echo itself doesn't expand the variable
[11:27am] taylanub: echo has no clue of variables, the $foo gets turned into what it is in the shell's eyes
[11:27am] thewoolleyman: how is $a getting through the sudo whitelist then?
[11:27am] ampzqlox joined the chat room.
[11:28am] kolpur left the chat room. (Quit: Leaving)
#!/usr/bin/env bash
x=$'a\rb\nc\rd\r\n'
echo 1111111111
sed -n l <<< "$x"
y="$(tr -d $'\r' < <(echo \"$x\") )"
echo 2222222222
sed -n l <<< "$y"
@thewoolleyman
thewoolleyman / heredoc_example
Created August 15, 2010 01:05
heredoc_example
#!/usr/bin/env bash
# heredoc example
# any reason this:
x=$( cat <<LINES
one 1
two 2
LINES
)
echo "$x"