Posted on Dec 1, 2011

The Desktop Environment week


Nope, it’s not a national holiday. It’s the week that every geek wastes trying new DEs and, usually, it happens every year.

I don’t know if you are aware of this behaviour, but Linux users certainly do.

On regular basis, upgrades are made to all the Desktop Environments like KDE, Gnome, LXDE and so on and so forth. Linux users tend to hang out different social environments such as IRC, Mailing Lists and forums. In these places, there are lots of discussions like “what is the best DE?” and, usually, Gnome and KDE fanboys are the most involved. Users won’t notice this at the beginning of the discussion but, latently, something starts growing into their minds: the lusting after an alternative DE.

And here comes the worst.

Gnome users are typical the ones that brag about the cleanness and ease of use of their desktop. They are very likely to be self-convinced minimalists and they love GTK because they are clean and have thin borders and small buttons.

KDE users are the one exhibiting the most pastel-rounded smoothly-animated desktop ever. They claim that KDE is so gorgeous because of the integration of every single bit and every single app. They love Qt: these library are the most comprehensive and powerful library in the world and they should be used by everyone. Typically this kind of desktop has lots of hiccups because of the huge amount of enabled effects that are shipped with the default installation.

LXDE users are the ones that finally are celebrating the right-click implementation on their desktops.

Of course there are also the ones that do not use a DE at all. I think they are blessed.

When two different DE-users meet each other, the flames of hatred burn and there is some sort of vendor-buyer approach in which the two sides defend their position and aims to “convert” the opponent like priests do with people.
And here the seeds of a new change got planted in each other brains.

Typically, the KDE user, is the one that can hardly be convinced to switch because his creed relies upon getting more effects and more candy stuff. Unfortunately, there is nothing more bloated than KDE.

On the other hand, Gnome users are the one looking for more minimalism and less buttons, effects but more shortcuts and accelerators. Luckily for them, the world has plenty of alternatives.

When the alternatives begin being considered, the DE week starts.

During this week, the user installs thousands of apps, libraries that pull billions of dependencies with the sole scope of devastating the system. Notice that the productivity drops to nearly zero. The user gots distracted by new buttons, different applications promoting different semantics in their usage. The user starts tuning up the system, blaming against developers for missing features and, obviously, bugs.
The week has almost passed and the user has only to fix the so called “just two things” when, suddenly, realises that he quickly needs to do the typical thing that he always did with that specific program that he loves so much but doesn’t fit into the new environment.
Oh my sweet good Lord, tragedy.

Googling, aptituding, emerging, pacmanning and you name it. Nothing does feel the same as before, nothing seems to be so awesome as before. There’s nothing left to do if not rolling back to the previous habitat in which everything was just fine. At this point the exhaust user, whose productivity is back at maximum level, will exclaim “Aw, fuck off stupid douchebags. My system r0x and there’s nothing better than it. I will never ever never do that again. I just wasted up one week of my life”.
You know, though, that in one year you will be back at square one.

I want to conclude saying that I truly and sincerely give my deepest sympathy to all Gnome users. I know that Gnome 3 sucks for most of you and I hope you will eventually find your way. Once again.

Posted on Nov 3, 2011

How to enable Airdrop on old Macs running Lion

Airdrop is a feature available in Lion that allows users to easily share files between Macs without sharing a connection to the same Wi-Fi Network.
It uses PAN to provide for p2p connection (like Bluetooth does).
It may happen that your old mac does not carry a Wi-Fi module capable of supporting this type of network but there’s a known workaround to make this possible.
Fire up your terminal and issue

defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

Once you did that, relaunch Finder by Opt+Clicking onto the Finder icon in the dock or by issuing

killall Finder

in a terminal shell.

Now you should have your old-fashioned MacBook running both Lion and Airdrop.

Thank you @LorenzoMMariani that pointed this out to my attention.

Posted on Aug 17, 2011

Automatically update store schema with Core Data

Today I was playing with Core Data technology and I was trying to check whether it is possible to update the store schema according to the changes I made to the entities, relationships and whatever else.

I found out that the important steps are:

  • Use the versioning: before modifying your current schema you should select “Editor -> Add Model Version..”
  • Edit as much as you like
  • Select the new version as the active one
  • Go to your app delegate file and modify the - (NSPersistentStoreCoordinator *) persistentStoreCoordinator method as follows:
    NSURL *url = [applicationFilesDirectory URLByAppendingPathComponent:@"YourApp.storedata"];
        __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
    
    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
    						 [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
    						 [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
    
    if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:options error:&error]) {
    		// The rest of the code here
    	}
    
    return __persistentStoreCoordinator;
    



    The highlighted lines are the one to be added. Please notice that row 8 needs to be updated with options:options. I only tried it using NSSQLiteStoreType as persistent store type but it should work fine even with NSXMLStoreType.

