Synchronisation von Mac (OS X)-Adressbuch mit FRITZ!Box-Adressbuch

ATTENTION - GERMAN LANGUAGE AHEAD...

The following description is in german, since I assume the bulk of AVMs' FRITZ!Box are sold in german speaking countries.
(Which is a shame, btw, since this little machine is a beauty of engineering and a most capable Router/VoIP/Linux Server/whatever.)


Motivation:

Einmal im Monat schickt mir die FRITZ!Box per E-Mail die Anrufliste des letzten Monats. Dort sind für alle Nummern, die einen Adressbucheintrag haben, der Name bzw. die Firma hinterlegt, statt nur der Nummer.

Also statt:
          16.07.10 12:55;;08912345678;Gigaset C1;Internet: 4989123654123;0:10
steht dann dort:
          16.07.10 12:55;Mustermann, Karl;08912345678;Gigaset C1;Internet: 4989123654123;0:10

Das ist doch gleich viel übersichtlicher, gerade bei vielen Anrufen.
Dafür muss allerdings ein Adressbuch bei der FRITZ!Box angelegt und mit allen Namen und Nummern versorgt sein. Auch dann, wenn sich etwas ändert.

Mein Adressbuch (am Mac) ist immer Up-To-Date. Um nicht jede Änderung auch im Adressbuch der FRITZ!Box machen zu müssen, soll das Mac-Adressbuch automatisch mit dem FRITZ!Box-Adressbuch synchronisiert werden.

Die folgende Anleitung beschreibt die Aktualisierung des FRITZ!Box-Adressbuchs mit dem OS X-Adressbuch auf automatische Weise. Das sieht komplizierter aus, als es tatsächlich ist. Und einmal eingerichtet, sollte der Vorgang ohne weitere Tätigkeiten "einfach" funktionieren.


Vorgehensweise:

Die Aktualisierung erfolgt in drei einfachen Schritten:

1. Export des OS X-Adressbuchs:

Unter OS X ist ein LaunchAgent export_address_book_for_FRITZBox.plist angelegt, der einmal am Tag das Script $HOME/Scripts/export_address_book_for_FRITZBox.sh aufruft.

Das Script exportiert alle Einträge des Adressbuchs mit Hilfe des Python-Scripts iPyFritz.py im Format und mit der Codepage ISO-8559-1 passend für die FRITZ!Box nach myfritz.phonebook.xml

2. XML-Datei für FRITZ!Box verfügbar machen:

Die XML-Datei wird per scp ins Verzeichnis /var/tmp/ der FRITZ!Box verschoben. Dafür ist ein SSH-Server und der Zugang über Public Keys Voraussetzung.

3. Adressbuch auf FRITZ!Box importieren:

Der FRITZ!Box-Befehl pbd erlaubt den Import einer XML-Datei. Dabei wird das vorhandenen Adressbuch ersetzt.

Der Befehl zum Import wird aus dem OS X Script heraus per ssh abgesetzt und auf der FRITZ!Box ausgeführt.
Dafür ist ein SSH-Server auf der FRITZ!Box und der Zugang über Public Key-Authentifizierung Voraussetzung.

Genauso gut könnte der Import entweder per Hand, oder durch ein automatisiertes Script angestossen werden. Leider bietet die FRITZ!Box (aktuell) keinen Automatismus wie crond oder ähnliches dafür an.

Die XML-Datei kann jetzt gelöscht werden.

Quellen:

Voraussetzungen für die Scripte:

export_address_book_for_FRITZBox.sh : 
          Entweder in 
$HOME/Scripte/ ablegen oder die entsprechenden Variablen im Script anpassen.

export_address_book_for_FRITZBox.plist : 
          Muss in /Library/LaunchAgents abgelegt werden.
          Rechner zur Aktivierung entweder neu starten oder Datei per launchctl load-Befehl dynamisch laden.

iPyFritz.py :  
          Entweder in 
$HOME/Scripte/ ablegen oder die Pfad-Variable in export_address_book_for_FRITZBox.sh anpassen.

Comments [0]

Comments [2]

Control Your Mac via a Bluetooth Devices Proximity

 

 

 

The beginning

 

