Posts Tagged ‘osx’

Ease Switching Between OS X and Linux Environments for Development

Saturday, May 7th, 2011

As I may have pointed out in a previous post, I’ve switched all my non-server computers over to OSX. My desktop is OSX and dual boots Windows (for very few things). My latptop, my development machine, dual boots OSX and Linux. Each instance of OSX has Virtual Box and Windows XP as well as Linux, the mentality that for simple Windows and Linux things where OSX wouldn’t/couldn’t work, I can use a VM. For 99% of the time, that works. Ultimately I switch into the secondary OSes only when I need to access the hardware natively.

One issue I’d run into switching between OSX and Linux for development  - and one thing that really bothered me – is OSX’s home directory is /Users while any Linux box is /home. Call me lazy for not having a better way to manage configuration files but I didn’t want to manage configuration files. I finally decided that my OSX box should probably match my Linux box in terms of directory structure, at least superficially. I backed up the current /home directory on OSX and created a symlink to /Users so that /home -> /Users.

I don’t know if this is a bad thing or not, so try this at your own risk, but so far for me, I like it. I don’t know what’s taken me so long to do this.

These commands backup your current /home to /home_bkup, in case you ever need it again. Why? I don’t know.

cd /
 sudo mv home/ home_bkup

This creates the symlink.

 sudo ln -s /Users/ /home

Linux, Runtime.getRuntime().exec(…) and quotes

Monday, November 15th, 2010
String command = "java -jar \"/path/to/some/jar/foo.jar\"";

Here is an interesting problem I ran into while doing some work: why is Runtime.getRuntime().exec(command) reporting that it couldn’t access a jar file I was directly trying to invoke in code on Linux but worked no problem on Windows? The generated command was identical on Windows and Linux and copying the command and running it in a terminal executed as it should. WHY  DO YOU HATE ME JAVA AND LINUX?

Turns out that it was really only Java hating on me. After playing around with the command, I finally figured out that removing the quotes around the jar path fixed it:

String command = "java -jar /path/to/some/jar/foo.jar";

worked but

String command = "java -jar \"/path/to/some/jar/foo.jar\"";

didn’t.

So what is going on?
(more…)

OS X Failure: Mounting Via Shell (Updated)

Tuesday, June 30th, 2009

No I am not dead and I am back with a Mac. So how about that? I definitely (probably said this before) want to get back into blogging but I ran into something tonight that is pretty irritating. So much so that I had to fire up the ol’ blog account and get to writing.
Now, I’m pretty sure I’m doing something wrong here but none the less I want to post this up and (hopefully) get some input on the situation. Here’s the deal. I want to mount (via Samba on an Ubuntu box named ubuntu1) a shared directory that is named test. I want to mount it in a directory inside my home in a directory named “test” on OS X. Why is it such a problem? Is it even possible to mount a Samba share this way? Note that /Users/mike/test exists but /Users/mike/test1/ doesn’t.
(more…)