Write NTFS partitions with Mac OSX Mavericks

If just reading NTFS partitions is not enough and you really need to write them, this short HowTo is for you.

First install osxfuse:

Then install ntfs-3g

which might complain:
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink sbin/mkfs.ntfs
/usr/local/sbin is not writable.

This can be solved by chowning the directory:

Then backup the old and link in the new mount_ntfs file:

Voila, you should now be able to mount and write NTFS partitions. You may get a warning that the kernel extension is not from an identified developer but that doesn’t matter.

Fhem über UMTS updaten

Wegen den längeren Latenzzeiten von UMTS im Vergleich zu DSL scheitert ein Fhem Update über UMTS/3G typischerweise mit der Fehlermeldung:
Can't get controlfile from http://fhem.de/fhemupdate4/svn/controls_fhem.txt

Ein Erhöhung des Timeouts in den HttpUtils brachte bei mir leider keine Abhilfe. Alternativ dazu kann das Fhem per SVN upgedatet werden. Dazu falls nötig zuerst Subversion installieren, Fhem per shutdown herunterfahren und den aktuellen trunk auschecken:

Ein Update kann nun in Zukunft ganz einfach per SVN durchgeführt werden:

Automatically update linux systems

Keeping your computer systems up to date has always been important. But now that word has gotten out that big brother is scanning whole countries networks and actively probes their ports keeping systems up to date is the least should do. Who knows if they are not installing backdoors as well, as a precautionary measure of course 🙂 So at least make it harder for them by keeping your system patched, it can be as easy as installing and running unattended-upgrade:

Now edit /etc/apt/apt.conf.d/10periodic:

and add/edit the following lines:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "1";

Now you can select which updates to run by uncommenting some lines in /etc/apt/apt.conf.d/50unattended-upgrades:

I usually allow security and normal updates but reject proposed and backports.

Solve OS X Prohibited Sign Boot Issue

Recently, I used my MacBook Pro to the end of its battery life and closed it shortly before the battery died. Something must have gone wrong there because when charging and awaking it, the touchpad ceased to work and logon didn’t work. Thus I cold rebooted it and was greeted by a nasty prohibited sign.

OS X Prohibited Sign

Unfortunately, Apple’s own recommendations did not solve the issue, so here is my solution:

Boot into the recovery partition by holding cmd+R at startup and open the terminal.
then

For me this looked like:

start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 409606
409640 916361264 1 GPT part - FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
916770904 1269536 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
918040440 136
918040576 59064320 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
977104896 131
977105027 32 Sec GPT table
977105059 1 Sec GPT header

Apparently the GUID partition table got corrupted at index 1.

To fix this, first unmount the disk:

Remove the corrupt entry:

unmount the disk again:

If the partition was a normal HFS+ partition:

or for an encrypted partition as mine:

Now your partition table should be fixed. In disk utility, unlock your drive if its encrypted. Then repair the volumes and access rights as usual. For me disk utility still complains about a missing EFI Partition, but this is likely due to my refind boot loader.

Update:

After this procedure my recovery partition showed up on my desktop, you can hide it again with:

dblog auf Fhem einrichten

Mit der Zeit sammeln sich selbst in kleinen und mittleren Fhem Installationen viele Messwerte in den verschiedenen Logdateien. Dies ist nicht unübersichtlich sondern erschwert auch die nachträgliche Auswertung. Daher bietet es sich an, diese Messwerte gleich in einer Datenbank zu speichern. Dazu gibt es das Modul dblog dessen Einrichtung hier kurz skizziert werden soll.

Update fhem und falls erwünscht das charting frontend:
update
update thirdparty http://svn.code.sf.net/p/fhem/code/trunk/fhem/www/frontend frontend

Installiere sqlite und Perl plugins:

Alternativ könnten auch MySQL oder PostgreSQL verwendet werden, dazu müssten dann natürlich die entsprechenden Perl Module installiert werden.

und fügen Sie folgende Tabellen hinzu:

CREATE TABLE history (TIMESTAMP TIMESTAMP, DEVICE varchar(32), TYPE varchar(32), EVENT varchar(512), READING varchar(32), VALUE varchar(32), UNIT varchar(32));

CREATE TABLE current (TIMESTAMP TIMESTAMP, DEVICE varchar(32), TYPE varchar(32), EVENT varchar(512), READING varchar(32), VALUE varchar(32), UNIT varchar(32));

CREATE TABLE frontend (ID INTEGER PRIMARY KEY, TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP, TYPE TEXT, NAME TEXT, VALUE TEXT);

mit .tables können Sie überprüfen ob die drei Tabellen (current, history, frontend) korrekt angelegt wurden, mit .exit können sie die Datenbankshell wieder schließen.

Stellen Sie sicher dass Fhem Schreibzugriff auf die Datenbank hat:

Editieren Sie die db.conf:

und fügen Sie folgendes hinzu:

%dbconfig= (
connection => "SQLite:dbname=/opt/fhem/fhem.db",
user => "",
password => ""
);

SSH Access with certificates

To easily access all your computers you may want to authenticate yourself with certificates.

On a Mac, first install the missing ssh-copy-id:

Then you can copy your public key to the ssh hosts you frequently need by:

You may get this warning if the host already is in known hosts:
Warning: the RSA host key for 'panda' differs from the key for the IP address '10.152.196.248'
Offending key for IP in /Users/tatsch/.ssh/known_hosts:19
Matching host key in /Users/tatsch/.ssh/known_hosts:24
Are you sure you want to continue connecting (yes/no)? yes

If that happens, simply delete the offending lines by

and ctrl + K to delete the whole line