Archive for the ‘Tip’ Category

Download and install better Dropbox emblems for GNOME

Saturday, March 6th, 2010

I like , but I don’t like its emblems at all: they don’t fit any existing theme for — so you might want to change them, too. Fortunately there’s someone who prepared a script to do this with ease.

You could also download the same archive from my MediaFire’s account — BTW, that requires to be extracted: I used it since it has been inserted in the kernel.

$ sudo apt-get install lzop
$ lzop -dNp Dropbox\ Emblems.tar.lzo | tar x
$ cd Dropbox\ Emblems/
$ ./install.sh

Of course, can skip the 1st and the 2nd line if you downloaded the file from the official Dropbox’s board; just notice that my archive is a bit smaller, because I got rid of the preview image.

Warning: the original archive contains capitalized files, so you should use ./Install.sh instead. Uninstalling is self-explanatory. The script follows the FHS guidelines, which means that you may use it on any distribution.

Hey, this should be my latest post covering at all… unless I choose to virtualize it in the near future. Well, the penultimate — I can’t miss to say something on the new ’s branding, at least.

There are additional icons you can also download from that thread, but I didn’t install them because they break the emblems I talked above: choosing what’s the best is up to you.

Improve page/post indexes’ accessibility

Saturday, February 27th, 2010

This is just and addendum to a previous tip about in-page anchors: I don’t know if anyone noticed, but I’ve made some little changes to those indexes.

There’s no more to add, but some hints to make the headings more accessible: I’m trying to get those fucking on , too — and it isn’t “so” easy.

First of all, I made the menus’ layout closer to : it depends on how you stylized them via , so I can only suggest you to have a look at the example (just in the upper-right side of the page).

As you might notice, chose to handle the show/hide toggle link… while I’m preferring jQuery instead. You don’t have to make any change there.

I changed other 2 things you could find useful: the 1st implies to use slugs to replace the existing anchors’ IDs. My previous post suggested as follows:

<h3 id="chapter-1">Chapter 1</h3>
<h3 id="chapter-2">Chapter 2</h3>
<h3 id="chapter-3">Chapter 3</h3>

To be clearer, the above IDs used the same semantic prefix – in these cases, chapter- – with ascending integers to differentiate the anchors. Here’s what you should have after modifying them:

<h3 id="lorem-ipsum-dolor-sit-amet">Lorem ipsum dolor sit amet</h3>
<h3 id="ut-wisi-enim-ad-minim-veniam">Ut wisi enim ad minim veniam</h3>
<h3 id="typi-non-habent-claritatem-insitam">Typi non habent claritatem insitam</h3>

I really hope that it helps with the automatic ‘ creation: otherwise, it’s even preferable. Of course, remember to change the anchors accordingly.

The 2nd point I considered is “optional” and lots of people discourage its use: anyway – if you haven’t them elsewhere on the same page – you could add accesskeys to the links.

<div id="toc">
<h4 id="toc-label">Index </h4>
<ol id="toc-toggle">
<li><a href="#lorem-ipsum-dolor-sit-amet" accesskey="1">Lorem ipsum dolor sit amet</a></li>
<li><a href="#ut-wisi-enim-ad-minim-veniam" accesskey="2">Ut wisi enim ad minim veniam</a></li>
<li><a href="#typi-non-habent-claritatem-insitam" accesskey="3">Typi non habent claritatem insitam</a></li>
</ol>
</div>

Some browsers could override them by default, but they won’t hurt: just make sure you aren’t using the same accesskey for two or more different links.

Another thing: looking at the Jeff Starr’s blog (a very useful resource you must read) I noticed anchors to go back to the TOC in plain headings. Those are especially useful to avoid mouse scrolling.

<h3 id="lorem-ipsum-dolor-sit-amet">Lorem ipsum dolor sit amet <a href="#toc" rel="toc">↑</a></h3>

I suggest you to maintain the rel="toc" in the end of the anchor, because it’s a standard reference. Optionally, it’s possible to handle the link with jQuery to get a better scroll to the TOC — I’ll explain how later.

That’s it for now: feel free to post any questions and/or suggestions in the comments (now open to public guests). For those who cares, I didn’t finish this blog’s adoption yet.

How to create a Gentoo USB installation medium (from Ubuntu, as well)

Thursday, February 25th, 2010

GentooIf you’re following my Twitter’s profile yet, you should have read that I’m getting rid of Ubuntu at all: right now isn’t really important “why” — I’ll explain it later on.

Just a quick note on before to get started: it’s possible that I’m not following you yet, because OpenSPF blocks some e-mail notification. Please, be patient and send me an if you’d like to be answered (I get notified on non-followings replies too).

So, I need to have a fully working machine: luckily I have both an old laptop and a netbook in front of me and I can install without data losses.

There are lots of tools to handle creation from CD images, but non of them worked for me: yes, it means that you must use the shell instead. But is it really a problem, moving to Gentoo?

Fortunately, the official Gentoo Wiki helps with the manual creation: of course, it fits Gentoo installations… but I successfully ported it to — it should work for all the other distributions, with little changes.

