Skip to content

Instantly share code, notes, and snippets.

@mxcl
Created March 6, 2010 15:14
Show Gist options
  • Save mxcl/323731 to your computer and use it in GitHub Desktop.
Save mxcl/323731 to your computer and use it in GitHub Desktop.
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
@adamv
Copy link

adamv commented Jan 17, 2012

Fabric is a Python-based ssh automation thingy: https://github.com/fabric/fabric

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

I wonder if there is any good reason I didn't use gets in the first place. I imagine there must be. It's not the kind of thing I'd do otherwise. Shame I didn't have the foresight to comment it :P

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

Aah. It's because of UX. if you press any other key it should immediately exit. gets requires you to press enter, which makes ineffective for the exit option for the instruction "Press enter to continue".

@halcyonCorsair
Copy link

Ok. In my quick tests, I'm getting

>> STDIN.getbyte

=> 10
>> 10.chr
=> "\n"
>> 13.chr
=> "\r"

Can we change the line to be:

i = getc
abort unless i == 13 or i == 13

Or am I off my rocker here?

@mxcl
Copy link
Author

mxcl commented Jan 18, 2012

Can we get an explanation of why it doesn't work so we can fix it more effectively?

@halcyonCorsair
Copy link

Oops, 2am typo there, what I meant was...

i = getc
abort unless i == 10 or i == 13

I have no idea why \r is getting sent instead of \n for me.

@mxcl
Copy link
Author

mxcl commented Jan 18, 2012

Modified. Thanks.

@sinisterchipmunk
Copy link

Pull request: http://gist.github.com/1836995
Changed shebang to #!/usr/bin/env ruby so other rubies can be used (in case user has removed the default system ruby)

@nhooey
Copy link

nhooey commented Feb 21, 2012

Ideally instead of saying "use su", this script should say "su to a non-root admin user". It got me confused when it said to just use su, and then said "don't run this as root".

@mxcl
Copy link
Author

mxcl commented Feb 21, 2012

I'll remove the su, bit. Since apparently people don't realise what it means. Nobody understands unix anymore.

@nhooey
Copy link

nhooey commented Feb 21, 2012

I understand Unix and it confused me.

The script says:

If you still want to use this script set your user to be an Administrator in System Preferences or `su'.

It should be more specific and say to su as an administrator user. I figured that root was effectively an administrator, because I'm new to MacOS. The language just isn't precise.

@mxcl
Copy link
Author

mxcl commented Feb 21, 2012

I have amended it as you suggested. Thanks.

@duksis
Copy link

duksis commented Jan 4, 2013

Link to wrong url -> new url raw.github.com/mxcl/homebrew/go

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

@sdaitzman
Copy link

Broken link D:

Copy link

ghost commented Oct 27, 2014

@GraniteConsultingReviews

Broken link

@sameer333
Copy link

use command
adduser bob
su - bob
and then run
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment