I tried simply making a soft link to the folders I wanted sync'd on my drives and it turns out that it works just fine.
mklink /D "C:\SkyDrive\MyFolder" "C:\SomeLocation\MyFolder"
You need to be running a command shell with Administrative privileges before you execute that.
The example above presumes that your SkyDrive folder doesn't already have a "MyFolder" link or folder in it, and when it runs, a soft symbolic link will be created in the SkyDrive folder that resolves to the actual folder location outside of the SkyDrive.
I currently share files between two PCs and an OSX box (yes, SkyDrive is on OSX too) this way before they qualify to be put into source control...
Thursday, January 9, 2014
SkyDrive is a pretty cool free app with a fair amount of free storage, but I really don't want to sync files by dumping them in the SkyDrive folder - so...
Friday, March 4, 2011
AppleScript to add a 'new file' capability to Finder
Another convenience function you may wish to add to a button in your Finder toolbar is a 'new file' button that will deposit a blank file named 'NewFile' in the current Finder window directory. It also auto increments a counter if needed to ensure the new file doesn't overwrite an existing file. The code is below:
tell application "Finder"
#Create filename (avoid overwriting)
set current_path to (POSIX path of (the folder of the front window as text))
set good_filename to false
set loop_count to 0
repeat while good_filename is false
if loop_count is equal to 0 then
set NewFileName to (current_path & "/NewFile")
else
set NewFileName to (current_path & "/NewFile" & loop_count)
end if
if exists NewFileName as POSIX file then
else
do shell script "touch " & NewFileName
set good_filename to true
end if
set loop_count to (loop_count + 1)
end repeat
end tell
Posted by
Hans
0
comments
Labels: AppleScript, Finder, OSX
Add full path to title bar of Finder
Very simple, from the terminal:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Then in the terminal, to affect the change in your open Finder windows:
killall Finder
To revert, change YES to NO
(Btw, you can have a more UI oriented path shown by choosing View|Show Path Bar for the Finder but I find it easier to view the path in the title bar since I spend a lot of time in *nix)
This works in 10.6.6 but I'm not sure what other OSX versions it works on.
Posted by
Hans
0
comments
Thursday, March 3, 2011
Very cool feature of OSX to make up for uncool features...
The Finder in OSX is okay for the most part; however, Apple can be a strange mix of the 'well designed UI' approach and the 'keyboard shortcuts rule' approach. Often these approaches complement each other well - sometimes they do not.
One of the things about the Finder I don't like is that there's no path bar or button for simply letting you designate a path. I discovered that there is a 'Go To Folder' shortcut (command-shift-g) which proffers a little dialog box that I can do this with but there's no integrated path bar.
This is certainly an acceptable (mostly) alternative, but I really don't want to have to remember another intermittently used keyboard shortcut (I have several IDE's, Emacs, and different operating systems worth of shortcuts to remember as well, so one less would be nice.)
It turns out, very nicely, that you can add custom buttons to the Finder window simply by dragging an application onto the Finder's toolbar. So, I created a little AppleScript application that simply emitted command-shift-g to most recent finder window, and I gave it an icon. Now my finder window has a little terminal icon (I'll replace the icon later when I have more time) where I can click and it pops up a path dialog to change directories as seen below:
It is the little square black icon just to the right of middle.
Now, to do the same thing you need to open the AppleScript Editor and add the following text to your empty script:
tell application "Finder"
activate
tell application "System Events" to keystroke "g" using {command down, shift down}
end tell