Removing Gentoo-related steps, it successfully worked on : you just need to install the syslinux package, at least (e2fsprogs should be installed yet).

$ sudo apt-get install syslinux
$ fdisk -l

First of all, identify the correct device: this is particularly important, because errors could definitively damage your existing systems. Make sure you’re going to edit the right partition table.

$ sudo fdisk /dev/sdx

Ubuntu needs to do so as sudoer, while other distributions should require root access: be careful modifying /dev/sdx with your own partition table. Then press the next sequence of buttons: [n] [enter], [p] [enter], [1] [enter], [enter] [enter], [t] [enter], [83] [enter], [a] [enter], [1] [enter], [p] [enter], [w] [enter], [q] [enter].

I know it appears a little bit confusing, so I’ll try to explain what you’re doing in details: if there’s an existing partition on the USB stick, you must delete it before (from fdisk, just press [d] before the above sequence).

With those buttons you prepared a new Ext2 bootable partition and wrote changes to the partition table: you might choose another type, but I don’t suggest you to do so.

$ sudo mkfs.ext2 /dev/sdxY
$ sudo tune2fs -i 0 /dev/sdxY

Warning: sdxY musts be replaced with the correct partition ID. Below, you’ll find some paths and mountpoints directly related to Ubuntu: they should be different in other distributions.

Before continuing, download the latest installation ISO of Gentoo, if you didn’t yet. After that:

