Wednesday
Jan042012

How to access better/more advanced power settings in Ubuntu/Linux Mint with Gnome 3

Gnome3 on Linux Mint/Ubuntu comes with a pretty bare-bones power manager. Luckily, there's a better alternative and it's called dconf-editor. Here's how to get it and use it for power management purposes:

$ sudo apt-get install dconf-tools
$ dconf-tools

The relevant settings can be found in org/gnome/settings-daemon/plugins/power

Wednesday
Dec282011

How to get JungleDisk Desktop running on Ubuntu 11.10 and Gnome 3

JungleDisk is broken for Ubuntu again. It won't start when selected from Gnome 3's Activities dashboard, nor will it start when calling it manually from the command line.

$ junglediskdesktop
junglediskdesktop: error while loading shared libraries: libnotify.so.1: cannot open shared object file: No such file or directory 

As suggested by JungleJason (http://askubuntu.com/a/84499), you'll need to symlink libnotify.so.4 to libnotify.so.1. The latest version of Ubuntu (11.10) apparently only comes with the former variant.

If you're running a 32-bit Ubuntu: 

$ cd /usr/lib/i386-linux-gnu/ ; sudo ln -s ./libnotify.so.4 libnotify.so.1

If you're running a 64-bit Ubuntu: 

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libnotify.so.4 /usr/lib/libnotify.so.1

 

Wednesday
Dec282011

How to compile Node.js from source with Ubuntu

UPDATE: Works with Node.js 0.6.6 and 0.6.7 on Ubuntu 11.10 (Oneiric Ocelot) / Linux Mint 12 (Lisa).

There are no pre-compiled packages for Linux, so if you want to use Node.js, you'll have to build it yourself. It's easy enough though, and here's how.

Download and unpack Node.js Source

You can obtain the release version from their website or get an edgier version from their Git source repository. If you acquired it from the former source, you'll need to decompress it first, for instance to /usr/local/src/.

(optional) Install the build tools

If you haven't done this before, your system most likely won't have the required tools for software compilation. You can easily install them: 

sudo apt-get install build-essential checkinstall 

(optional) Install openssl-dev

If you want to compile with SSL support (default), you'll also need to install the OpenSSL Development Packages, like so:

sudo apt-get install libssl-dev

Build Node.js

Open up a terminal witndow and navigate to the directory that contains the Node.js source, e.g. /usr/local/src/node-0.6.6. And execute the following commands in succession: 

./configure
make
sudo make install

If all goes well, you should be able to access the node command from any terminal window.

Saturday
Dec032011

How to build a JavaScript project with Maven

Prologue

This year's buzzword has to be 'HTML5'. Everywhere I go, people are making a fuss out of building HTML5 'applications' (for the desktop too, now, with Windows 8's WinRT). However, I see HTML5 more blandly as 'HTML/JavaScript', and I make this pairing consciously, because in my opinion, there is no HTML5 without JavaScript and vice versa. Therefore it's important to know and master the intricacies of JavaScript before boasting your "HTML5"-skills to friends, colleagues and the world at large (using a <header> tag doesn't count as a skill). Don't be fooled by JavaScript's supposed simplicity. It's just that simplicity (read: lack of OO principles) that makes it difficult to use for building maintainable and enterprise-grade software. Languages like Java, C#, and even ActionScript (JS' cousin), provide the developer with a degree of standardization and structure that is severely missed in the JavaScript world.

From my point of view, JavaScript has two weaknesses: its loose type system and its prototypal inheritance model. I know many people don't agree and opine that the points I just made are actually strengths. Point taken. It does have a couple of things going for it: ubiquity and a low barrier to entry.

Tacking a build process onto JavaScript, with Maven

If you're used to a more object-oriented development language/platform, with classes, interfaces, inheritance, strict typing, unit and integration testing, this all looks very scary. Many enterprise developers seek the assistance of Maven, Ant or other tools of that ilk to manage framework dependencies, build and test processes, and code quality metrics. And there's no reason why this can't also be applied to JavaScript development.

Yes, JavaScript can be tamed, you heard it right. With a limited amount of effort, we can let Maven take care of the following:

  • compile and validate your code with JSLint
  • compress and obfuscate your .js files in one fell swoop
  • combine all of your compressed .js source files into a single JavaScript module
  • integrate with the Jasmine BDD test framework for unit/integration testing of your JS code
  • code quality reporting with JSLint
  • generate JSDoc documentation

Prerequisites

Maven is a Java-based tool, so you'll need to get the latest Java JDK from Oracle. I'm still using JDK 6, but I guess JDK 7 would do as well. Other than that, you'll need to get the Maven 3 binary and unzip it somewhere. For your convience, you may want to consider adding it to your path (Windows, Mac, Ubuntu Linux). Fire up a text-editor (I like NetBeans for pom.xml and JavaScript editing) and a command-line window. You're good to go!

