Arxiu de la categoria 'English'

Power off a USB device

dissabte, 12/05/2012 (10:11) per carles

I wanted to power off a USB device. Searching in Google for “power off usb” returns different results but I didn’t succeed with any of the suggestions (Linux version 3.2.0).

I asked in the linux-usb mailing list (question, see one of the relevant answers (from Alan Stern). In short: not possible. Using a USB hub it’s then maybe possible -some models only-. The answer includes a link to a small program to try to disable the port. I could disable the port, but the device had still power.
(més…)

Wood Green to Farringdon travel duration

dissabte, 21/04/2012 (12:20) per carles

Every working day (except holidays) I go to work. So I leave home and walk to my local tube station: Wood Green. Then I get a train to Kings Cross where I change the train to Farringdon.

Some days, if Piccadilly Line has delays, I change in Finsbury Park. For some weeks, 1 or 2 years ago, I used to always change to Victoria line but I decided that it’s not worth. Now I change in case of delays or if I’m standing up and squeezed in the Piccadilly Line and/or the Victoria Line train is just there.

The TFL webpage allows to download the last month or two months travels using a CSV file (I’ll check for some API, etc.).

I did some quick stats to find the distribution of the time. The most interesting result of that period of time (between 15th February and 5th April, but I was 2 weeks away from London) is:
(més…)

Petronas tower: ticketing system

dissabte, 14/04/2012 (13:22) per carles

As I said before, I went to Malaysia. Beside going to the Endau-Rompin jungle I also went, of course, to the Petronas Tower (Kuala Lumpur).

The system to get tickets in the Petronas Tower is to go there at morning and buy tickets for the same day. They only sell tickets for the same day, and Internet says that it’s sold out at morning, so you need to arrive early.

One month before going to the Petronas Tower I had a bad experience trying to visit Leonardo da Vinci exhibition in London. So this time I wanted to be sure that I would get the tickets. On the Internet they always say “it’s important to go there early” or “7:30 should be enough, but who knows”. There is one advantage of going early: you can choose what time you want to visit it. Maybe you buy the ticket at 10 but the only available slot is at 17:00, so you would not have lot of freedom in that day in Kuala Lumpur.

Well, knowing that… I woke up at… 5:15? I arrived to my metro station at 5:40. Oops, first surprise: the metro opens at 6. I waited 20 minutes and I got the metro to the KLCC station.
Obviously, the metro was quite empty:

(més…)

Google searches

dissabte, 24/03/2012 (13:21) per carles

Some time ago I spent a little bit of time searching in Google to know how many Google queries / searches I could do, using some automatic way like a script. Just to know which is the limit of queries that they expect from one user.

I didn’t find an answer. I found some Google API with a limit of the number of queries, beyond that they were charging some cost. But that was for the API, not for the standard searcher.

Then I took the experimental approach: I did about 160000 queries using a Python script, waiting 4 or 5 seconds betweeen each query. They didn’t block the IP, add any captcha or anything at all.

In case that anyone was wondering that: they know now. I haven’t done tests reducing the time between queries.

Why I did that? The results will be soon here. Stay tuned.

Endau-Rompin jungle and leeches

diumenge, 18/03/2012 (16:44) per carles

A few weeks ago I went to Malaysia. My longest holidays ever, first time in Asia.

At one point I didn’t know if I would go to Singapore or to Endau-Rompin jungle. Singapore was easier for me (less adventurous) but I really wanted to have a taste of 2 nights in the jungle. At the end I went to the jungle.

In that jungle everyone knows that it’s full of leeches. Full like… really full! You stand just a moment, watch to the ground and you see them coming to you. I’m not joking.

I bought some leeches socks in Amazon. They are very good. When my guide was stopping to remove his leeches from his feet, I was stopping to remove the leeches from my socks. I was in the jungle for about 5 hours, no leech got me.

The socks are from a special material (not like standard socks, the leeches would probably go in) and they are worn on your socks and trousres. So you look funny:

Instead of looking disgusting (in my opinion, for my standards, this is the guide’s feet):
(més…)

Cukey

diumenge, 18/09/2011 (19:56) per carles

Vaig veure la paraula «Cukey» en algun lloc, i m’agrada. Urbandictionary diu:
“”"
A combination of cute and geeky. Used in the iCarly episode: iSaved Your Life:

girl: “You’re cukey”
computer guy: “What’s that?”
girl: “A combination of cute, and geeky!”
“”"
To contact me: cukey@pina.cat

Screensaver for KDE using Python and Pygame

diumenge, 11/09/2011 (19:49) per carles

At Mendeley we have already done two hackdays. That’s quite interesting event: during a period of time (first one was on Friday until late night or overnight, second one Saturday and Sunday) we do whatever we want to do, it only needs to be a bit related with Mendeley.

On the last hack weekend I did a screensaver using Python, which one is integrated with KDE. Probably with some small changes would work in other systems.

In this entry I’ll cover the basic of the screensavers in KDE (how to integrate the new screensaver in KDE), and how KDE interacts with the screensaver. You should know a little bit of Python and Pygame, but if you don’t know you can still understand the code and do the same using other systems.

The code is in Git. Or if you want the quick example look here.

(més…)

Pidgin plugin for MegaHAL

divendres, 18/03/2011 (17:11) per carles

Some time ago I wrote how to setup MegaHAL to have some talks with “it”.

But, after that, I went one step further and I wrote a Pidgin (multinetwork -Jabber/XMPP, msn, etc.- Instant Messenger client,plugin) so MegaHAL can automatically answer some people. In other words: you can say “for this Instant Messenger account, when this contact writes to me Pidgin will automatically answer some text using MegaHAL”.

(Warning: some people can get upset if they think that they are talking with you but they are talking with MegaHAL. Even if MegaHAL learnt from you and the co-worker chat logs.)
(més…)

Megahal: how to use it?

diumenge, 13/03/2011 (19:50) per carles

Megahal is a conversation simulator, free software, available as a package in Debian systems. This post will talk about how to use and train it. Not difficult, but the first time I was a bit confused.

First of all: install megahal:
apt-get install megahal
(or aptitude, compile from the source, etc.).

Then you can run megahal in the terminal, just typing megahal. It will probably show something like:

(més…)

Socks server, easy way: ssh

dimecres, 28/04/2010 (23:20) per carles

Short article:
I love ssh (really, what a nice piece of software, tunnels, reverse tunnels… and sock servers!):
ssh -D 1080 user@server
Setup your favourite application to use the socks server on localhost, port 1080. ssh will send to “server” the communications, cyphered. And from there to the world.
If your favourite application doesn’t have socks support: install tsocks and wrap your application with a tsocks call:
tsocks application
(you need to setup the server in /etc/tsocks.conf)

Long article:
I wanted to watch from London a basketball match that was broadcasted in the Catalan TV (and Spanish one) but only for Spanish residents.
(més…)