Posts

Adding Google Web Fonts to a Sproutcore app

Yesterday I was playing with the Hubbub   Sproutcore app that is just plain beautiful (and useful, if anyone used it over here in stodgy Italy). Anyway I noticed that the beautiful texts on the home page are not images, but actual text with fonts. I did not know I had such great fonts on my computer and in fact I don't. Those fonts come from Google Web Fonts  and you can use them too, right away in any of your web apps or sites. Since I am working on a Sproutcore app that could use some beauty I decided to style the app name with this font. Now, if only I knew how to add the css link to the html generated by abbot... [/me is gtfw & source browsing for a good 30 mins...] The solution turns out to be pretty simple and elegant (as everything in SC world, wink wink). Open the Buildfile in your favourite editor and add a stylesheet_libs option to the project config as follows: config :all do |c| c[:javascript_libs] = ['http://maps.google.com/maps/api/js?v=...

Adding Sproutcore KVO to OpenLayers - More Automation - Part 3

I have showed in the previous post how to add KVO to OpenLayers objects and then connect these objects to inputs, etc. The approach was unfortunately troublesome because each OpenLayers object had to be programmatically augmented through a SC.mixin call. In this post I will show how the OpenLayers source can be patched to make the augmentation process built-in. The only modification that needs be done is in Class.js where the OpenLayers.Class function must be modified as follows: OpenLayers.Class = function() {     var len = arguments.length;     var P = arguments[0];     var F = arguments[len-1];     var C=null;     if(typeof F.initialize == "function") {         if (!F.__my_init) {             F.__my_init = F.initialize             F.initialize = function() {                       ...

Adding Sproutcore KVO to OpenLayers - Part 2

Image
You can also  Read Part 1   or   Read Part 3 In the previous post of this series I have showed how easily an OpenLayers object can be extended with Sproutcore KVO . The main driver behind integrating KVO into OL is that of beauty and simplicity. When KVO is available texfields, checkboxes, layers, features, you name it can all have their state transparently and continuosly synchronized without writing any code at all. The first post was more of a proof of concept. In this post instead I am going to show a more practical use and rewrite one the OpenLayers examples (from the dev examples). The original example shows how to create and add features to a map from javascript. With the help of KVO I am going to expand the original and also make the features editable. As we will see the changes will propagate immediately into the map. The full source is available on github . To run the example simply download/clone/fetch the repo and open index.html with a browser. The...

Adding Sproutcore KVO to OpenLayers - Part 1

The truth is that after you start using Sproutcore KVO you become addicted to its beauty and simplicity. Where in other frameworks you spent most time keeping each part of the app in sync, in Sproutcore you get it for free. Sure Sproutcore isn't perfect and is not for all, but KVO is simply automagical! In this post I will show how easy it is to implement KVO on top of OpenLayers and take advantage of KVO to bind features, wfs queries and UI controls to otherwise stubborn Openlayers objects. In this example we will create a Vector layer, add KVo to it and then verify KVO bindings by manually adding an observer. I have run all this code from Google Chrome console and you can do it too. First thing to do is to create a scratch SC project: sc-init kvool then let's edit the Buildfile and add the following lines at the end so that the OpenLayers library is loaded with the app: config :all do |c| c[:javascript_libs] = ['http://www.openlayers.org/api/OpenLaye...

Automated conversion of MS-Access database to Postgres

Thanks to mdbtools it is now a little bit easier to migrate MS-Access databases to a newtork database like Postgres. This is a script that will bulk convert all the tables in a MS-Access database into a set of ready-to-use sql scripts (one per table).

Simple VCB: a tool For Vmware Consolidated Backup

I have written and would like to share with the world a groovy script that can be used to drive VCB backups without additional third party software. One of the most common gripes with VCB is that it doesn't integrate naturally into the VMWare management solution. Of course one can always buy a license for the integration module of his backup software, but that costs additional money. Some people then resort to script VCB so that additional licenses are not necessary but that, of course, requires scripting skills. Which also means reinventing the wheel just another time. This has happened to me too recently and I decided that ok, I would reinvent the damn wheel, but this time I would also make sure that the blueprint goes public! So I wrote this groovy script which I creatively named Simple VCB which does some nice things like: handles more than one esx, vcenter or vsphere server so that you don't have to split your configuration and schedules in more than one scrip...

HOWTO: Parallel deployment on tomcat 7

News broke out recently that Tomcat 7 supports parallel deployment . This feature allows one to deploy a newer version of a web application while maintaining the current one online. The net effect is that new users will be connected to the newest version while already connected users will not be kicked out. Neat uh? One could even have more than two versions online at any time (if that was necessary). The details of how this works are explained in the Context Container documentation . Only it doesn't really tell you how to use it, it tells you how they implemented instead. So what do you have to do to take advantage of this great feature? First of all upgrade to Tomcat 7 (which btw requires Java 6), but you knew that already, didn't you? Then simply adopt the following naming strategy when deploying apps: name your war file mygreatapp## version .war (note the ## used to mark the beginnning of the version substring) where version can actually be anything (it is ma...

Oracle Enterprise Linux on VMWARE

If you, like me, would like to play around with Oracle Enterprise Linux or whatever it's called these days it is most likely you'll end up installing it on some flavor of VmWare. I tried Esxi 4.1, and installation is smooth (I chose RHEL 6 as Guest OS type because Oracle Linux was not available). Not so much for the Vmware Tools install which quite blankly stated that the kernel headers were not valid, whatever kernel directory I threw at it. Then it hit me that Oracle is using a special kernel which is buzzworldy named UEK (Unbreakable Enterprise Kernel). I then edited grub.conf and reverted to a normal kernel (normally the second item), rebooted and installation of Vmware tools finally succeeded. Next question is: should I bother about NOT using Oracle's UEK? The answer is generally no (in my case I'm just running a Zope App), unless you are using the VM for running a production database (and in that case you shouldn't be running it on vmware in the firs...

Migrating existing opennms database to provisiond

In the next few days I will be migrating a rather large install from a discovery configuration to a manually provisioned configuration in an attempt to reduce confusion and the number of misconfigured nodes. To ease the process I have implemented a set of two migration script, they can be found on my Github repo . Basic instructions are available in the README file.

Sproutcore closable Mixin

Image
I've been working with sproutcore in my spare time for almost 6 months now and along the path I came up with some nice (I think) components. This one is a tiny unintrusive mixin that can be applied to panette panes and adds a close button on the top right corner. I have tried to make it work on panel panes too, but without success so far. That is probably because panel panes, being modal, grab all events before the events reach the mixin. Fetch from my github account: https://github.com/unicolet/stuff-I-m-proud-of P.S.: I also have a functional OpenLayers view, but it requires some refactoring before I can make it public.

Sproutcore calendar component

Image
I've realized a calendar component for sproutcore. It's at https://github.com/unicolet/stuff-I-m-proud-of . It could use some improvement, particularly with regard to layout but it's already pretty solid and usable.

unicolet.org continued

I contacted AIT which is, well was, the registrar of unicolet.org until last november. They say they tried to contact me about the renewal of the domain but I failed to answer so the registration expired. In fact I never received any email from AIT regarding the domain renewal not only this year but also in the past 4 years years that I've been with them. Also they don't know or can't say what the emails were about because they are generated from an automated system. They only aknowledge the email was sent to my gmail account on certain dates before the renewal expiry date. Now this looks strange to me: it has indeed happened that gmail marked legitimate emails as spam, but it happened very rarely. Because of this gray area I can't make up whether the failure to renew unicolet.org was on my or AIT's side (so I guess I'll just blame myself for not checking more thoroughly). Lessons learned : if you have registered any domain make sure that your registrar is ...

Cyber squatting

I also eventually became a victim of cyber squatting. The domain unicolet.org , which I registered in 2004, has become registered to a domain parker called sedo . Not I used that domain a lot, but it really feels bad when someone walks in, takes away something of yours and then, if you want it back, you have to pay. The folks at AIT domains which was supposedly in charge of handling the registration and renew process of unicolet.org say they can't do anything. The simplest procedure (the Uniform Dispute Resolution Process created by ICANN) to have the domain back without paying the snatchers will cost at least 1000$. I'll contact AIT to understand what's happened...

Comparison of (2) Javascript compression tools

I use more and more javascript files in my web applications and their size is slowly becoming a problem, especially among those users who connect infrequently and are on slow links. So I have eventually decided to google the internet for javascript compression tools. What I need though is not a generic web-based javascript compression tool, but one that I can easily incorporate in my ant build scripts. In the end there were only two candidates left: ShrinkSafe from dojotoolkit and jsjuicer . So I tried both of them against prototype.js which I happen to use on many projects and is actually quite large (96K!). The results is the following: unicoletti@ziggy ~/bin $ll prototype* -rw-r--r-- 1 unicoletti unicoletti 71758 2007-05-31 17:27 prototype-jsjuicer.js -rw-r--r-- 1 unicoletti unicoletti 68004 2007-05-31 17:27 prototype-shrinksafe.js -rw-r--r-- 1 unicoletti unicoletti 96046 2007-05-31 17:26 prototype.js And the winner is: ShrinkSafe, even though it a little slower and more hungry on...

Mac Mini Antenna from Quickertek

My intel mac mini is sitting quite far away from my wireless router and the signal strength is totally unsatisfying so, after some digging in the net I decided to buy an external antenna from Quickertek . The signal strength has in fact improved (about 30%) but not as much as I hoped. Unfortunately this is probably the best it could ever get because of a wall that sits in between the mini and the router. As for the antenna it is quite easy to install once you learn how to rip your mini open (grin...) and the Quickertek support was kind enough to send me (at no extra cost) an extra pigtail connector when I found out that the one I had ordered was not compatible with Intel mac minis. I am now going to bid on ebay for a better antenna for my router too and this is going to cost me a lot less, I hope...

OpenDNS

NewsForge is running a story on OpenDNS , a new re-thought and compatible implementation of dns that can fix spelling errors, typos and even help in blocking phishing sites. These guys did a great job of taking something that has always existed and is deeply rooted at the heart of the Internet and improved it while keeping it compatible. It is so simple that you wonder how you didn't come to think of it earlier, like the egg of Columbus! Before you rush to try it out think about the implications of its spelling correction on your mail servers while they attempt to deliver mail. This could save you a couple of bounce back if you're lucky, but it could screw your DNSBLs. It seems that OpenDNS is smart enough to figure out if you're querying a BL, so it should be safe even on mail servers.

Schneier is skeptical on NSA 'helping' Microsoft secure Vista

I don't trust Microsoft to run my laptop, should I trust it after NSA has jumped in to help it improve Vista? Bruce Schneier is suspicious : has NSA effectively made Vista more secure or has it injected its own backdoors for later use? Was there a prior relationship among the two: http://www.answers.com/topic/nsakey http://www.schneier.com/crypto-gram-9909.html#NSAKeyinMicrosoftCryptoAPI http://www.wired.com/news/technology/0,1282,21577,00.html

Firefox+Greasemonkey: take (back) the control of the web!

Today I was browsing this article about Windows Vista and I couldn't read it because all of my attention was in not moving the mouse over one of those IntelliTXT ads. But now that I have tasted the great power of greasemonkey I just don't have to take it anymore: http://userscripts.org/scripts/show/4250 Install it and enjoy!

VMWare and time syncronization

I have an Ubuntu server with vmware-server running three other linux guests and, except, for time syncronization it runs quite smooth. Today I eventually found some time to devote to this long-standing issue and I have applied this solution . It should keep behind the time in the guests so that the vmware-tools can update it. On my machine I have a 3.2Ghz Pentium 4 cpu so I have set host.cpukHz="3202000" a bit higher to compensate for the higher frequency. Let's see how it works... UPDATE: after two days the guests are still two hours ahead, so I decided to go for the easy route and set up a cronjob every two hours. UPDATE 2 : since time is not handled correctly also the cron job approach does not work.

[SOLVED] Eye Candy

I have eventually solved all the eye candy problems described in my previous posts. I have emerged aiglx and then configured beryl to use aiglx instead of nvidia for desktop effects. For more than a day it is now all working pretty well except for some occasional high cpu usage by X. Java apps, even under jdk 1.6 b2, still suffer from minor problems, like menus being offset from the pointer of a certain fixed amount.