Quote of the week on building servers and the mastery of life

“You will come across many opportunities to geek out. This stuff is fascinating at every level of abstraction. But the same curiosity and desire for mastery that helped you succeed as a programmer will now lure you into burning massive amounts of time if you allow yourself to dick around. Every new problem domain will attempt to seduce you with its beautiful, chess-like subtlety. You have to ignore this and respond by playing checkers.”

Source: http://blog.pinboard.in/2012/06/going_colo/

Long story short: Do not dick around, play checkers.

 

Fixing slow performance with Eclipse update site installs

Keep one checkbox checked and your Eclipse update site installs can be maddeningly slow.

At the Install dialog uncheck “Contact all update sites during install to find required software”.

Could there be any tricks to publish a plugin in a way that dependencies never trigger contacting all update sites?

Ending this tiny post with a few other update-site-tips:

Tip of the day #2: Fastest way to install from any update site: Help->Install New Software…->[Paste URL to "Work with:" and hit ENTER!]

Tip of the day #3: Fastest way to update a plugin from an update site: Help->About->Installation Details->Update is not the fastest because it still contacts all the other update sites. Possibly faster: Help->Install New Software…->[Paste URL to "Work with:" and hit ENTER!] or select from the drop-down.

If update site was updated while Eclipse was running then click “Available Software Sites”, look up your update site and hit “Reload”. After reload close the Install dialog and open it again.

 

Fixing your virtualbox shared folder symlink error

Operations such as installing node.js or python virtualenv to a virtualbox writable shared folder can fail if you try to do this as a linux (ubuntu) virtualbox guest running Windows 7 host.

The cause is symlink permission.

Typical error:

