Remote linux-based Time Machine using netatalk instead of smb

My large file server once was able to act as a Time Machine provider over-the-air, back before Apple disabled the ability to use Samba shares as Time Machine disks. However, following a few simple instructions from these helpful folks below, I was able to make OTA Time Machine backups happen again.

Thanks, Daniel and Pepijn!

VMware Fusion Networking Tips and Tricks

Overview

VMware Fusion’s networking configuration is a bit obscure and it is difficult to find information about it on the ‘net. I usually only need to achieve the following bits of config change, and they really only serve my need to tightly control all the things. I am posting this information here so that I never forget again.

Terminology

  • host always refers to the Mac running Fusion. To run commands on the host, startup Terminal.app and start typing!
  • guest always refers to the operating system running in a virtual machine within Fusion. To run commands on the guest, either log in via the VMware Fusion console or ssh your way into the guest.

NAT networking configuration

Changing the IP subnet for a VMware Fusion network

This is super-simple. Edit the following file:

$ sudo -e /Library/Preferences/VMware Fusion/networking

and make the obvious changes. For vmnet8, the NAT network, the config parameter is:

answer VNET_8_HOSTONLY_SUBNET 10.0.1.0

Then restart VMware Fusion networking:

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Using vmnet8 dhcpd to assign static IPs

This is useful if you do not want to mess with the DHCP setup of your virtual machine. So if you copy the virtual machine and boot it up on another host, you will get network access without having to mess around with /etc/network/interfaces. The disadvantage is that you have to do a bit of manual configuration of VMware Fusion, the documentation for which can be a bit obtuse. Note that if you copy the virtual machine the NIC MAC address changes, so you will need to re-discover the MAC address and reconfigure VMware whenever you copy a virtual machine.

1. Find the MAC address of your virtual NIC in the guest machine

ex.

$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0c:29:b3:31:a0
inet addr:10.0.1.130 Bcast:10.0.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb3:31a0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:464 errors:0 dropped:0 overruns:0 frame:0
TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:466580 (466.5 KB) TX bytes:20814 (20.8 KB)

HWaddr is the MAC address for the virtual NIC; in this example, the value is 00:0c:29:b3:31:a0.

2. Edit your vmnet8 dhcpd.conf file

On your Mac host:

$ sudo -e /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf

Most of this file is automatically generated. AFTER this comment:

####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######

add the following stanza:

host ubuntu {
    hardware ethernet 00:0c:29:1b:5a:98;
    fixed-address 10.0.1.7;
}

Note that you can choose whatever name you fancy to follow host. The fixed-address IP address must be in the IP range of the vmnet8 subnet, in this example the IP range is 10.0.1.0/255.255.255.0. The hardware ethernet setting is, predictably, the MAC address of the virtual NIC in the guest operating system.

3. Restart VMware Fusion services

In the host:

sudo /Applications/VMware Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware Fusion.app/Contents/Library/vmnet-cli --start

4. Restart the guest OS

Reboot the guest OS, or restart its networking layer. For example, in ubuntu, either of these will work:

sudo service networking restart

or

sudo reboot

5. Closing thoughts

Do not forget to add a convenience line to your host's /etc/hosts file, now that you have a nice shiny predictable IP!

A Clean, Usable Facebook

Updated Aug 19, 2012 – Re-enabled header, removed groups photos specifically
Updated Aug 16, 2012 – removed “Pages and Ads” section
Updated Aug 8, 2012 – liberate tuteme ex inferis – added javascript

I am not a fan of Facebook’s user experience. Although I deactivated my account for a couple months and felt a state of blissful peace, I was eventually drawn back to it for social reasons. However navigating the super-busy UI felt like that scene from Event Horizon where the guy rips his own eyes out in the horror of his surroundings.

Things need not be so bad. I essentially need only the Close Friends list and a few groups. While in those views, I just want the content, not all the extraneous crap. Although it is true that most of that extraneous crap are Facebook’s efforts at monetization (see what your friends are buying, app stores, actual honest ads), I do not think of this as an ad-busting project. I just want a usable interface.

