Posts tagged as "mac":
Working with Multiple Repositories on GitHub
Apparently there’s been quite a buzz in the open source community lately about DVCSs in general and Git and Hg in particular. Up until pretty recently (sometime in the past week) I had totally missed the boat on this. However, I spent some time reading about them in a number of places, though apparently Dave Dribin’s writings are the only ones I bookmarked. None-the-less being a good the good little open source developer I pretend to be I thought I ought to at least tinker around with one of them and see what it was all about.
In mostly a snap decision I chose Git, though Linus’ highly entertaining tech talk may have influenced me. Either way, I already had a project I was working on, it isn’t exactly a compelling open source project but I didn’t have it under version control yet and it couldn’t hurt to get it somewhere. So having decided on Git I registered for a GitHub account and created a repository for it. The whole process was simple and easy, no problems there. Basically the premise behind GitHub is like a developer’s social network (well that and free Git repository hosting), you find a project you like and you follow (watch) it or you clone (fork) it. So then I saw John Resig’s tweet that his recently released Processing.js project was being hosted on GitHub and so I decided to fork it, look at the source and play around with it a bit.
The forking process was super easy, one click after being logged in and I had forked his project. No problems there but then I wanted to pull it down to my local machine or clone it so I had a working copy and here’s where I ran into problems. Executing git clone git@github.com:bryanjswift/processing-js.git generated the following output.
Initialized empty Git repository in /Users/.../Projects/processing-js/.git/ ERROR: Permission to bryanjswift/processing-js denied to bryanjswift/bjs-wordpress. fatal: The remote end hung up unexpectedly fetch-pack from 'git@github.com:bryanjswift/processing-js.git' failed.
After a little research I figured out the problem was basically the wrong RSA key was being sent to GitHub and since GitHub uses the RSA key to identify you and determine if you have access to the repository or not my access was being rejected for one or the other of the repositories. Which repository depended on which RSA key was first on the list of the output from ssh-add -l
I could probably have written a pre-hook and post-hook for each of the git repositories I wanted to acess but given the nature of the man who wrote Git I knew there had to be a better solution. So I start digging around and I find a guide to multiple GitHub accounts. I realize this isn’t really the situation I’m in but it does indeed work. I set up an entry in my ~/.ssh/config for each of the two projects each looking something like
Host github-bjs-wordpress User git Hostname github.com IdentityFile /Users/.../.ssh/bjs-wordpress_rsa
Happily this worked once I used the new Host entries as the ssh hosts; so git@github.com:bryanjswift/processing-js.git became git@github-processing-js:bryanjswift/processing-js.git I could now access both my repositories. Hooray! Then I was poking around my account page on GitHub and found I can enter an RSA public key for my account and not just for each repository like I had already done. So I realize my mistake was entering myself as a collaborator on each repository and because I had done it that way I had to create multiple RSA keys for myself (GitHub makes each project collaborator on each project have a unique RSA key) which caused a mess.
How-To: Run Firefox2 and Firefox3 Simultaneously on a Mac
I’ve found a number of step by steps to set this up on a Windows machine, the most in-depth being on Lifehacker. However, I haven’t found a quick one to set up multiple profiles on the Mac.
My reason for wanting to do this was pretty simple; I wanted to be able to play with Firefox3 while still using Firefox2 and the magic of Firebug for debugging and web development. As I knew from the many PC articles I just needed to set up a profile for each browser. Since I already had Firefox2 in my Applications folder (Firefox.app) I opened up terminal and ran /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager which brings up a screen allowing you to manage existing profiles and create new ones it should look something like this…
As you can see I’ve already added the profile, yours will probably only have one profile called default and will have the “Don’t ask at startup” checked. The first thing I did was rename the default profile to Firefox2 (since that is what I already had installed and had been using). Then I created a new profile called Firefox3 and unchecked “Don’t ask at startup”. Easy as pie. After that I renamed Firefox.app in my Applications folder to Firefox2.app, downloaded the Firefox3 beta, copied it to Applications and renamed it to Firefox3.app.
The drawback is that whenever I launch either application it asks me which profile to use and I have to select the profile I want. I probably could edit the actual shell script at /Applications/Firefox2.app/Contents/MacOS/firefox and /Applications/Firefox3.app/Contents/MacOS/firefox respectively and hardcode the -P option in order to avoid this minor hassle but at this point it doesn’t seem worth it.
Update: after realizing I knew how I would do it if I wanted to setup default profiles it really started to bother me that I had to select a profile every time so I tried the method outlined above and it doesn’t work. Well it does if you start Firefox by running the script at /Applications/Firefox3.app/Contents/MacOS/firefox but that’s not what I foresee most people doing.
Stuck To It; Using Stikkit
Recently I’ve been making a lot of use of a site I found a while ago called stikkit. Stikkit is basically a online cork board for post-it notes. At least that is how I’ve come to think about it. So essentially I’m using it for everything from storing links I want to revisit later but don’t necessarily want to bookmark to keeping freelance hours logged.
This process of keeping stikkits up to date and useful is made even easier but a great dashboard widget which uses your api key to access your stikkits in order to display and update them.