Setting up a new Mac for development
a-w.me
a-w.me
> ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Please stop doing this. I looked at the script and I know it looks fine but piping a raw curl into a shell interpreter is just a bad practice. Unfortunately, it seems to be more and more common as time goes on.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"If you're just downloading homebrew and running an install script by hand without reading it (as, honestly, I usually do), there's no difference.
For one thing, the script is coming over http, so it's trivial to intercept and replace the content, perhaps even silently so you get the original content plus a few extra box owning goodies. Two, as a .sh script, its self-selecting in terms of what system the binary executable has to be written for. Also, it's typically not as easy to escalate privileges in an executable as it is in an arbitrary shells script.
vs
curl -o install foo.com/bar && chmod a+x install && ./install
The script is an open source installer, the binary is hidden/closed. You and others at least have the option to inspect it.
The binary would also be coming over http (https is clearly preferred for binaries or scripts). A binary can always embed a script and do a 'system' call to execute any script-available privilege escalation.
I'm not sure what you mean by "as a .sh script, its self-selecting in terms of what system the binary executable has to be written for". I think you mean that a single .sh script can target multiple platforms. That doesn't mean a binary is any safer for you to download and execute on your system.
This is more like executing the current text of a web site (whatever that is) in a totally ephemeral way. That gives total plausible deniability to anyone who would serve you a particular version based on your IP, for example.... (or anything else). You're just not keeping the evidence.
I mean, you "could". But doing things this way, you're not...
And before I come off as a paranoid nut; yes I have a virus-scanner on OSX. No, I don't usually use it unless something piques my curiosity (or I'm on my employers network. Their house, their rules). But that said, I've never had my house broken into, but I still lock my door.
But for the specific examples in the article;
- Homebrew, I trust. If I'm going to trust them to patch & build every app it installs, I may as well trust their distribution mechanism.
- Dropbox, by blindly running a script from some third-party website I've never heard of? I'd rather go to dropbox.com and hit the download link.
And here's to all replies that say it's as secure as a package: it's only partly about security.
The other part is version control. I can install a specific version of an RPM relatively easily, but wget|sh approach makes it much more inconvenient. One day it does one thing, the next day it may do something completely different. Even if I install on 2 machines, there's no guaranty that the repo owner won't push changes in the meantime.
There are ways to change the keyboard home/end key without needing an app to download. For example, a bit of Google instead yields:
$ cd ~/Library
$ mkdir KeyBindings
$ cd KeyBindings
$ nano DefaultKeyBinding.dict
Put these lines in that file, including the curly braces:
{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
}
(from Matt: http://mwholt.blogspot.co.at/2012/09/fix-home-and-end-keys-o...)Why require a third-party to do such things, developers?
And also, umm .. dotfiles, kidz? Really, just like that? wtf. Please do not encourage such glib attitudes in an article intended for 'quick action', but rather .. dissect the thing. A collection of links with explanatory text is one thing.. Take some time, this isn't homework. Dig deeper.
(+todo: grep -ir ".dict" this_article_suites_.x//)
only when correct == "Windows Convention"
Home and End keys on the Mac (on applications which don't override default behaviour for these keys) are conventionally the same as old UNIX - they take you to the beginning and end of the document and not the beginning and end of the line (as on Windows).
a) cmd-left arrow for beginning and cmd-right arrow for end of the line.
b)emacs key bindings are available as well control-a and control-e for the beginning and end of a line.
Option a) gets slightly complicated in text entry on edit controls of browsers which have the cmd-left arrow key mapped to previous page (Firefox). In addition, a lot of multiplatform software ends up making things behave like on Windows ( Microsoft Office being one) by overriding defaults for these keys and home and end keys do take you to the beginning and end of the line there.
So I'm quite happy knowing how to bend the computer to my will and not the other way around.
(I am ambivalent if I want to do that kind of work. I love my iPad and want to develop for it, but the frameworks are a little too close to Java with the 30++ chars long names everywhere. :-( )
I generally use external screens with a laptop anyway, as long as I don't sit in a coffee shop or something. (I did some work with my late-2008 13" Macbook. Yeah, 1280 is too little.)
You did answer my specific question: I need a 15" rMBP (and/)or a setup with external screen(s) (i.e. not mobile). In 4-8 months, when I should have more time.
(As an Emacs user it took me hours mostly watching lecture videos to learn how to use that damn IDE with the differing sets of windows and buttons.)
The definitive guide to setting up a new mac for [python, ruby, node, mongo] development
...or The definitive guide to setting up a new mac for development [with python, ruby, node, mongo]
...since I use my mac for "development", but I don't develop with nearly any of the languages/tools/packages listed, and almost none of the tools that I do use are listed in this article. In fact, the only tool that I actually do use, which gets any mention at all is Xcode?Your new Mac is powerful enough to run multiple Vagrant boxes simultaneously, with all the tools you need and a near perfect simulation of your target platform.
Use some good provisioning software (Ansible is awesome) to manage them, and you're set. All you have to do for OSX is pick your favorite IDE.
Or alternatively, don't use OSX (or Windows), and get a machine that runs Linux so you can have everything just the way you want/need it.
Everything else is just hobbyism, and as fun and educational as it may be, I'm wary of developers that waste time on their primary development tools. Sooner or later it becomes a horrible mess.
I've always been in favor of letting devs use any tool they like, but developers wasting days on getting version X of package Y to run on their Windows / OSX box when everyone else just does "apt-get upgrade" on their (virtual) machine doesn't fill me with confidence in their ability to solve problems effectively.
The problems that I've run into in the past are typically subtle, but they're almost always show stoppers (either on the development side or the production side).
That said, my current environment is on a mac while my production is on EL6, but my next one will not be. The up front cost to get a DB and nginx running properly is just not worth the effort to do again.
Bash is 6 years old on the Mac. For the most part, bash 3.2 is fine, but it's at the point where I have to work with other people's bash 4.x scripts locally that no longer work. If this sorry state of command line utilities support from apple keeps up, I'm going to have to switch back to Linux soon.
A bit more on this, I actually just asked a question on stackoverflow ( http://stackoverflow.com/questions/19642059/proper-way-to-in... ) about installing bash 4.2 on Mavericks because it hasn't been working so far. If anyone has any insight on this, I'd greatly appreciate it.
One of goodies I found around: http://carpeaqua.com/2012/10/15/my-ultimate-developer-and-po...
This is less a definitive guide and more a list of some useful tools you like. :)
I rather chase any minor issues Brew creates than clean up the mess MacPorts once created..
I use BBEdit, oh-my-zsh, Vagrant, VMWare, Django, virtualenvwrapper, Selenium IDE, Python's selenium, lib::local, Puppet, Sequel Pro, OmniGraffle, Jira, Stash, git, Mercurial, SURFRAW, psman and a few other tools on a daily basis.
The article did point out Dash to me, and for that I am thankful.
I'm pretty happy developing on the mac itself. I guess it depends what you do.
chmod +a 'user:YOUR_NAME_HERE allow add_subdirectory,add_file,delete_child,directory_inherit' /usr/local