czwartek, 17 grudnia 2009

The cat is alive

Result wasn't known until the box was opened;)

PL: Rezultat nie był znany dopóki nie otworzono pudełka;)

wtorek, 15 grudnia 2009

One-liner script to count approximate number of messages in pidgin

You can use this script to counts approximate number of messages from Pidgin history(works only in plain-text archive, not in html). Replace UPPERCASE with appropriate info.
cat .purple/logs/PROTOCOL/MY_PROTOCOL_ID/FRIEND_PROTOCOL_ID/* | grep -w FRIEND_ALIAS | wc -l

where
PROTOCOL is protocol you use for a talk, for example irc jabber or gadu-gadu
MY_PROTOCOL_ID is an ID that you use to log in protocol (if you are only user of pidgin there would be only your folder so you can probably auto-complete it by tapping TAB)
FRIEND_PROTOCOL_ID same as MY_PROTOCOL_ID but for your friend
FRIEND_ALIAS alias that you gave to your friend in pidgin(it is shown before any of his messages), or your alias if you are interested in number of your messages
jabber example:
cat .purple/logs/jabber/me@gmail.com/friendName@gmail.com/* | grep -w friendName | wc -l

Of course script have serious drawbacks, because if you have changed someone alias, or use it often in your messages results would be heavy biased, but otherwise should be good enough approximation.

Krótki skrypt zliczający liczbę wiadomości wysłanych przez użytkownika Pidgina
Skrypt pozwala znaleźć przybliżoną liczbę wiadomości które do kogoś wysłaliśmy, lub od kogoś otrzymaliśmy
cat .purple/logs/PROTOKÓŁ/MOJE_ID/ID_PRZYJACIELA/* | grep -w ALIAS_PRZYJACIELA | wc -l

przykład gadu-gadu:
cat .purple/logs/gadu-gadu/1234/4321/* | grep -w Staszek | wc -l

poniedziałek, 14 grudnia 2009

PyShare - Nautilius scripts are only the beginning

PyShare is quite succesfull as a nautilius script, but it can do better. For now we focus on making it simple to share anything that you drop on it (or send by it using nautilius script), but PyShare cannot be ulitmate app good for everything. Wouldn't it be cool to share images directly from f-spot or movies from totem? I think that it would so I plan to make a PyShare minimal package that would have very light depedencies, that could be used as CLI or as library. API would be simple - give PyShare a file, and you will get links back.