References:

  1. Working with Core Data: Schema Versioning and Lightweight Migrations

Posted on Aug 4, 2011

Migrate from Typo blog to WordPress

Those of you that follow my blog have already noticed that in the past days a major change to the website has happened.

In fact, I moved from Typo to WordPress.
The most difficult part is not to find a theme, fix the CSS, play with the sidebar or anything like that; the mess comes when you have to migrate the data (posts, categories, tags, comments, …).
In order to do so I readapted a Ruby script to work with the latest version of the two blog engines (Typo 6.0.5 vs WordPress 3.1.2). You can find my version here.

To use it, just copy it inside your $TYPO_ROOT/script directory. Then simply issue

RAILS_ENV=production ruby script/wp_export.rb > out.wxr

and wait for the magic to happen.

Once the scripts ends, out.wxr file will contain all the content you had on your previous Typo installation.
In order to proceed, you have to install WordPress Importer, a plugin that allows you to import a WordPress blog from file. Install it, activate it, then import the file generated in the step above and you’re all set.

Posted on Jul 21, 2011

How to burn Lion boot image once installed

Plenty of websites and users have posted the solution to the problem “How can I burn a Lion image onto a DVD?”. What I was really looking for today is a way to get the installation files back in order to be capable of extracting the dmg file containing the image to burn.

The solution is pretty trivial: fire up the Mac App Store and click on the “Purchased” tab on the top. You’ll get the list of applications you have previously bought. Around the top of such list there should be an entry labeled “OS X Lion”. Keeping your “alt” button pressed, click on that entry (on the name). You will enter the Lion page but the install button is now labeled as “Install”. Keep the “alt” key button pressed and click on the “Install” button. The Mac App Store will ask you again for your Apple ID. Issue your credentials and enjoy (once again) the download.

The following steps are the same proposed in many blogs on how to burn OSX Lion dmg image.

After the download completes, go into “Applications” and search for the “Install OS X Lion.app” file. Right click -> Show package content, locate “SharedSupport” directory and pick up the file named “InstallESD.dmg”. Copy it somewhere else and burn it. Oh you just need a common DVD-R single layer.

See ya!

Posted on May 11, 2011

iTerm 2: iTerm successor

I’m not very fond in reviews because I think I’m not really good at it. Anyhow, yesterday I discovered the existence of iTerm 2.

For me, iTerm, is really not an option over Terminal (the terminal emulator shipped with Mac OS X). The latter feels a little bit dizzy starting from the selection (try to select a path in Terminal.app) and ending to the poor tab management in Terminal compared to the one brought by iTerm.

When I hit iTerm 2 website I jumped to the features page to see what’s actually is different and I saw a lot of cool-but-useless things except for three killing ones:

  • The split panes

  • The set mark capability

This latter feature is somehow hidden, in a very loose sense. It allows you to mark a position on your terminal screen and come back to that position with the “Jump to Mark” menu item.
It comes to be very handy when you have commands that print out a lot of garbage and you are interested in reading the output starting from the top instead of the bottom.

There are a lot of more features such as the instant replay (that I don’t think I will ever use it) or the autocompletion (that is somehow interesting but so much time has past since I started using the UNIX console that I don’t think I will remember this feature while using the terminal).

Does it sound interesting? Then give it a try!

Posted on May 1, 2011

Free over-the-air distribution

Few days ago, Matteo Kuzeko, pointed out to my attention a web service that easily allows iOS developers to share they own application over-the-air in order to do beta testing: TestFlight

In my previous related post I briefly told you how to do the same all by yourself; with TestFlight the goal is the same but this service brings altogether few interesting features. Practically speaking, you have to build up a Team. The latter is usually composed by the developers and the testers.
With the online control-panel you can invite people by using their email addresses (one at a time) or you can generate an URL to send to all of them an invitation to join the beta testing.

Once your teammates subscribe to the website, they will have to register their devices as well. Once they do that, the developers have to add their device to the list of “compatible” devices. This step is required only the first time you set up the team.

The cool features that TestFlight brings are the instant report of what’s going on in the team (it displays the status of all the teammates and what they did so far) and it sends notifications every time the developers deploy (and hence upload) a new version of the app. This way the mates are automatically notified by the system.

I found it to be very interesting and quite immediate and I will definitively propose it to my team in the next days.

Posted on Apr 11, 2011

Early 2011 Macbook Pro GPU Switch

Today I tried gfxCardStatus, an application that allows you to monitor whether you are using the integrated or the discrete GPU.

I have nothing to complain about how long lasts my battery, I just did it out of curiosity.