ln -fs out/Release/node node
ln: failed to create symbolic link `node': Read-only file system

It can also be a “Protocol error”.

This happens even if your shared folder is writable.

Fix: Enable symlinks feature in VirtualBox

Run at cmd prompt:

  
VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1
  

Verify by running:

  
VBoxManage getextradata YOURVMNAME enumerate
  

If your user belongs to Administrators group then start VirtualBox with “Run as Administrator”!

If user is not in Administrators group

By default Windows 7 security policy does not allow creating symlinks as it’s a potential security threat. Run “secpol.msc” and navigate to “Local Policies-User Rights Assignments” and add your user to “Create symbolic links”. I didn’t try that but could be that after that virtualbox could be run as a regular user.

Speculation: The controversy is that users with admin group seem to be unable to create symlinks even after granting the permission unless they use “run as admin”. Maybe symlink privilege gets filtered out for regular runs when user belongs to Administrators. Any ideas?

Let me know if it helps or if there’s an easier way!

Finding the laser sharp focus with deliberate practice of distractions

This is a my crosspost from TimeGT Blog. Comments on this post are closed, please submit all your feedback there.

The breakthrough for me came when I realized that the laser sharp focus is not about focus itself. It’s about taking away everything else. I just constantly apply deliberate practice to eliminate aspects that ruin focus.

It’s always about distractions. At home you might have a good idea about the goods to take from the grocery but as soon as you step into the store without a list – you’re lost. At least for me managing to remember even five items while looking around in a store is close to impossible.

Working with a computer is like working in a candy store. It’s easy to get lost as soon as you forget your current task. To overcome my memory and attention failure I tweaked my task management app TimeGT – now it shows my in progress task as a small always-on-top notification window. It annoys with smaller screens just a bit but at least I remember that I should be working on X and NOT check my e-mail or twitter or read that wicked new CSS button generator source. Keep your current task clearly written somewhere visible, it has helped me way more than I thought.



“What is important is seldom urgent and what is urgent is seldom important.”

It is suggested that when procrastination kicks in then it’s better to do anything a bit important, even if it’s not urgent. It sounds like a good short-term solution but I try to avoid it as much as possible. If there is an important AND urgent task waiting then doing unurgent is not the best thing to do. I better stay calm, go out and take a walk — clears my mind and helps to reevaluate priorities and motivation. Maybe the urgent task is unimportant and then it should be never done. At least according to the Eisenhower matrix.

Many thanks to Jevgeni for the blog post that sparked the need to write down my own thoughts on this.

The Power of Static Web

Recent web startups often share a common pitch for the integration simplicity : “It only takes 1 line of javascript to integrate with our service!”. Disqus, KISSMetrics, Chartbeat, Google Analytics, Facebook, G+ buttons. When was the last time you had to use SERVER-SIDE code to integrate a new service? It’s gone. Let me share a few thoughts where I think this trend takes us.

Static CDN serving for “dynamic” websites

Static pregenerated websites behind CDN scale massively better than any php+mysql CMS (wordpress, drupal, joomla).

This has boosted a number of site generators like jekyll. But why now? Why not before?

Because most of the sites had a dynamic element that couldn’t be regenerated easily. Comments, mostly.

A few dynamically generated sites have become static by the introduction of Disqus commenting system that sits into browser without any server-side integration. Getting the same level of integration at the server side would bring more complexities – depends on the frameworks, language and version compatibilities.

It does not end with comments. There are “1-liner” shopping carts, chatrooms, customer feedback, customer support, visitor analytics, games. These either complement or integrate with your site and more services appearing rapidly. I hope to see more variety in apps in this field like theming/styling websites dynamically, A/B testing, JavaScript-backed content caching, AWS SimpleDB-like storages for a unified datamodel integration. Turning upside down things that previously had to sit at the server-side.

One step forward with static CDN is javascript-fetched content. This is already happening – browser JavaScript is used to fetch content for the website. But there is a pending problem with this – until about a year ago search engines did not run nor index javascript-fetched content. So the search engines must catch up in order to provide the best search results. The good news is that Google and others are already doing that! They started to run JavaScript with their V8 crawler. But it’s no way guaranteed that your JavaScript is neat enough for the V8-powered crawler. In order to keep search relevant they must keep up and start running more and more JavaScript for indexing. It’s expensive but to a certain degree we can expect JavaScript-enabled indexing crawlers to take over.

Security

By keeping 3rd party components outside of your server walls your internal systems are better protected from being compromised.
On the other hand this risk is passed on to the end-user by being exploited to any code 3rd party chooses to run in her browser.
Thankfully browsers are relatively safe sandboxes and this security threat is close to visiting any regular website. The main difference being that JavaScript provider (3rd party) can potentially tamper your webpage content and has access to your website user info and page content. So you must trust any 3rd party javascript component 100%. From the security perspective it seems favorable for the service provider to keep 3rd party integration at the browser level.

Power of insight

Browser always sees more about your user than your server because it’s closer to the user. Being closer is better.

Browser era MVC

With JavaScript data loading and pushing the widely used server-based Model-View-Controller (MVC) architecture falls apart. At least server is not the Controller it used to be. Browser becomes the new Controller and Server is just one of the Model-providers.

What are other less covered upsides and downsides of moving more action to the browser?

Desktop is alive

In the midst of web startups it’s too easy to miss the opportunity in non-web environments. Python and Java are still strong candidates for your next startup frontend. As long as one gets the distribution and business behind the product right.

Success stories like MineCraft keep popping up from time to time. Behind the scenes it’s built with Java. As of today MineCraft has ~24 million registered users, of which ~5 million have bought the game. Most of them with a price of €19.95 (but they did start with a huge discount). In the last 24 hours, 60K people registered, and 8K people bought the game. (Source: http://www.minecraft.net/stats).

We keep hearing that desktop apps are hard to install and maintain. I don’t think Java is a cumbersome environment if 12-16 year boys and girls manage to get tens of thousands MineCraft servers running at their homes. Millions of regular Minecraft players run Java apps without an issue. There are thousands of plugins and mods written in Java for MineCraft server and client. Java is great for that but it’s way too easy to bash the platform if the real problem is usually in the product and distribution!

Let me share with you some of the user conversion stats in one of our own desktop apps, TimeGT. TimeGT is a task and life management app that is written in Java. It has an installer for Windows that includes Java runtime environment so user doesn’t have to install Java by herself. So far 99.1% of users who register their account at the website end up installing the app successfully and logging in with their username. That means essentially that every ~100th user has an issue with the desktop setup. For TimeGT case it’s very likely Mac issue as we don’t provide a .dmg file and running it in Mac is painful.

Eclipse IDE requires Java. OpenOffice requires Java. So does Adobe Photoshop. I believe it’s safe to say that you can still build great and massively popular stuff without falling into building on top of technology which was initially poured over with millions of dollars mostly to sell more ads, own more of your screen estate. Don’t get me wrong.
Of course web apps are perfectly natural for oh so many user cases. I’m still overly excited and thankful that web got a technological and distrubution kick at this scale. Oh. And building beautiful things is so much easier with the web instead of hacking with a Java Swing or SWT UI toolkit. Just know where the fine line is.

The road ahead with desktop and Java

I guess the challenges evolve around maintaining updates and supporting platforms (read: devices).

I’m not worried about the updates. It’s a feasible engineering task. In TimeGT we have automatically pushed updates (yes, requires restarting your app but so does Android and iPhone app!).

But getting your Java app to devices like Android and iPhone is not fun. I’m not sure how it all gets to a sensible place where you don’t have to over-abstract for the sake of single-sourcing yet avoiding idiotic rewriting of app in different languages.

Small footnote on desktop coding experience

While Eclipse remains to be the most popular IDEs around and provides a wonderful Java editor and extending capability, it scares me how its initial advantage of being fast and snappy is diminishing and people keep turning their heads toward vi/vim, SublimeText 2 and TextMate even for Java and Scala. You might think that a real IDE with full AST parsing and class model navigation is required for any reasonably sized projects but I keep seeing people hacking more and more with their text editors. I hope to see a change here. Get an IDE that is as fast for coding as vim.

Eclipse core itself is super fast and gets improved all the time but as with Chrome browser – plugins slow life down. There should be more control on seeing which plugins conserve most resources and a quick method to kill them, just as you close tabs in Chrome.

One project contains many different file types, they must blend into one hacking experience.

BPMN2 Modeler gets Indigo support

I’m happy to announce the availability of BPMN2 Modeler update site supporting Indigo!

Update site URL: http://codehoop.com/bpmn2/

It’s an update site, not a website! See https://github.com/imeikas/BPMN2-Editor-for-Eclipse/wiki for the website.

In addition to fixing the code to support Indigo, also Graphiti framework was upgraded from 0.7.0 to 0.8.0. Update includes a few other minor tweaks, nothing major.

About project future and hosting

As some of you might know BPMN2 Modeler proposal got accepted as an eclipse.org project, named soa.bpmn2-modeler (yay!!!), so the migration is already on the way. But until that gets finished the latest update site will remain available at http://codehoop.com/bpmn2/. Github repo will become inactive as the git.eclipse.org gets up to full speed.

Please note that while Eclipse BPMN2 Modeler offers one of the most complete BPMN2.0 modeling support in the industry, it’s still a prototype and is not recommended for production use!

New Eclipse Word Wrap plugin adds keyboard shortcut

Had a few spare minutes yesterday to move the eclipse word wrap plugin from sourceforge to github.

While on it also added keyboard shortcut so you can switch on-off the wrapping using Ctrl+Alt+W (M1,M3+W in “Eclipse Language”).

Eclipse Word Wrap

Trust me, it’s a useful plugin : )

Latest version can be installed from the update site: http://ahtik.com/eclipse-update/

Word Wrap project site

Thanks to the shortcut I’m not even waiting anymore to have it fixed in the very deep core of the Eclipse platform as the changes would be massive and simply switching it off before launching a debugger is good enough for now.

BPMN2.0 Editor for Eclipse now available

Soon to be released jBPM5.1 is getting a new addition to its product suite – visual editor for the BPMN2 language. This was somewhat inevitable as the jBPM workflow engine moves to BPMN2.0 with the version 5 and hacking together xml files without visual guidance can be.. hmm.. less fun.

For a quick background, BPMN (Business Process Modeling Notation) is the leading standard for business process modeling managed by the OMG. A new version called BPMN2.0 (released January 2011) brings numerous changes to the table, most importantly increasing the consistency and integrating orchestration and choreography in a way that makes BPMN 2.0 a great choice for business process engines.

Over the past few months we‘ve been very excited to work on a new BPMN2.0 Visual Editor for Eclipse. It is free and open source, hosted at github. This github repo is a temporary place and will find a new home soon.

BPMN2 Editor is built on top of the awesome Graphiti modeling framework and behind the scenes uses BPMN2 EMF metamodel.

For more details check out the more detailed post about the BPMN2.0 visual editor by Kris from jBPM.

Check it out, have fun, contribute, report issues and bear in mind that it’s still beta and actively developed ; )

Fighting with the SSL “unexpected_message” while using HTTP proxy and your own socket tunnel

Whenever you write an application that should support http proxies with your own custom SSLSocketFactory, you MIGHT run into a problem…

Java JRE in itself supports proxies for HTTPS but it does NOT support SSL connections over proxy. For that you’ll need to create a separate proxy tunneling socket and layer it on top of the actual SSL connection. So far so good but there’s a nasty exception that can take you ages to figure out:

Caused by: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1682)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:932)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1139)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)

There can be many reasons but one of the unexpected ones — make sure to add

Pragma: no-cache

to your http proxy CONNECT request header! Otherwise you’ll get this exception.