Open a Finder window if one isn't already open and then tell the AppleScript Editor to run the script to verify that it is functioning as expected.
You now want to save the script as an Application - I saved my script into my Applications folder accordingly (you can do what you like.)
Now, you can skip this step if you wish, but I wanted a custom icon (instead of the default script icon) as my button in the Finder window so I found an image that I wanted to use (after looking for about 8 seconds) and opened it. I then selected the portion of the image I wanted and chose 'Copy' (you can use the preview window for this or some other image viewing/editing application.) This placed the image I wanted to use on the clipboard.
In order to change the icon on OSX 10.6.6 I then located the script application and brought up the 'Get Info' dialog on it. I then clicked on the application's icon in the upper left hand corner of the Get Info dialog so that it was selected, I then pasted the clipboard contents which deposited the image into the icon.
The last step is to simply open a Finder window and then drag the application from where you have located it onto the Finder's toolbar and it should appear.
Posted by
Hans
0
comments
Monday, February 28, 2011
OSX 10.6.5 update breaks apachectl script
If you're wanting to manipulate Apache via the apachectl script, OSX 10.6.5 apparently changed a line in the script in such a fashion that it no longer functions.
In the interest of brevity I simply recommend what others have suggested, change the line:
ULIMIT_MAX_FILES="ulimit -S -n 'ulimit -H -n'"
To simply be:
ULIMIT_MAX_FILES=""
If you need greater control of the directive, knock yourself out :)
Posted by
Hans
0
comments
Labels: apache, apachectl, OSX, osx 10.6.5
Thursday, February 24, 2011
Parallels and PRL_ERR_DISK_GPT_MBR_NOT_EQUAL
This should help out some poor b**tard like me... I installed Parallels today to give it a spin because I heard that you can now run a virtual machine directly off your Boot Camp partition (ergo I can run pure Windows like I need to in order to properly test software, and I can run the very same partition as a virtual machine in OSX.)
Well, as usual, I ran into some hiccups; however, this time the hiccups were from something I'd done (but still shouldn't have been hiccups really.
For some reason, when I tried to get Parallels to use my Boot Camp partition, I was getting a 'cannot configure the boot camp partition' error and when I looked at the details I received a very mysterious PRL_ERR_DISK_GPT_MBR_NOT_EQUAL error.
Looking at this error suggests there some sort of problem with the GPT and the MBR (if you don't know what these are you aren't ready for this post, wikipedia is your friend) where something was not what someone expected.
Well, I know that after creating my Boot Camp partition in OSX that I'd messed around with that partition space in Windows 7 to create and extended partition by shrinking the Boot Camp partition. OSX didn't seem to care about this and was quite happy to mount the partitions for read only access. Well, it turns out that Parallels cares about this a lot and when it looks at the GPT to see what the MBR should be it throws up because the GPT states that the end of the Boot Camp partition is something it is not.
Sooooo... Long story short, it turns out I'm lucky that I'm using reFIT to handle my multi-boot system because when reFIT starts up you can run a little utility called gptsync (choose 'run partition tool' from the reFIT boot menu) which apparently will square up what is stated in the GPT with what is stated in the MBR (technically it modifies the MBR so be careful.)
BTW, gptsync doesn't handle extended partitions so I had to move all of that data onto the main Boot Camp partition and delete the partition then re-extend the Boot Camp partition over that space so it resembled what OSX remembered from earlier - then I could run gptsync.
Booting OSX and running Parallels at this point worked fine. As an aside, I was wondering if this was a Parallels limitation but it turned out to be a problem (again with virtually no intelligent description) for VMWare's Fusion 3.1 as well.
Hope this helps somebody! :)
UPDATE: Don't forget, both in VMWare Fusion and Parallels, to delete any previous virtual machine you had tried to make using that Boot Camp partition because it has erroneous GPT data - start with a fresh virtual machine.
Posted by
Hans
3
comments
Labels: Boot Camp, gptsync, OSX, Parallels, reFIT, VMWare Fusion
Saturday, February 19, 2011
Home and End keys in most editors for OSX
http://www.starryhope.com/tech/apple/2006/keyfixer/
God bless that guy, I really didn't want to create a custom keybinding dictionary. Works for my Ergonomic 7000. 'Nuff said.
Posted by
Hans
0
comments
Labels: Apple, key bindings, keyboard, OSX
