Archive for November, 2012

How to download an entire website for off-line reading?

November 30, 2012 Leave a comment


You want to download an entire website (e.g. a blog) for offline reading.


wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL

Tip from here.

Categories: bash Tags: , , ,

Free Online Clocks for Your Website or Blog

November 28, 2012 Leave a comment

Customize the clock, copy the generated code and paste it in your website or blog.

Categories: Uncategorized Tags: ,

Binary representation of an int in C

November 27, 2012 Leave a comment


You want to visualize the binary representation of an int in C.


#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

char * int2bin(int i)
    size_t bits = sizeof(int) * CHAR_BIT;

    char * str = malloc(bits + 1);
    if(!str) return NULL;
    str[bits] = 0;

    // type punning because signed shift is implementation-defined
    unsigned u = *(unsigned *)&i;
    for(; bits--; u >>= 1)
        str[bits] = u & 1 ? '1' : '0';

    return str;

int main()
    printf("%s\n", int2bin(0x3d));
    printf("%s\n", int2bin(-0x3d));

    return 0;



In the case of the negative number you can nicely see the two’s complement of the positive number.

I found the C source here.

Play Youtube videos with VLC

November 27, 2012 1 comment

Did you know that VLC media player can play Youtube videos? Neither did I. Try this:


Does Flash break all the time? Use VLC :)

Tip from here.

Categories: Uncategorized Tags: , ,

Update your Nvidia driver to 310.19

November 20, 2012 Leave a comment

Here is how to do that.

In short:

sudo add-apt-repository ppa:xorg-edgers/ppa 
sudo apt-get update 
sudo apt-get install nvidia-current nvidia-settings

Then restart.

Categories: ubuntu Tags: , , ,

Youtube audio player

November 20, 2012 Leave a comment

At I found a nice trick to embed just a part of the Youtube Flash player, thus the player looks like an audio player. All you need is a little CSS trick:

Categories: firefox, google, html Tags: , , ,

Locate big emails in Gmail

November 16, 2012 2 comments

Gmail supports an undocumented ‘size’ search operator that will let you quickly find all the big emails in the mailbox whose size exceeds a particular threshold. The search syntax is:

size:[size in bytes]

To give a real example, a Gmail search query like ‘size:5242880’ will list all big emails whose size is 5 MB or greater while ‘size:10485760’ list messages that are bigger than 10 MB.

From here.

Categories: google Tags: , ,