My computers are usually turned on all day long. They idle while I am away having something to eat, am in a meeting, on the phone (which I do walking around) or sleep. At night there are scripts to run to download, synchronize or backup data. If they are not with me on the road or in the office they at least provide the infrastructure for accessing the data I might need. In short: I don't turn them off — only a few of them are allowed to go to sleep.

 

All of my data is stored in my private cloud — pictures, e-books, films, documents, financial reports and the like — and continuously synchronized across all of the machines.

It is thus in my utmost interest to have all of them secured, that way securing the data on them.

 

At home the office door could be locked, though that is annoying if done in short intervals. In the office — or while at a customers' site — the desk I am working at is usually open to everybody.

Securing the screen saver with a password and defining a screen corner to activate it is a perfectly good solution. 

 

But it has been getting tiring to continuously run from one machine to the next, move the mouse in the corner, check the screen saver starting, and hurry off to do whatever needs to be done.

Then reversing all of this by again running from one computer to the next, entering the keyword (often more than once if I happen to make a typo) and all of this just for a(nother) cup of coffee.

 

After a while I got the uneasy feeling that it takes more time locking and unlocking the machine than it does getting — and drinking — the larger part of the coffee...

So automating this has been a long term goal, and geeky as a nerds solution needs to be, it should work automagically.

 

 

 

The need

 

That means the machine (all of them) need to detect if I am with them — or nearby — or not, alas gone. At least something associated with me…

That could be my fingerprint, my voice, my DNA, a hair sample, whatever.

The only things that I always take with me wherever I go are my body, my keys and my mobile. They would provide the signal for the machines to know when to lock and when to unlock.

Body characteristics needs a fingerprint scanner, a DNA sampler etc. and drivers on each machine, keys are just dead weight, but my mobile phone has had bluetooth.

Since bluetooth is a short range wireless technology, it is destined to be used as proximity trigger.

 

I've been experimenting with different apps during that time, among others Salling Clicker, HomeZone, MarcoPolo, Proximity and BluePhone Elite.

Some of those were or are free, most offer a vast array of additional features, like setting the network parameters according to a nearby wireless LAN or some dedicated DNS server.

All very helpful, but not what I was looking for. Going with the philosophy of UNIX, I was looking for small, robust programs that do one thing and do it well and programs that work together.

Not surprisingly, the winner was not one single program, but a combination of apps and scripts.

 

As soon as the Proximity detection was working and the machine locked and unlocked them according to my mobile (and me) leaving the vicinity or coming back, I began expanding the scripts to do a lot of additional things.

 

 

 

The solution

 

The final script does (in the following order)

 

-  offer the user the option to stifle all actions if the connection just got lost randomly (stopping any active screen saver first)

-  inform the user via speech output and Growl messages (if available) about what is going to happen for him to see when he returns

-  log its actions in the system log

-  mute the system volume to avoid any alarm etc. annoying others

-  set the state of the instant messaging clients Adium, Skype and iChat to away/busy/not available

-  set the status message/mood of the instant messaging clients to a predefined value

-  pause the media players DVD Player, VLC, QuickTime Player and iTunes

-  post a message on twitter

-  set the status on facebook

-  start taking pictures from whatever is in front of the computer in defined intervals via an iSight camera, saving the pictures for later inspection

-  start watching for movement so as to detect a possible theft and alarm the surrounding (on machines equipped with the necessary sensors)

-  enable the screen saver password option to prevent anybody messing with the machine (10.5-only!!)

-  start the screen saver, so the machine is locked

-  and turn down the brightness of the screen to save battery (if it happens to run on that)

-  while saving the current states of everything that is being changed, so as to be able to revert it when the user returns

-  in a way suitable for the machine to go to sleep or shut down as well.

 

 

 

The prerequisites

 

-  Proximity.app OS X app that checks a paired bluetooth device (could be a mobile but also a headset or anything else that can be paired with the computer)

-  Proximity_Device_Out_of_Range.scpt AppleScript that is called by Proximity.app when the bluetooth device leaves the detection range

-  Proximity_Device_In_Range.scpt AppleScript that is called by Proximity.app when the bluetooth device enters the detection range

 

 

Some optional features require additional apps, scripts and binaries:

-  Growl.app (optional) OS X app that unintrusively pops up messages from all sorts of sources and intelligently closes them after a while (or not)

-  isightcapture (optional) universal binary used to capture pictures from the internal iSight camera at defined intervals and save then to disk for later inspection

