Finding duplicate files or directories with Linux

Posted on March 18th, 2007

by Zhenech

I think everybody knows this situation: the collection of $FOO has grown over the years and you may have some duplicates in it. Even disk space isn’t very expensive anymore, the fact of having duplicates annoys me. So today I had some spare time and started cleaning up my drives. In directories with 20 or 30 items this is quite easy, but what is when you have a directory with 1500 items? Ask your favorite shell, but before you can do this, you need to look up a regex-pattern which matches the usual naming sheme. I usually have $FOO-$BAR-some-shit or $FOO_-_$BAR-some-shit and $FOO and $BAR are the only interesting information. Because of this, my pattern looks like ([a-zA-Z0-9]*)-([a-zA-Z0-9]*).* - I have to groups of alphanumerical-stuff, divided by a hyphen and do not care for the rest.

But I still do not know, where my duplicates are, so I ask my favorite tools: my shell (zsh, but this works with every POSIX-shell), sed and uniq:

ls /foo | sed -e ’s#[^a-zA-Z0-9-]##g;s#\([a-zA-Z0-9]*\)-\([a-zA-Z0-9]*\).*#\1-\2#’ | uniq -id

This lists the contents of the /foo directory, strips all the non-alphanumeric characters, reformats the string to show only $FOO and $BAR and then shows the duplicates case-insensitive.
In my dir with 1500 items I got about 70 duplicates, most of them were really positives, only some few false-positives because of the stripped "some-shit" at the end.

Hope this helps someone, but I also would love to see your comments how the search for duplicates could be improved.

Firefox^WIcewesel search with BlackBox RELOADED

Posted on March 18th, 2007

by Zhenech

Everybody knows, that Google isn’t evil, but they still collect some data and stuff, so people dislike it. But Google also gives the best results for searches. So what to do? Yeah, use BlackBoxSearch (by the way, nobody said, they are not evil too…). But there is some uncomfortability: I do not like to go to some website to do a search and I do not like to use the Firefox^WIceweasel search box in the right corner either - it’s just too far away from the address-bar. Yepp, I usually use the address-bar for searches, just type some keywords in at it redirects you to Google. But I wanted BlackBox - what to do?

It is quite easy - but it took some time to figure out, that the right config string is keyword.URL - nothing with "search" or "google" in it.
So just open about:config in your Firefox^WIceweasel and search for keyword.URL. It should be set to something like "http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=", so we change it to http://www.blackboxsearch.com/cgi-bin/searchGoogle.cgi?q= et voila - after typing some random shit into the address-bar, we get results from Google proxied through BlackBox.

Yay for teh non-evilness!

PS: When you read http://www.google-watch.org - never forget to read http://www.google-watch-watch.org/ ;-)

How Nerdy Are You?

Posted on March 17th, 2007

by Zhenech

You Are 36% Nerdy

http://images.blogthings.com/hownerdyareyouquiz/nerd-2.jpg

You’re a little nerdy, but no one would ever call you a nerd.
You sometimes get into nerdy things, but only after they’ve become a part of mainstream culture.

How Nerdy Are You?

http://www.blogthings.com/hownerdyareyouquiz/

Teh Ubuntu Pimp

Posted on March 14th, 2007

by Zhenech

http://www.gnome-look.org/CONTENT/content-pre1/54592-1.png

Via can-filip, #debian.de, IRCNet

GPRS unter Linux mit Nokia 6230i und ALDI-Talk (E-Plus)

Posted on March 14th, 2007

by Zhenech

Ich habe ja bereits vorhin beschrieben, wie man mit Linux per GPRS ins Internet kommt, wenn man ein Nokia 6230i mit Datenkabel und Vodafone hat.
Auch habe ich geschrieben, dass ich mit den Preisen von Vodafone überhaupt nicht zufrieden bin. Deswegen war ich vorhin bei ALDI-Süd und hab mir so ein ALDI-Talk Starter-Set geholt. Kostet 14.99 und enthält 10€ Guthaben. IMHO voll okay das Angebot, vor allem weil das MB Traffic nur 24 Cent kostet.

ALDI-Talk arbeitet ja, wie auch Simyo, Blau.de etc, im E-Plus Netz. Deswegen musste ich mein ppp ein wenig umkonfigurieren, damit es klappt.
Im Endeffekt musste ich aber nur den Zugangspunkt von web.vodafone.de auf internet.eplus.de stellen.

# diff /etc/chatscripts/vodafone-gprs /etc/chatscripts/eplus-gprs
12c12
< OK ‘AT+CGDCONT=1,"IP","web.vodafone.de"’

> OK ‘AT+CGDCONT=1,"IP","internet.eplus.de"’

Wer nicht flüssig diff-lesen kann…
chatscript (/etc/chatscripts/eplus-gprs):
TIMEOUT 5
ECHO ON
ABORT ‘\nBUSY\r’
ABORT ‘\nERROR\r’
ABORT ‘\nNO ANSWER\r’
ABORT ‘\nNO CARRIER\r’
ABORT ‘\nNO DIALTONE\r’
ABORT ‘\nRINGING\r\n\r\nRINGING\r’
” \rAT
TIMEOUT 12
OK ATE1
OK ‘AT+CGDCONT=1,"IP","internet.eplus.de"’
OK ATD*99#
CONNECT ""

peer (/etc/ppp/peers/eplus-gprs):
connect "/usr/sbin/chat -v -f /etc/chatscripts/eplus-gprs"
/dev/ttyACM0
115200
noipdefault
usepeerdns
defaultroute
persist
noauth

Interessanter Weise hab ich zwar vorhin 20KB Traffic gemacht, mein Guthaben ist aber immer noch bei vollen 10€. Die Jungs sind wohl etwas langsam.

Mal die Tage mit Papas UMTS-Handy schauen, ob das auch klappt :>


design: makequick.com | modificashuns and bugfixes by jesse
bottom