fake's blog

everything fake

Keyword - osx

Entries feed - Comments feed

one-liner for changing file endings

i have not been blogging for quite some time, i noticed when replacing the blog software; so now i keep constantly thinking about what i may blog, so a little more density in the posts evolves ;-)

here's today's note; i just needed it and figured someone might say "aaw! that's useful" - a one-liner to use in bash for changing the extension of given files in a directory. bash is the shell that is by default installed in mac os x, and opens when you start the "Terminal" application. It is also the default in almost all linux distributions.

in this example, i rename all .mp4 files to .m4v (thanks, ps3...). adapt as needed.
for i in *.mp4 ; do mv "$i" "${i%%mp4}m4v" ; done
the %% operator strips the string following it from the end of the variable's content. the ## operator does the same, but at the beginning of the string.

exportPB4Fritz updated

i just updated the exportPB4Fritz.py skript so it can handle contacts that do not have a first, but a lastname set. a minor fix, of course, just thought i'd quickly replace the version from the original posting so people not into python can use it with "interesting" os x address books ;-) the download url is the same, it's in the blog post linked above.

AVM Fritz! Box vs. OS X Address Book

I am a pretty happy user of a freetz'd AVM Fritz! Box 7140 for a while now, the only thing bugging me was the lack of an address book import built into the box. i tried messing around with the /var/flash/phonebook file, but for some reason my xml files kept being rejected. ultimately, i found a utility called "Fritz!box Monitor" or short FBM, which is supplied by AVM. It can import CSV files in a certain (pretty weird) format, so i re-wrote my xml-generator to print out that format instead. FBM's a windows program of course, so fire up your parallels/fusion/qemu/whatever. You have to edit fritzboxmonitor.ini in it's program directory before using this, and set the key ExportAll to 1. I also set the AutoSpeedDial entry to 0 because i don't use speed dialing and thus the csv exporter doesn't support it. The exporter is written in python, i used this script as a basis. It's an ugly quick hack, so bear with me. It should work with mac os x 10.5.5 stock python, probably earlier, too. You can find the exporter script here. i also came up with a version that exports to a windows-addressbook-reimportable format; i use it to push my contacts to a siemens gigaset sl56 bluetooth enabled dect phone, which only supports a windows program as source either. that version is here.