-  fbcmd (optional) perl script to post status messages to facebook

-  take_isight_screenshots_in_intervals.sh (optional) bash script to take pictures unobtrusively as a background job

-  motion_detection_and_alarm.sh (optional) bash script to detect motion while the machine is unattended and sound an alarm, if necessary

 

 

 

The inspiration and sources

 

… about proximity scripts in general:

 

-  for Proximity.app: http://www.technocrat.ca/?p=44

-  for Proximity.app: http://digg.com/apple/Bluetooth_Proximity_Detection_on_OS_X#c5752438

-  for Bash:                http://www.goitexpert.com/general/use-your-bluetooth-cell-phone-as-a-proximit...

 

 

… about AppleScript and bash in respect to what has been used in this script:

 

-  for Date formatting:                             http://www.fischer-bayern.de/applescript/html/datum.html

-  for Screen Saver Password Option: http://forums.macosxhints.com/showthread.php?p=447731#post447731

-  for Table of key codes:                       http://hohabadu.de/?APPLESCRIPT/UIScripting

-  for GrowlHelper.app:                          http://growl.info/documentation/applescript-support.php

-  using Bash from AppleScript:            http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html

-  the machanics behind amstracker     http://osxbook.com/book/bonus/chapter10/ams/

 

 

… additional binaries used:

-  Growl              http://growl.info/

-  isightcapture  http://www.intergalactic.de/pages/iSight.html

-  brightness      http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-ter...

-  amstracker     http://osxbook.com/software/sms/amstracker/

-  fbcmd             http://fbcmd.dtompkins.com/

 

 

… additional information that helped:

-  twitter   http://www.commandlinefu.com/commands/view/176/update-twitter-via-curl

 

 

 

Additional information

 

For additional information please see the comments in the Proximity_Device_Out_Of_Range-Script.

It provides information about the various settings for each of the controlled applications in addition to explanation about why and how certain things have been designed.

 

If you happen to expand the script, let me know. I'd be happy to add your expanded version here.

 

 

Comments [0]

Comments [0]

On the State of the Nation Reading Ebooks

 

I am reading *a lot* of ebooks. In fact, if I'm reading, I'm doing that on my mobile. It's been that way for the last 5 or 6 years.

Since I usually don't leave the house without my mobile, I enjoy reading lots of different media, like RSS feeds, epapers, ebooks and comics in the most unusual situations.

So I do have a vital interest for the media to be available for different devices. And by that I mean the media to be displayed on a variety of devices with a variety of readers without any additional restrictions like an online connection.

 

 

Software: Devices / Stores / File-Formats

 

When I became interested in that way of reading, there were very few readers available and only on a limited selection of mobile devices.

In addition to that, a reader was either tied to some ebooks shop or expected the media to be converted to a proprietary format.

So you were stuck with what that shop offered, if you couldn't find a converter and use what you already have with it.

And you lost everything, effectively, with a change of devices.

That happened more often than I could care for, since I changed devices when changing the employer, because the device was broken and replaced with a newer version, because a firmware rendered the reader software unusable etc.

 

Eventually the bigger vendors offered their reader to more devices, which made it at least possible to buy a new device and *not* loose the books that have been bought earlier. Still, they all used their own proprietary format, offered no compatability to any other reader and were protected by the most arcane techniques. If you happen to switch to a device without that special breed of reader your were using up to then, well, bad luck. That would have severely limited my choice of devices.

 

The only way out was to use any of the free readers and learn to convert the ebooks from one proprietary format into a free format - most often text without formatting. That seriously degraded my reading experience. But then, what else was there?

 

 

Content: ebooks / DRM

 

For a long time I've been happy with what is available for free. There are a number of sites that offer a plethora of good books for free, albeit usually older ones.

 

Since about 2005 there is a trend for modern books to be offered as an ebook version as well. For the longest times, those have been tied to some way of Digital Rights Management (DRM from hitherto). Although that has softened in the meantime, most ebooks and epapers are still "protected" by it. Unlike the music industry, which has finally embraced the fact that DRM is bad for the customer and since then sells it's product legally without DRM, the publishing industry still needs to learn this lesson.

 