$ sudo cat /usr/lib/syslinux/mbr.bin > /dev/sdx
$ sudo mount -t ext2 /dev/sdxY /media/usb
$ mount -t iso9660 -o loop,user /path/to/install-x86-minimal-*.iso /media/cdrom
$ cd /media/usb/
$ sudo cp -r /media/cdrom/* .
$ sudo mv isolinux extlinux
$ sudo mv extlinux/isolinux.cfg extlinux/extlinux.conf
$ sudo rm -rf extlinux/isolinux.bin
$ cd ..
$ sudo extlinux -i /media/usb/extlinux

Now you can easily unmount the USB stick, plug it on the desired device and start the installation process. I may assure that it works correctly on the — this weekly image supports the touchpad too.

For those who cares, I manage to install : you’ll find other useful details on this blog soon. I’m actually building the Gentoo system itself.

Let’s go with the #MusicMonday / 4

Monday, February 22nd, 2010

Mtv ClubbingWhile ~12 millions of Italians were watching a fucking music “festival on , I went to Milano – invited by at the in via Pietrasanta 14, Lombardy – to attend a great club night called in February 19.

It’s a London’s party replied in both Italy and Japan: last Friday it featured – a US duo from New York – supported by (two Italian DJs).

I imagine that none of you cares about my happy night — BTW, I created a photo set on Flickr (far from being complete, actually) that’s related to an event on Last.fm.

But a good news comes from the official web site of Fischerspooner: the latest single, Supply & Demand is freely available for the download in 3 versions and this is really cool.

It was the first party of this year: Victeam got a free radio on Mixcloud too. That’s amazing: I plan to also attend all the next parties with my GF and some friends.

If you like electro music as I do, then you can’t miss these remixes: I’ll publish more freebies in the future for the — especially electronic music tracks.

WebFinger is (almost) ready for GMail

Wednesday, February 17th, 2010

WebFingerSo, profiles got value with the new Buzz social platform: I’ll explain later why and how to avoid amount of updates on to prevent you of being mad for those.

That’s really amazing, but there’s another project started on the Google’s web mail which doesn’t apply to Buzz at all: is a new concept of the finger command for .

If you have both a GMail account and a public profile, then you can access to your personal via WebFinger: in the near future the most common browsers should implement an acct:// protocol to handle its link.

Right now, you could only get an incomplete file to download (at least, from ) using the standard HTTP protocol: here’s mine — have a look at your download folder.

It’s just a useless .part file: you may want to use cURL instead, getting a better output.

$ sudo apt-get install curl
$ curl http://www.google.com/s2/webfinger/?q=acct:foo@gmail.com

Replace foo with an existing GMail alias and you’re done: it doesn’t work with Google Apps, yet. WebFinger is far from being complete, but I enjoyed this idea: it should include public keys and other useful information.

Share on Google Buzz without plugins for WordPress

Sunday, February 14th, 2010

I’ve already talked about and web sites integration with : now it’s time to implement a sharing link on . It’s really quick and simple.

It seems that someone created a plugin to do so, but isn’t really necessary: Buzz uses to share links and you don’t need anything else, but its .

Let’s see how the should be constructed: the snippet below must be inside — you may always change the functions to get it working outside too.

<a href="http://www.google.com/reader/link?url=<?php urlencode ( the_permalink ( ) ); ?>&title=<?php htmlentities ( the_title ( ) ); ?>&srcURL=<?php bloginfo ( 'url' ); ?>/" rel="nofollow">Share with Google Buzz</a>

That’s it. Of course, the rel isn’t mandatory and you can replace the link’s text with whatever you want: I chose Share with Google Buzz because I found this in the Picasa’s documentation for Buzz.

How to use WebKit on IE 7+ serving Google Chrome Frame-ready pages

Thursday, February 11th, 2010

I don’t like at all: I don’t use , so I can’t actually know how this blog is displayed. To be sincere, I don’t care much. But lots of idiots users still use it, and I must ensure an accessible site for them too.

There’s nothing to do for older versions (deprecated yet), but IE 7 and above could be fixed server-side with just a line of code — thank to a ’s plugin. It’s called and overwrites existing s to render pages with .

Even if the official documentation is exhaustive, all the other engines are good enough to avoid this: so you don’t need to modify your HTTP headers at all.

I suggest you to implement this workaround just for IE (using conditional comments):

<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<![endif]-->

Of course, it goes in the head of your page. If you still like to take the advantages coming from headers, make sure to change them accordingly for IE only.

If you’ve ever had a look at the ’s source code, you noticed that it uses a content like IE=EmulateIE7 instead of chrome=1: that’s no longer supported.

I forgot to explain that Google Chrome Frame is an installable plugin, so users must got it on their systems — or this code just won’t do anything.

I plan to explain how to suggest its installation with some hacks later, but if you don’t want to wait any longer it’s all described in the developers’ guide.

Google Buzz and XFN integration

Wednesday, February 10th, 2010

Google BuzzYesterday presented to the world with a conference streamed on : its full registration is yet available too.

I followed all the launch event with enthusiasm: my fears weren’t confirmed. Google Buzz won’t be a replacement, but it’s better than FriendFeed — I left months ago.

I’m still waiting for Buzz availability in Italy, but its s are yet ready to be implemented (even if it’s not active in your country): let’s see how to integrate them in a web site.

The main feature you’d like to make us of is : it consists in an extension to show off your conversations. Unfortunately, it’s not complete yet.

Anyway, it’s possible to claim sites on your Google profile: as described in the guide, it uses to recognize your ownership via crawling.

First of all, make sure to have added your desired site on your profile: I’ve already done it on mine. You should find it with auto-discovery too… and isn’t really important what kind of documents it provides.

So add the XFN’s profile attribute to your head page element (blogs already have it by default):

<head profile="http://gmpg.org/xfn/11">

Of course, you must own a Google Profile yet: who doesn’t? If you didn’t, choose a username for it and add the next link inside your page head element:

<link rel="me" href="http://www.google.com/profiles/foo" type="text/html"/>

Replace foo with your chosen username: the next page crawling will do the trick. Right now, this isn’t “so” useful: you’ll enjoy it with and possibly when ready.

These lines of code just ensure that your web site is connected with Google Buzz: in the near future you’ll add more, for example to share your blog comments on Google.

Getting the closest to perfect time on Linux

Tuesday, February 9th, 2010

Time.isWith – a service I discovered recently – I noticed that servers aren’t all good to get the local time: my clock was ever ~15 sec. late using ntp.ubuntu.com.

So I decided to look for an alternative and I found the : after the change I get a ~0.4 sec. only time delay.

Doing the same is easy: first of all, you have to find the nearest server to sync. It works on all platforms, but I suggest you just how to configure NTP with .

Default installations still use NTP to get the local time, but I’ll show what to do step-by-step — even if you already got required dependencies.

$ sudo apt-get install ntpdate

You don’t need any other package: ntpdate is yet enough. Notice that has 2 different files to edit, while different distributions don’t.

$ sudo gedit /etc/default/ntpdate

NTPDATE_USE_NTP_CONF=yes
NTPSERVERS="ntp.hexago.com"
NTPOPTIONS=""

The 1st line set to yes overwrite the 2nd, so NTPSERVERS isn’t really necessary here: ntp.hexago.com is an -only server (it’s just an example, better than the Ubuntu’s default).

If you aren’t on , it’s possible that you don’t need to edit the file above: the 1st string forces ntpdate to use /etc/npd.conf — provided by ntp, a package you don’t need at all.

$ sudo gedit /etc/npd.conf

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

Create the file if it doesn’t exist yet and customize the servers’ lines to fit your area: the example shows global servers, but I suggest you to look for your country’s… then reboot the system.

If for some unknown reasons your Ubuntu 9.10 box doesn’t read the /etc/npd.conf file properly – and that’s my case, unluckily – you could always create a script to ensure time updates.

$ sudo gedit /etc/cron.daily/ntpdate

ntpdate server 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org

This will sync your clock once a day: doing so definitively confirmed I have the exact time on the Time.is’ web site. BTW, it’s possible that you still need to often update the clock manually.

Why scheduling posts in the past

Monday, February 8th, 2010

I noticed this by chance: scheduling posts in the past is the fastest way to ping them across services. Feeds update immediately, while publishing live and/or in the future requires some minutes.

I don’t think that this applies just for , because the main advantages come from : it notifies faster with the ’s service — in the form of http://goo.gl/fb/foo.

I didn’t notice any affection for the ’s notes (I use to notify my fan pages), but I’m pretty sure it works for too.

Just “pretty”, because I’m still waiting for this blog to be reviewed as needed by the new claiming method. I don’t like it at all… anyway, you only need to schedule your post some minutes before.