AddThis
Wednesday, May 30, 2012
Ruby in Cygwin
I have to write a note to myself b/c I keep forgetting.
When running ruby in cygwin (assuming ruby is installed using the windows installer), don't do:
#!/usr/bin/ruby
instead ruby to the path (using the installer or by hand) and then in the ruby script put:
#!/usr/bin/env ruby
Tuesday, May 29, 2012
Setting up Git with Mac and Windows
The last time I setup a git server, I setup Gitosis on a machine running Ubuntu (can't remember the version for the life of me). But seems like all the hoopla is now with Gitolite, so I decided to try my hand at that.
My challenge this time though, is to set up Gitolite on a Mac running Lion and do it from my Windows 7 machine. Doesn't sound so tough, but there were a couple of gotchas I think worth mentioning here. Let's go through this thing step by step.
Client Side
1. My windows tools IMO are sorely inadequate and the first thing I always do is to install cygwin.Make sure you include vim and open-ssh (and optionally keychain, I think I talk about this in a previous post) packages and whatever else you want.
2. Next go ahead and grab git for windows and install it. Use whatever configurations you want.
3. Open up a cygwin terminal and run
ssh-keygen -t rsa
And optionally set a password when prompted.
4. mkdir ~/.ssh using cygwin if that directory does not already exist
5. vi ~/.ssh/config and put the following:
Host gitolite
HostName your.hostname
User git
IdentityFile ~/.ssh/id_rsa
6. Heres a bit of the trickyness, run the "Git Bash" shell. Now vi ~/.bashrc and put in the following:
export HOME="C:\cygwin\home\USER"
replacing USER with your username of course
Why did we have to do this? The Git Bash for whatever reason decided to put your home directory at '/Users/USER'. Then when git uses ssh to connect to the remote repository, it was looking in the wrong place for the ssh config :(. Changing the home like we did enables git (using ssh) to find the ssh config in the right place.
7. Go ahead and close and reopen your git bash shell. Now let's set some basic git configs:
git config --global user.name 'Jonathan Keam'
git config --global user.email 'your_email@whatever.com'
Server Side
1. Go sit at your Mac and make sure that you have an account (for me it was jkeam, and I'll refer to your user name either as jkeam or USER from here on in) on the machine. Additionally create another user 'git'.2. Ensure they both have remote access.
System Preferences > Sharing > Remote Login
3. Now create a directory where we will install gitolite. (I created a /Library/Source and allowed my git user to have total permission in that directory)
4. cd to said directory and make sure you are now the git user.
5. Lion should have git already installed for you, so go ahead and just:
git clone git://github.com/sitaramc/gitolite
6. Run ./gitolite/install
Client Side
1. Sucks I know, we have to go back to the client. But from here runscp ~/.ssh/id_rsa.pub jkeam@mac-host:~/jkeam.pub
replace jkeam with yourself (in both places, before the @ and before the .pub) and mac-host with the real hostname of the mac
Server Side
1. Ensuring that you're still the git user, run/Library/Source/gitolite/src/gitolite setup -pk ~/.jkeam.pub
This installs your public key as the key to be used for the gitolite admin.
Client Side
1. Now the test. Run:git clone gitolite@gitolite-admin
This is the special gitolite that we setup in our config from step 5 from the first client setup. This is a must because otherwise you would get this error.
2. From here you should have gotten the special repository where configuration settings can be made.
vi gitolite-admin/conf/gitlite.conf
and add whatever repos and users you want. For more, info click the link.
3. After adding the repos and users in the conf file, you can simply clone them and there they are.
Hopefully this wasn't too confusing and works for you!
Thursday, May 24, 2012
Codeschool's in Session
I was recently introduced with Codeschool and have fallen in love with it. For those of you who don't know, codeschool is a neat way of learning some fun stuff interactively...as in, you get a nice looking console thing in the browser where you can actually hack out some code. Granted, you don't get total freedom, and the code you see is always based around a challenge/problem that you need to solve. But this is fine as the challenge is based on some video tutorial that serves as a fun lecture.
Check them out!
And for fun, heres my profile.
Check them out!
And for fun, heres my profile.
Wednesday, May 16, 2012
Checking in
I haven't posted in years...ok hyperbole, maybe only a month. But feels like years. Guess I been busy?? Doing all sorts of randomness. Diablo 3 came out just a few hours ago. That's pretty big. I'm scared to get it lest I lose my life in it haha.
But I stumbled upon this interesting post on Dart, a very curious language, that forever whatever reason has gained 0 followers (hyberbole again).
Someone's Dart thoughts
But I stumbled upon this interesting post on Dart, a very curious language, that forever whatever reason has gained 0 followers (hyberbole again).
Someone's Dart thoughts
Friday, April 6, 2012
Bash the Bashrc
So I messed up my bashrc. I forgot exactly what I did, but when I logged in, my shell would crash. ARG!! So I had to somehow log in and fix it, even though logging in was the problem to begin with. Searching the interwebs revealed a few solutions, but the one that worked was:
ssh jkeam@host -t "bash --noprofile --norc"
ssh jkeam@host -t "bash --noprofile --norc"
Monday, December 12, 2011
Ah The Holidays, The Perfect Time For Gingerbread
I just got the update for gingerbread. Wow, only a year late. But here's a nice list of features that I'm excited about:
User features
- New on-screen keyboard. The standard keyboard has been greatly improved in Android 2.3, with faster input and more intuitive typing. Even cut-and-paste got a makeover.
- Streamlined user interface. New color schemes and various UI changes and polish make Android more consistent and simpler to use.
- Application and power management. Android 2.3 provides better insight into what is running in the background, how much memory and CPU time it is using, and even lets you kill misbehaving apps. Yes, after months of telling us we don’t need a task killer, they give us a task killer. Enjoy your chuckle, iPhone fans.
- SIP Internet calling. Voice over IP is integrated directly into Android 2.3. Unfortunately you’ll have to get a SIP account from a third party, and the ability might be curtailed on some carriers.
- Download management. All your downloads from your browser, email, and other apps, can now be viewed and controlled from one place.
Developer features
- Native development. The ability to write Android programs or parts of programs isn’t new but in Android 2.3 it gets a huge boost with Release 5 of the Native Development Kit (NDK). For example you can now receive input and sensor events, produce sound, manipulate 3D graphics contexts, access assets and storage, and more all from native code. They even added a NativeActivity class that lets you write your lifecycle callbacks in native code.
- JVM speed. For Java developers, 2.3 adds a number of speedups, most notably a concurrent garbage collector. According to Google garbage collection pauses will be under 3ms, which is small enough not to be noticed in a 30fps or even 60fps game. New JIT optimizations make Dalvik code run even faster than before.
- Faster event distribution. In previous versions of Android, just holding your finger down on the screen would cause whatever program was running to slow down, sometimes dramatically. This is all fixed in Android 2.3.
- Multimedia. Rich audio effects like reverb and headphone virtualization can be applied to local tracks or globally across multiple tracks. The platform adds built-in support for VP8/WebM video, plus AAC and AMR wideband encoding. Also, there are now official APIs for accessing the front and rear cameras. There is some limited support for extra large (tablet and TV) displays.
- Near Field Communications (NFC). In Japan, NFC is a Big Deal, and the hope is that it will catch on in the rest of the world too. It has all kinds of uses, for example with the right hardware and software you could use your phone as a replacement for your credit card to make point of sale purchases. Using the NFC API apps can respond to NFC tags embedded in stockers, posters, and even other devices.
*note: The above is from: http://www.zdnet.com/blog/burnette/top-10-features-in-android-23-gingerbread/2143
Being able to use the updated api and the JIT optimizations are the parts that excite me most. Woot woot!
Labels:
android,
gingerbread
Friday, November 18, 2011
New Old iPhone 4G
I recently got a new iPhone 4. Ok, it was my girlfriends iPhone to be exact, so it's not really new. But heres the problem I ran into. I had previously used my MacBook Pro to sync and backup her phone. Now that it was mine, I wanted to back it up fresh. So I wiped out the iPhone using the restore, but everytime I plugged it into the computer, it would automatically start syncing and restoring all of her apps! Frustrating.
But alas, there was a solution. I had to create a new library for iTunes to use separate from my girlfriends. On the Mac all I had to do was hold down the "option" key when I opened up iTunes and this allowed me to pick the directory that I wanted iTunes to use for its library. I created a new directory called "Jon's iTunes" and simply selected that. All of her stuff is not in the library so now its as if my girlfriend never even had the phone. Excellent!
But alas, there was a solution. I had to create a new library for iTunes to use separate from my girlfriends. On the Mac all I had to do was hold down the "option" key when I opened up iTunes and this allowed me to pick the directory that I wanted iTunes to use for its library. I created a new directory called "Jon's iTunes" and simply selected that. All of her stuff is not in the library so now its as if my girlfriend never even had the phone. Excellent!
Subscribe to:
Posts (Atom)