So while I am ready to buy a book, I am often forced to hunt the torrent sites for a free version of it. This comes with all sorts of shortcomings, since those are most often scans of the physical books, having been converted to text with Optical Character Recognition Engines (OCR), thus loosing spacing, fonts, sometimes characters, headings, footnotes and more.

Much too often I've regretted paying for a book which I could not read on my device and being forced to use something inferior. When I switched to *first* look for an free ebook and *then* pay for the DRM-infested version or the physical representation, it was a small step to *first* find *and* read it, and pay only if I liked it.

In the end I found myself paying for less and less. Not good, and not what I intended. But thats what i found myself forced to do, thanks to DRM.

 

Even worse, there is no single DRM standard. It comes in all sorts of flavors, still only compatible with a certain type of reader. Usually the one reader I do not have or want, since it is not compatible with my device, costs money (in addition to the book itself) and/or are ugly as hell and a PITA to use.

Not to mention that those readers sometimes need online access to verify my identity, that of my book, my "rights" (read: if I'm allowed to read a certain book at all) and whatnot. Sometimes I have to enter the credit card number with which the book was purchased, sometimes I need to authorize myself at some website or register the reader application with some service. Most of this isn't working without online access (in the metro, on vacation abroad, in my study in the basement) and will not work if any of the services in this chain fail, or the company goes out of business, my credit card number changes etc. Cory Doctorow has written about this nicely in one of his essays.

 

A member of the forums I frequent has put this much more eloquently:

I would agree with you if every device supported it. But, DRM is vendor lock-in... nothing more. It's about money not copyright protection. Content owners WANT you to have to buy the same content over and over.

Many of us have done just that, going from records to 8-track to cassette to CD and now to digital. They publishers want it to be illegal to rip our CDs to digital because they think we should pay for the music again. They don't consider that we "OWN" the content the consider that we own the media only... and if we want it on a different format we have to pay again.

 

So in the year 2009 I am still stuck with an ebook in some format, with some sort of DRM that requires some special breed of reader. Either I succumb and install the nth reader on my device - if that type of reader is available at all - and learn to use it or I'll try and convert the ebook in something usable. Some format (think txt, epub, pdf, ...) that allows me to read it with the reader of my choice, no matter what hardware/device on at the time I want for as long as I want without any additional infrastructure needed.

 

As a matter of fact, I am a very law-abiding citizen. But not stupid.

I've opted for the second choice. It's illegal in most countries, even although I do nothing else than to convert something I already paid for to a format that I can use.

Tags  //   DRM   E-Books  

Comments [0]

Free epubs from Adobe ADEPT DRM

If you were referred here for instructions and don‘t care about the mechanics and underlying problems behind it, jump down to the next heading.

 

Background

 

Adobe has been pretty successful in propagating their interpretation of DRM in the publishing sector. They made a big change from Adobe Reader 6 to 7, which included an update of all certificated.

[I still have book which I can read only with a certain older version of the reader. A version that is not able to run on Windows 7, for example. Now *I* need to make sure I can read this book by setting up a virtual machine with some old operating system and an antique version of a software just to be able to open that ebook. Repeat after me: DRM is bad for the customer!]

 

Adobes newest brainchild is the "Adobe Digital Experience Protection Technology", braggingly shortened to "Adobe ADEPT".

It's the first implementation (that I am aware of) of DRM for the epub format. It also supports PDF and is - of course - well integrated in the Adobe Suite of programs.

ADEPT is also an Application Service Provider model, where the buyer of an ebook only gets a "voucher" (Adobe-speak; its a well-formed text file named "URLLink.acsm") from the book seller, and Adobe provides the reader and the infrastructure to present the content, the book, to the reader.

That way, Adobe - and the publisher - are always in control of the ebook. The right to read / print / copy&paste could be changed or removed in an instant, for example, if the account with which the book was bought is compromised, if the publisher goes out of business, if a payment hasn't been made, etc.

Read: If either Adobe or the publisher think you are not entitled to the book anymore, it's gone for good. Have a nice day.

 

Apart from the backend infrastructure of servers and authentication mechanisms, Adobe provides the software for managing and reading the ebooks. It is called "Adobe Digital Edition". [Good choice. "ADE" means "Good Bye" in german]

It opens the "voucher", knows what book has been bought and would download the content. For that to do, the application itself has to be authorized to download the content and the customer has to be authorized to be allowed to read the book.

 

So to work, a customer needs

- an account at the book store

- download and install Adobe Digital Editions

- download and install Adobe Flash (since that is the underlying framework for ADE)

and optionally

- an account at Adobe ("Adobe ID")

- authorize ADE with the Adobe Accout for one of six machines

 

You should go for the optional steps if you plan to setup or change computers eventually in your life, since otherwise your ebooks won't be readable anymore...

 

Then the customer can

- log in with the account at the book store

- buy a book

- receive a "voucher" (URLLink.acsm)

- open voucher

  -- which itself opens ADE

  -- which asks the Adobe backend for the encryption of the ebook with the customers Adobe ID

  -- downloads the ebook to a directory named Mac: Digital Editions / Win: My Digital Editions

  -- decrypts the ebook

  -- display s the ebook

 

 

Fortunately, some very bright people have thought about the Adobe ADEPT DRM, have found a flaw in the architecture to exploit and have written some small python scripts to

a) fetch the users key with which Adobe encrypts the ebooks for this user and