Fortunately, there is some pretty simple CSS that will clean things right up. First, click the button in the lower-right corner of Facebook called “Hide Sidebar” (thanks Facebook for including that control). Then you can overlay the following style rules on top of Facebook’s and you are left with nothing but the core content experience.

/* 
 * Column with ads, occasionally also has
 * useful controls but nothing I need 
 */
#rightCol { visibility: hidden; }
/* 
 * Removes friends faces in the groups views.
 * Unnecessary waste of pixels. Sorry guys. 
 */
.groupsCoverPhoto { display: none; }
/*
 * My face and name on the left. Isn't this also on
 * the upper-right? Why is it on the page twice? 
 */
#pagelet_welcome_box { display: none; }
/* 
 * Definitely don't need apps 
 */
#appsNav { display: none; }
/*
 * Not making Pages or Ads
 */
#pagesNav { display: none; }
/* 
 * No idea what this junk is for 
 */
#interestsNav { display: none; }
#pagelet_pinned_nav { display: none; }
#pagelet_friends_online { display: none; }
/* 
 * For the extra-spiteful, get rid of the Facebook logo.
 * You can still get to the Activity Feed from the "home" 
 * link on the upper-right 
 */
#pageLogo { visibility: hidden; }

 

To make this CSS stick, I am using Personalized Web, an extension for Chrome. After you have installed it, go to Window->Extensions, choose Options under Personalized Web. Add a New Rule. Name it “Facebook” and for “Match URLs” use:

^https{0,1}://.*.facebook.com/.*

 
Copy and paste the CSS, above, in the “CSS” section, click Save, and reload Facebook. Voila! As your eyes start to recover from the pain that once was inflicted by that over-busy interface, a beautiful simplicity emerges in which meaningful content is front-and-center and the side navigation is restrained and meaningful.

Update: One thing that helps tremendously is to clean up the sidebar navigation of all the groups that include groups you are a member of as well as your past companies and other oddball generated groupings. These are the list entries under Friends and Groups. I had previously cleaned this up with CSS, but Facebook keeps changing the IDs causing new groups to pop up despite my efforts to hide them. I do not know how they decide what to show in these lists but it is pretty weird. In any case, I have added some Javascript to the Personalized Web that accomplishes a couple of functions. Paste this code into the “Javascript” section of Personalized Web and click Save.

// Put the names of your lists you want to keep here.
// Use a comma to add more names
var OK_Friends = ['Close Friends', 'Family']
var OK_Groups = ['Poker Night', 'Pickup Soccer', 'Gaming Enthusiasts']

//---------------DO NOT EDIT BENEATH THIS LINE ---------------//

var lists = {'listsNav': OK_Friends, 'groupsNav': OK_Groups}
var ok_el, el, els

for (list_id in lists) if (lists.hasOwnProperty(list_id)) {
    el = document.getElementById(list_id)
    if (el) {
        els = el.getElementsByClassName('sideNavItem')
        for (j=0;j<els.length;j++) {
            ok_el = false
            el_inner = els[j].getElementsByClassName('linkWrap')[0].innerHTML
            for (i=0;i<lists[list_id].length;i++) { 
                if (el_inner == lists[list_id][i]) {
                    ok_el = true
                    continue;                
                }
            }
            disp_val = document.defaultView.getComputedStyle(els[j],null).
                getPropertyValue('display')
            if (!ok_el && disp_val != 'none') {
                els[j].style.display = 'none'
                console.log('#'+els[j].id+' { display: none } /* '+el_inner+
                    ' */')
            }
        }
    }
}

 
Edit the first two arrays to contain the names of groups you want to see, and the rest will be filtered. This works OK, but the script runs after the page loads so you still have to see the groups in the list for a second. If the rules for hiding groups were specified in the CSS, the groups would never appear at all. To make it easier to permanently hide these list items, this script will output the CSS necessary to hide the list item on page load to the javascript console. In Chrome go to View->Developer->Javascript Console and reload Facebook. You should see a list of text that looks similar to what is already in the CSS section of Personalized Web. You can copy that directly from the Javascript Console and paste it into the CSS section of Personalized Web, and never see those unwanted groups again. To make it a bit nicer, if you have already hidden most of the groups with CSS and a new group magically shows up (you will see what I mean), the script will only output the CSS for the newly-appeared group.

