General MacOS

MacOS keychain with AWS CodeCommit

Using temporary credentials (access-tokens) with AWS CodeCommit and git clients can be hard with MacOS. The Keychain saves those credentials and after ~15min you must renew them (remove them manually from the keychain). And if you have also to work with repositories other than AWS (like GitHub, GitLab) its even worse. But since recent git versions (>2.9) it is possible to reset the credential helper by Git-Host!

Using the git credential-helper for CodeCommit repositories only:

[credential "https://git-codecommit.eu-central-1.amazonaws.com"]
  helper=!aws codecommit --profile developer-cloudformation credential-helper $@
        UseHttpPath = true

It’s important to add that „helper=“ line. Regularly the global git config contains a „helper=osxkeychain“ line and those helper-directives are additive – but the „helper=“ line breaks/resets that inheritance.

Allgemein MacOS Programmierung

MacOS Photos and AppleScript

Just about to move from Adobe Lightroom (CC) to native Apple Photo App/iCloud (but thats another story).

Unfortunately most of the old AVI videos got a wrong date during the import (not the file-creation date but the date of import). Not helpful. Fortunately Lightroom had set the date/time into the filename, so I should be able to set it from there.

In the end I spent my first night with with AppleScript – thats the outcome:

tell application "Photos"
  set imageSel to (get selection)
  if imageSel is {} then
    error "Please select some images."
    repeat with im in imageSel
      tell im
        set imageFilename to filename of im as string
        set d to current date
        -- filename format: 20030316_160816_03498.avi
        set the year of d to text 1 thru 4 of imageFilename
        set the month of d to text 5 thru 6 of imageFilename
        set the day of d to text 7 thru 8 of imageFilename
        set the hours of d to text 10 thru 11 of imageFilename
        set the minutes of d to text 12 thru 13 of imageFilename
        set the seconds of d to text 14 thru 15 of imageFilename
        set the date of im to d
      end tell
    end repeat
  end if
end tell
return input

Jetbrains search&replace with regex backreferences

Note for me: Documentation.


\"date" => "(.*)\.(.*)\.(.*)"


\"date" => "20$3-$2-$1"

The example replaces an old-fashioned German date string (24.02.2014) into ISO format (2014-02-24).


ls -la file listing with date and time

to display always date and time at file listings (also for files that are older):

ls -la --time-style=long-iso
Allgemein MacOS

MacOS Mojave font rendering

MacOS Mojave made my fonts look terrible when using the non-retina, old fashioned „Apple Thunderbold Display“. However Ahmad Awais fixed the issue for me:

defaults write -g CGFontRenderingFontSmoothingDisabled -bool FALSE

Cloud storage cost calculation (backup/restore)

Related to my offsite-backup with restic project I recently wanted to choose an cloud-provider as backup target. But that seems not an easy decision. Besides the costs for storage and traffic things getting complicated when it comes to restore: Pricing differs here from $10 to $1300 for a single restore of 500GB!

Although I use mainly AWS for my business projects I consider to use google cloud storage for my private backup. Main reason for me is that the restore options for AWS S3 Glacier are not easy to predict and the costs could be very different.


Cloud backup with restic

Yes, I’ve tried multiple approaches in the past to get an offsite-backup up and running. I’ve used rsync first and then obnam and duplicity with encryption. Both successful with remote ssh-hosts.

But times are changing and I wanted to use a cloud-storage provider now instead of a dedicated remote host for my backups – so I started with duplicity/duply to get AWS S3 access running – that worked quite good.

But for some reason I discovered restic on github and gave it a try (maybe because of this introduction)

Things I like:

  • growing user base on GitHub
  • its encrypted (very interesting read on this)
  • uses deduplication
  • usage is straightforward, no hard to read config-files with dozens of options
  • no full-/incremental backups, every backup is a „snapshot“
  • they’re promise to not change the repository format in the future
  • access to cloud providers (tested AWS S3 and Google Cloud Storage) went very easy
  • its using a local cache to speed up (but is not sticked to that)
  • you could move the backups to different locations using standard tools and they’re still usable
  • local backups (like on USB-drives) could be achieved the same way: every destination is considered as „remote“ and is encrypted

Documentation is good, so I won’t share usage details here. But I’ve started backups to Google Cloud Storage last week and it feels great…


postfix: redirect mails for root

Short note: redirect local root mails (cron, mdadm, …) to an external address:

# install postfix
apt-get install postfix
# add alias for root
echo "root: otto@example.com" >> /etc/aliases
# reload aliases for postfix

Vigor 130 Webinterface / PPPOE passthrough with Sophos UTM

The Vigor 130 works very well as VDSL (Vectoring) modem in connection with a Sophos UTM. Therefore the modem is configured in PPPOE pass-through mode – this way all connection related details like credentials are configured by the Sophos UTM.

Because the vigor 130 has only one Ethernet interface I always had to re-plug some network cables just to watch the DSL status via the webinterface of the „modem“.

Here are some hints on how to connect to the modem interface (using just basic routing).

In my case my LAN subnet is

Place the modem into an additional Subnet

here:, ip of the modem:

create a static route

the vigor allows not to change the default route, but that is also not neccessary if you have only one LAN subnet.

Add an additional address to the Sophos WAN interace

In my setup the WAN interface is used as PPPOE interface for the modem, but its easy to add the modem subnet on top of it:

Thats it!

you should now be able to connect to your modem webinterface from your LAN via

Linux MacOS

macOS: ignore hostkeys of some hosts

To ignore hostkey checking for a subnet (i.e. when hosts got changed/provisioned/scaled often) use the following snippet:

# ~/.ssh/config

Host 172.18.*
   StrictHostKeyChecking no

But use with care, in general hostkey checking is a good idea!