I discovered, on regular basis, that when I open Chrome and I go to a page containing flash video (such as Youtube) the application notifies me that the discrete GPU has been turned on. It is not a big deal. The tricky part comes when you actuallly close the page containing such player.
The application keeps telling me that the discrete GPU is still enabled.

As you can see, from the image below, gfxCardStatus says that there is a process asking for the GPU. This process is Chrome, indeed.

The real problem here is that the only solution to turn the discrete GPU off and switch back to the integrated one is to completely close Chrome. I guess this is because of the Flash Player staying in background even when you close the tab responsible for it.

Then I tried with Safari and the discrete GPU card is not turned on. Furthermore, the same things, for both the scenarios above, happen if I try with the HTML 5 player.

This makes me think that Apple is properly using the discrete/integrated GPU switch and, for third party developers, having set a low threshold (I don’t know on which kind of parameter) in order to turn on the discrete GPU even if it should be unnecessary.

Posted on Mar 9, 2011

Noiseblocker BlackSilent XM2 Fan

Today arrived the new tiny fan for my home-server! In the last days, my old beloved Scythe Mini Kaze begun to produce annoying fuzzy sounds so I decided that was about time to change it.
The problem comes by the fact that I have my home-server in my bedroom and I don’t really stand much the background noise.
My dad brought me an old fan we had in our “tool shed” (the special place where you put everything according to the just-in-case motto) but it was so noisy that I had to stand up from my bed and turn my server down to catch some sleep.
I decided, then, to invest a dozen of bucks in a good fan and actually I did find this Noiseblocker BlacksSilent (the XM2) and seemed good for my purpose. It has pretty much the same tech specs of the Scythe but it is also tachometric meaning that it has the standard 3-pin plug that allows you to control the fan speed and adjusting it from your OS.

I installed it on the server and I fired up my console and started tuning it up using pwmconfig and, of course, fancontrol. Awesome. Now my server can automatically adjust the fan speed according to the CPU temperature so, during the night (if no compilations or something else are running in background) the fan is working at the minimum speed.

For the most curious I paid that fan about 15 euros, including shipping costs.

Posted on Feb 24, 2011

Why the recent MacBook upgrade sucks

This article contains my merely opinion about the recent MacBooks upgrade.
Feel free to ignore this article if you are not interested in non-technical content.

As you have probably already heard about, the Apple new MacBooks are available in the Apple Store. From my point of view this upgrade is really disappointing. They are nothing but the same old MacBooks with a state of the art processor soldered inside.

A question arises: “What did you expect? It’s just an ordinary upgrade, you should have nothing to complain about that”.
Indeed, that’s true. The problem is not Apple’s. The problem comes from all the (inaccurate) rumors surrounding Apple products.

First of all we heard about mockups regarding the MacBook Liquid Metal inspired by the recently introduced dark-gray bar in the Apple website.
This is just a mockup. Something that I, in first place, should have never deceived myself thinking that would have been real.
Then we heard about MacBooks going to become lighter, cheaper and longer-lasting 1. Let me say that all of these rumors didn’t turn out to be true.

1. Longer-lasting batteries: the opposite. The cached version of previous MacBook Pro page states about 9-10 hours of battery. The new one says up to 7 hours. The same occurred for the White MacBook, even if it remained untouched by this upgrade.
Here, actually, Apple is playing a little bit dirty. They claim about having “new, more powerful processor and still having the same autonomy before”. That’s actually untrue, as proven above.

2. Ligher: The weight remained the same.

3. Cheaper: Both version costs the same.

So, beside the processor, the clock of the RAM and the fantastic Thunderbolt port, nothing relevant had changed.

  • Rumors about Apple were going to dismiss the 13 inches white model. It is still available.
  • Rumors about having a third USB port. Fake.
  • Rumors about having the option to remove the Superdrive to leave room for another HDD. Fake.
  • Rumors about having the SSD hard-disk by default on the 15" inches model. Fake.
  • Rumors about having the High Resolution on all the 15" display by default. So fake.

These are the rumors that just came in my mind and I haven’t even begun looking for them. I can bet you have heard even more than me.

Let me repeat that again: it is not Apple fault. It’s all about rumors. We should stop listening to them, websites that claim to be “reliable” should not report them.
Honestly I was thinking about retiring my almost 4 years old MacBook and buying a new one, but all the hype surrounding this upgrade just smashed to the ground due to the facts I aforementioned; so I guess I will wait maybe another year.

Or, if you want to see it in another way, this could be the best upgrade that a late 2010 MacBook owner would have ever imagined.

Oh, of course, if you want to know rumors say that next year will be the “Liquid-metal year”. Screw you.

1 This is actually the first source I found. If you browse the Internet you will find plenty of them.