Quick warning: I have not thoroughly tested this on Facebook, I imagine there are all kinds of things this could potentially break. Fortunately, it is very easy to disable and re-enable Personalized Web, so if you need more advanced features from Facebook you can just temporarily turn off the clean look.

Hopes this helps someone else out there!

Gamification Links to Get You Started

At the September 2011 GLP conference, I promised people some links on Gamification. These will hopefully get you headed in the right direction.

Jane McGonigal – Reality is Broken at Amazon – This is the book mentioned by Bob at the conference.

Jane McGonigal: Gaming can make a better world – TED Talk on the concepts from her book. You can also check out Jane McGonigal’s blog which has many more videos.

Gabe Zichermann | Gamification Blog – trying to become the face of gamification, but he has great links and…

OSCON 2011: Gabe Zichermann, “Designing for Engagement with Gamification in Open Source” – this talk was excellent! I was in the audience. Again, exploring very similar concepts from Drive and Reality is Broken.

Jesse Schell “Design Outside the Box” – this talk is what opened my mind to the world of gaming outside of gaming. Schell’s style is a bit abrasive at times, although it appeals to me. He brings together some interesting successful anecdotes and metrics to drive home his final point. For context, DICE is an annual professional game developers conference, so he is speaking directly to the game design industry in this talk.

The following are not directly related to gamification, but just in case you have not seen these yet, I think it is worth checking out Drive by Daniel Pink (related TED Talk) but especially:

Authors@Google: Dan Ariely – Dan Ariely talks about his research in decision-making, it is fascinating stuff.

I feel all of these speakers are in the same mode of research: how do we design better games. The domains differ, but the core principles are starting to converge.

Finally, there is an emerging style of games journalism called new games journalism, started by the UK website Rock, Paper, Shotgun. The concept is that the journalist documents the experience or cultural significance of playing the game, and not just about the details of the game itself. Rock, Paper, Shotgun can be tough to parse on a daily basis, however for stellar examples of the technique check out the articles linked from writer Quintin Smith’s last post. This may be a bit too close to the player perspective to be helpful for gamification but I loved these articles. The value for me, beyond nostalgia, is to see how different games can shape the way in which gamers view the real world. The impact these games can have outside of the game.

Much more accessible is the real-world quarterly magazine Kill Screen. This magazine attempts to bring a New Yorker style to articles on video gaming. Some of the articles are phenomenal, but are not published on the web so I cannot link to them for you. I have tried to make copies of articles to share with Bob and Phillip, but could not get the pages to scan very well. In any case, highly recommended, would be happy to bring copies for people to peruse to the next conference. You can also browse their daily blog, but the content is not as good as in the published magazine.

I hope these have some value for your in-the-real-world game-making!

Blogging OSCon Day 2: Node Day

In which I learned to stop worrying and love the Node.js. During Node Day I was able to connect with real-world examples of people running Node in production, talking about why they chose Node, and how it was working out for them. As a by-product, I started to grok the things I had learned the previous day in the Node Tutorial. To sum up the talks of the day:

Tim Caswell talked about translating the SDL Library into a Node.js extension. He claimed to not be a strong C programmer, and he accomplished quite a bit despite that limitation. This gives me hope, for if we were to similarly port Contacts to Node.js, there would be some heavy lifting in the C world to accomplish first. Guillermo Rauch live-coded an HTML messenger client from scratch, demonstrating the steps it would take to do so as well as showing of socket.io. The most impressive bit was Guillermo’s almost flawless, fast typing. It was also neat to see how little code was required to make this happen, he got it done in 20 minutes or so.

Ryan Dahl gave a talk on porting Node.js to Windows. Apparently there has not been a release of Node.js in some time as they have been doing all of the porting work for the past few months. The new system framework is being built alongside the old Node.js system framework. If you are running the unstable branch of Node, you can try out the new code by using the --use-uv command line flag. It sounds like these guys are going through the same work the FastCGI for IIS project had to go through to port to windows (the same discussion of threads vs forks came up, at least.) Another interesting tidbit: the 3.4 version of V8 cause a 10% performance drop in Node. They feel bound to stay with the latest V8 version, and are working with the V8 team on the issue. Dahl also expects there will be a stable 0.6.0 version of Node.js in about a month.

