For a long time, creating custom networks in VmWare Fusion has been a challenge. For some bizarre reason, for years Fusion lacked the network-management GUI commonly found in the equivalent VmWare Workstation product for Windows.
Since switching to OSX last year I've had to edit each VMX file, forcing interfaces to use a custom network definition, but I've recently come across a lovely tool that greatly simplifies this task AND finally clarified for me how Fusion stores network definitions.
This tool is UBER Network Fuser, by Nicholas Weaver. It was released in 2012 when he wasn't working at VmWare yet, and it's not been updated since -- likely because Fusion 6 now offers similar functionality in the twice-as-expensive Professional version (which I think is ridiculous -- Workstation comes in one version with all features, why does the overall-less-powerful OSX equivalent have two?) but it still runs fine on OSX 10.8.5 Mountain Lion.
The tool itself is really easy to use: just go to the Networks tab to add or edit subnets, specifying whether you want to use the Fusion-provided dhcp and NAT services and to run through a virtual adapter. For some reason it won't allow you to customise subnets (you get a random 192.168.x.x net with mask 255.255.255.0), but that can be hacked-in as I'll show you later.
Next, go to the Configuration tab and click on the path to your Virtual Machines (which might already look correct, but won't work until you actually set it yourself). Leave the Preferences Path alone.
Now go to the Virtual Machines tab, refresh the list, select a machine to edit, select the interface you want to assign to your custom network, and select the network. Done!
This is already a nice set of features, but the real kicker is still to come. Close the tool, start Fusion, edit another image, select your network adapter, scroll the option list… your custom network is now an option for all machines! This is because Fusion stores network definitions in /Library/Preferences/VMware Fusion/networking - open it with a text editor and you'll see it contains old and new network definitions. UBERNF manipulates this file, and Fusion is happy to go along with it. You could just change subnet values here, I believe.
Unfortunately Nicholas didn't release any source code for UBERNF (I wouldn't be surprised if some of it ended up in Fusion Professional, to be honest), so there is no way to improve it or even just fix little defects that are probably due to OSX changes between 10.7 / Lion (the version he compiled it on) and 10.8 / Mountain Lion. It would be nice if somebody could write a similar app for Mountain Lion / Mavericks and release it as open-source, or simply charging a few dollars less than the difference in cost between Fusion Standard and Professional. Silly, silly VmWare...
02 November 2013
16 September 2013
Character shifting "encryption" in Windows program -- any idea...?
I could do with some help on this StackOverflow question I just posted. It's one for Windows programmers and/or amateur codebreakers.
21 July 2013
How to make pull requests on GitHub or BitBucket
Github and Bitbucket make it very easy to submit pull requests; probably too easy, in fact. The temptation to just fork somebody's repo, fix the obvious mistake and submit a pull request is quite strong. But that's not how you're supposed to work! So this is basically a dummy's guide to mark this procedure into my brain.
A pull requests marries the entire branch to the one you're targeting; if you keep making changes here and there, a pull request will include all these new changes, regardless of when you originally opened it. It makes your request basically un-mergeable by upstream repositories, in most cases.
So the real procedure is:
A pull requests marries the entire branch to the one you're targeting; if you keep making changes here and there, a pull request will include all these new changes, regardless of when you originally opened it. It makes your request basically un-mergeable by upstream repositories, in most cases.
So the real procedure is:
- Fork the upstream repository. Now you have your own master branch. Clone it locally as usual.
- Create a new branch, either via web or (easier) from the command line with git branch FixBugBranch && git checkout -b FixBugBranch.
- Make your changes on this FixBugBranch. Make only the minimum amount of changes necessary to fix a specific issue, then commit and push.
- On GitHub, create a pull request from FixBugBranch towards the original repository
- When/if your pull request is accepted upstream, you can delete FixBugBranch.
If you want to make further changes, you can either create a further branch from FixBugBranch, or create and merge a pull request from FixBugBranch into your master. The important thing is that you don't touch FixBugBranch anymore, so that upstream maintainers won't receive all your extra commits but only ones relevant to the particular bug you raised.
18 July 2013
Unicode URL-handling in web.py
Web.py is a lovely tool I'm currently using for a silly project (warning: explicit Italian language). Unfortunately, it does some clever things to support URLs containing Unicode, but then drops the ball when it comes to actually do anything with them (i.e. dispatch/route them as expected, using regular expressions that actually match Unicode objects).
This was a real problem in my app, so I came up with a quick and dirty patch, which may or may not work for you and may or may not break other things. Basically I've tracked down the regex operations on URLs, and added Python's re.UNICODE flag to them, so that unicode characters will be matched as "\w" etc.
Feel free to tell me where I'm going wrong -- I'm not a web.py guru by all means -- but this little patch significantly improved my quality of life today, so to speak.
This was a real problem in my app, so I came up with a quick and dirty patch, which may or may not work for you and may or may not break other things. Basically I've tracked down the regex operations on URLs, and added Python's re.UNICODE flag to them, so that unicode characters will be matched as "\w" etc.
Feel free to tell me where I'm going wrong -- I'm not a web.py guru by all means -- but this little patch significantly improved my quality of life today, so to speak.
11 July 2013
Safari extension to show XML
A few months ago I started using Safari for most of my browsing, because I love trackpad gestures and I'm a sucker for smooth animations. However, if there's one thing that Safari gets spectacularly wrong, it's dealing with XML. As far as I know, in Safari 6.x there is no way to display raw XML, the damn browser will always try to launch an external feedreader, and even selecting which feedreader requires industrious hacking that I'd rather avoid. This is particularly annoying when some memory-hungry, battery-burning giant application hijacks this process: in my case, VmWare Fusion will always try to launch one of my images, which is just terrible.
To cut the story short, I wrote a small extension to prevent this horrible process. When I want to have a look at an XML file, I right-click on the link and select "Show me that feed". The result is a slightly-formatted view of the file, in a new tab.
You can download the ShowMeThatFeed Safari extension on BitBucket.
I haven't been a web-plumber for more than 10 years now, so I'm sure it can be dramatically improved -- the formatting in particular is implemented with regexes (argh). Please feel free to fork the BitBucket repository for ShowMeThatFeed, pull requests are very welcome.
UPDATE: Apologies, I've pushed quite a few updates (included some buggy ones!) in the last few hours, but now it should work fine.
To cut the story short, I wrote a small extension to prevent this horrible process. When I want to have a look at an XML file, I right-click on the link and select "Show me that feed". The result is a slightly-formatted view of the file, in a new tab.
You can download the ShowMeThatFeed Safari extension on BitBucket.
I haven't been a web-plumber for more than 10 years now, so I'm sure it can be dramatically improved -- the formatting in particular is implemented with regexes (argh). Please feel free to fork the BitBucket repository for ShowMeThatFeed, pull requests are very welcome.
UPDATE: Apologies, I've pushed quite a few updates (included some buggy ones!) in the last few hours, but now it should work fine.
Labels:
GeekDiary,
mac,
OSX,
rss,
safari,
safari extensions,
showmethatfeed,
xml
Subscribe to:
Posts (Atom)