b) decrypt an ebooks with the user key to another file on disk,

thus making an unencrypted, DRM-stripped version of the original file.

After that, neither the user key nor the original DRM-encrypted ebook are needed.

The saved key should be kept in a safe place. With it, all future ebooks protected with ADEPT DRM can be decrypted.

 

This works for PDF- as well as epub-ebooks, though the following example concentrates on epub.

 

 

Follow the steps to free the purchased ebook from its DRM on a Windows machine

 

First, the installation orgy...

1.a Install Adobe Flash, as this is needed for Adobe Digital Editions via http://get.adobe.com/flashplayer/

1.b Since Adobe Flash will only be available if the Adobe Downloader is used, install that shit as well.

1.c Install Adobe Digital Editions via http://www.adobe.com/products/digitaleditions/

 

1.d Once this is installed you'll be prompted about "authorizing" your copy of Digital Editions. This must be done to create your own personal key. You can use either of the activation options. Using "this machine only" saves you setting up an Adobe ID.

 

 

2.a Installed Python via http://www.python.org/download/

2.b Install PyCrypto via http://www.voidspace.org.uk/python/modules.shtml#pycrypto

 

 

3. Download the decryption scripts from the post right below this one and put them all in one directory.

 

 

Now, the decryption...

4.a Run ineptkey.pyw

This fetches the key and writes it to disk as "ADEPTKEY.DER " in the same directory ineptkey.pyw is in.

 

4.b Run ineptepub.pyw

A small dialog pops up with three parameters:

- Key file ADEPTKEY.DER

Should be filled automatically, if the ADEPTKEY.DER-file and ineptepub.pyw are in the same directory

If not, klick on the …-button on the right hand side and hunt for the file.

- Input file

Klick on the …-button on the right hand side and choose your ebook. You'll find it in "My Documents\My Digital Editions".

If you just can't find it, open Digital Editions and look the the proporties of the ebook. It tells you where it's saved.

- Output file

Klick on the …-button on the right hand side and enter a filename. Something like BLA.EPUB would be sensible.

 

Done. Open your newly created, DRM-stripped epub in your favorite application. Read it whenever and on what device you want.

 

 

Credits:

These scripts as well as the instructions have been made available by some very intelligent people.

I've elaborated on the instructions given by Ilovecabbage and others for the sole purpose to remind me how I proceeded even if the original websites vanish from the interwebs...

All credit goes to i-u2665-cabbages!

 

 

Source:

http://i-u2665-cabbages.blogspot.com/2009/02/circumventing-adobe-adept-drm-for-epub.html

http://www.adobe.com/support/digital...tions1x7x1.exe (Thanks Anson!)

 

Tags  //   ADEPT   Adobe   Crack   DRM   Decrypt   E-Books   PDF   Script   epub  

Comments [2]

INEPT-Scripts

Click here to download:
ineptkey.pyw (7 KB)

Click here to download:
ineptepub.pyw (12 KB)

Click here to download:
ineptpdf.pyw (49 KB)

Tags  //   ADEPT   Adobe   Crack   DRM   Decrypt   PDF   Python   Script   ebook   epub  

Comments [0]

Über den Autor

This is my collection of IT-related articles.
More of a backup for myself than a typical blog.