Tom Hughes-Coucher did not talk about scaling, as the talk description might have led one to believe, but more on overall performance and benchmarking Node. For the most part he was responding to this article on Node vs Erlang performance. The really interesting thing here for me was to reduce my ignorance of the technological landscape in which Node exists. Otherwise Tom’s basic point was benchmarks are often flawed, tough to do right, and would like to see real-world use case benchmarks rather than artificial stress tests. He also stressed looking for the hot-path perf blocker for your use case. All pretty common-sense but worth-repeating type of stuff.

The next few talks had similar themes, mainly running Node.js with a real application in production. These were great to hear first-person perspectives on running and deploying Node to production. Paul Querna from Rackspace had the most detail on tools and process. They have created their own Node package repository for pushing in-house patches to public packages. It is an extension of npm which checks their package repository before hitting the public package repository.  The other interesting bit from his talk was the discussion of Node.js and SSL… apparently all is not yet right in the world between these two, regarding performance. He recommended running stunnel+haproxy or stud+haproxy as a solution to Node’s SSL woes.

The final talk was Elijah Insua discussing the design and development process for JSDom. This is a module that aims to be a faithful replication of the DOM per the w3c spec. This is what both jQeury and YUI use to run server-side in Node. It currently supports Dom Level 1+2, and they are actively working on the DOM Window global object (which is not covered by a spec but is a collection of vendor conventions), and DOM Level 3. Caveat, there is a memory leak (I believe it was in using setInterval/setTimeout, the context is not being released) which they are aware of and working on.

The session ended with a roundtable Q&A with the speakers. An interesting question came up regarding sharing code logic between the client and the server. The surprising answer was none of the speakers thought this was a good idea, or could see a use case. One of the justifications I hear frequently for Node.js is that you could potentially share code between client and server. This was a good confirmation of what I had come to on my own after this day of examples. Node.js code needs certain extensions that are not compatible with client-side code. Node.js server-side code is not portable in that way without some effort. You need to use the “require” keyword to include other modules, and the syntax for creating a module is a bit odd and not useful outside of the Node.js context (it is from a standard called “CommonJS” but insofar as a browser is concerned, not helpful.)

Final Thoughts

This day of Node left me feeling excited about the technology. These guys made programming for Node seem fun and cutting-edge. The attitude was DIY, a few talks mentioned not relying on other libraries that you could write yourself in a few days. Much was made of the simplicity of the platform and how few lines of code many of the demonstrations required (not counting whatever code went into the modules being used as middleware.) After seeing the support Node has in its modules, it no longer seemed like such a problem that you have to re-create basic functionality like listening for HTTP connections or doing basic server access logging.

However! For a company like Yahoo!, the migration will be non-trivial. Our basic apache comes with a lot of pre-configuration that will be a hassle to re-create. Using Node.js in that context will require a bit of heavy lifting by a variety of parties. For the short-term, we may be able to find use-cases where Node can fit, but we will have to proceed very carefully. For the long-term, Yahoo! as a company would need to decide whether it wants to support Node for the long-haul and put together a package covers the areas that apache currently covers. (Note that the relevant folks at Yahoo! are already aware of this, however now I have a deeper understanding of what is missing for us to go full-bore Node.)

So work-related use cases aside, I am looking forward to mucking about with Node on personal projects!

Links Round-up

More tools and modules were discussed than I could possibly cover. The following is a rough round-up of all of the links that made it into my notes.

Logging

winston  more
log magic

Testing

whiskey Example coverage report

Deployment

haibu

JS Lint

Closure Linter
node-jshint

Templates

jade
weld  more

Other

socket.io
hook.io

Blogging OSCon 2011: Day 1 Tutorials