The pom.xml config 

Here's the full pom.xml configuration file. It's currently still a work in progress, but it implements all of the features I described above. In the subsequent section I'll provide more information on every section of importance.

In depth 

Same file, with some extra comments.

 

I'm continuously looking for things to add, so any suggestions are welcome. Also, I'm maintaining this project on BitBucket, here

Saturday
Sep102011

Diaspora* invites coming soon

It seems Diaspora* is still alive and kicking (what's with the * anyway?) and about to hand out alpha invites. I received this e-mail recently:

Dear Friend of Diaspora* -

Thanks for your interest in being part of the Diaspora* community. You may not have heard from us in a while, but we’ve been working hard, head-down. We’ve built the first stage of a new social web, one better than what’s out there today: a place where each of us owns our own information, where each person controls his or her own privacy, where no-one is a product, and where we all control our own destinies.

We’re sending out alpha invitations now, as quickly as we can. If you haven’t gotten yours yet, you will receive it by the end of October.

There's been big news in the social networking world recently, and we can't help but be pleased with the impact our work has had on two of the biggest developments. We're proud that Google+ imitated one of our core features, aspects, with their circles. And now Facebook is at last moving in the right direction with user control over privacy, a move spurred not just by Google+, but more fundamentally by you and thousands of other donors, as well as hundreds of thousands of people who've lined up to try Diaspora* -- that is, by all of us who've stood up to say "there has to be a better way." We're making a difference already.

And aspects is just one of the many ways we're pioneering the future of the social web.

Here's a quick preview of some of the other ways:

  • We'll make the social web more fun than it is today.
  • Our distributed design gives you the security of owning your own identity and data.
  • This also gives you the freedom to do what you want online.
  • Our ecosystem provides the commons, the connective tissue for an evolving social web.
  • We're not gatekeepers, so our ecosystem will always support the latest apps.

We’ll tell you a little more about each of these points in the weeks ahead.

And we’ll keep working to get your alpha invitation to you just as quickly as we can.

Until then, thanks again for your interest in Diaspora*.

Sincerely,
- Maxwell, Daniel, Ilya, Sarah, Yosem and Peter

The Diaspora* team
Thursday, September 8th, 2011

Do we have room for another social network besides Facebook, Twitter and Google+? Interesting enough, regardless of whether this initiative has potential or not.

Saturday
Sep032011

Console2 + Powershell: A Better Windows Command Prompt

Windows has always had a ponderous command-line experience. And no wonder, because for the longest time, Microsoft developed Windows to be GUI-first. As a result, the terminal shell in Windows was always something of an afterthought (until Windows PowerShell happened). While PowerShell is a big improvement by virtue of its .NET roots and UNIX-inspired command set, the UI still suffers greatly from strange issues of old, e.g. fixed window size and screwed copy-paste.

Fortunately, free software comes to the rescue. Console2 is a software project hosted on SourceForge and describes itself as (citing their project page):

Console is a Windows console window enhancement. Console features include: multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles

Yeah, Console2 adds everything Command Prompt lacks, and it gets better, because we can configure it to use PowerShell as its shell to create the ultimate Windows command-line environment.

Here's how.

Download & Install Console2

Get it from its project page at SourceForge, here.

(optional) Download Windows PowerShell

If Windows Update hasn't already installed PowerShell on your system, you might want to fire up Windows Update manually and enable it. If you're running Windows XP, you can get it manually.

Configure Console2 to use PowerShell

Open up a Console2 instance and open the settings dialog via Edit > Settings.

Use the browse button next to the Shell field to select powershell.exe from its installation directory. On my system (a Windows XP machine, issued by work..), I used a system variable to reference the PS executable, like so:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

Hit OK.

I've been using this setup for a couple of months now and I'm extremely satisfied with it. The combination of PowerShell and the features Console2 adds, I'm in CLI Nirvana whenever I need to use it.

That's all folks!

Sunday
Aug212011

How to prevent Firefox' plugin hang detector from triggering during Flex development

Firefox' plugin hang detector is a feature that aims to reduce browser crashing caused by plugins like Flash or Silverlight hanging for prolonged periods of time. Firefox will cut a plugin process off after a predefined timeout, set to 15 seconds by default. While I loudly applaud this stability feature, it is an annoying one to deal with if you're a Flash developer using a debugger. Setting breakpoints for longer than 15 seconds will trigger the hang detector and break off your debugging session. Very annoying indeed.

Fortunately, there is a way to disable this feature (or set the timout to something more usable).
Here's how.

Step 1: about:config

Open up a new tab and type about:config to bring up the advanced configuration page. Click past the warning ;-).

Step 2: Set timeout to -1 to disable

Use the filter field to search for dom.ipc.plugins.timeoutSecs and set its value to -1 to disable the detector entirely. Of course, you're free to set it to any higher value, just remember that the timeout is expressed in seconds and you're good to go.