It is 2011 and I have decided to start a blog. That is a term coined by my friend Peter Merholz which means a “web log” or “online journal.” As you can see, Peter has been blogging perhaps since the beginning of time, or at least since the beginning of Swatch Internet Time. Whereas I have forsaken this flash-in-the-pan trend until now. I thought perhaps this would be a great way to ease into using Twitter, and also as a means to justify the cost to my company of dispatching me to Portland to attend OSCon. With that in mind, my first post shall concern the topic of OSCon 2011 and What Was Learned Therein.

OSCon Day -1 & 0: Community Leadership Summit

Before OSCon starts, a bunch of very friendly, talkative people get together to discuss the ins and outs of community management. These are evangelists, marketing folks, product managers, generally good people persons. They get together to discuss the craft of people person-ing; when by “people” you mean “many geographically diverse people gathered around a particular open source project or other product.” I only attended one session, but my partner who is in developer marketing attended both days and got a lot out of it. I found it interesting but did not connect it to a direct relevancy to the art of software engineering management. That said, being on the forefront of user input and feedback for Contacts, I could probably spend more time thinking and acting on the topics discussed in this forum.

OSCon Day 1: A Battle of Old and New

The morning was spent learning the latest thinking on the PHP framework front, the afternoon in a session on the new hotness that is Node.JS.

Top Shelf PHP (Kris Wallsmith, Jeremy Mikola, Dustin Whittle): I was impressed with the problems these guys are tackling, very relevant to the challenges we face on the Yahoo! Contacts team. To summarize:

  • Symfony 2: Influential application framework, I later saw ideas from Symfony re-implemented in some of the Node.JS middleware. I am interested in Symfony as I have personal projects written in version 1 of this framework, however this is less relevant in the work context.
  • Assetic: Asset management for symfony / php. Solves some problems we run into in an elegant way, by allowing runtime, configurable transformations of your static assets as developer runtime, which you can also integrate in your build process for simple CDN deployment. Uses a decorator-like “filter” system to apply various transformation steps to your assets, and is easy to configure for dev vs. production environments. As we are currently investigating our build process with regards to assets and speed, this might be work a look.
  • Behat and Mink: BDD test creation and driving system. Allows you to write natural language behavioral tests in the same format as a user story, turn that to code, or with Mink, turn it into something that can automatically test your app. The simple case demoed was fairly impressive. The Contacts team is moving to a more lean development methodology and we need all the help we can get in the QA automation space. This tool has promise. Very similar to Pyccuracy, a tool written by our friends in the meme.com team in Brazil.
Introduction to Node.js (Tom Hughes-Coucher): This was a great heads-first dive into Node.js. I admit to knowing nothing practical about Node before this session. So I was shocked to learn you are expected to write your own web server before you can start writing your web app. I was stunned, frankly, at the impracticality of that concept. I was so stunned that after three hours of struggling through installation and the example exercises, I cornered Tom after the tutorial and had the “I don’t get it” talk with him. Being a very recently ex-Yahoo!, he was able to bring the business case in a more relatable way for me. This session was very necessary for me to be able to appreciate the presentations at Day 2: Node Day. Having thought through it a bit, and seen some examples, and heard the discussion, it no longer seems so unreasonable to have to spin up your own http/https server, logging infrastructure, and web application framework from scratch. More on that in Day 2: Node Day. A few tool-related notes I jotted on this day:
  • node-inspector: in-browser Node.js debugging tool
  • The Chrome team has an Eclipse-based Node.js debugger as well, it looked very impressive on the big screen.
  • npm: Node Package Manager, developed by ex-Yahoo! Isaac Shlueter (who also lives in Oakland, woot!) is a necessity (but does not install if you followed the instructions to install node from the ubuntu package. I spent the second half of the tutorial re-installing node from source so I could install npm. Very irritating!)
The slides for this talk should be available on-line and have a great series of problems to help learn the basics of Node. I recommend trying them out if you are looking for an introduction to the concepts behind Node.
Time to hit the Puppet Labs Party before heading to bed. Will try to catch up with the bloggin’ tomorrow with OSCon Day 2: Node Day. In which more things of a Nodeish nature are revealed. Perhaps I will even try live-blogging the keynotes! Ha! Who am I kidding! I am just getting started with this blogging thing. I am pretty sure you have to have a podcast before you can live-blog.