Skip to content

Instantly share code, notes, and snippets.

View dasrecht's full-sized avatar

Bastian dasrecht

View GitHub Profile
@dasrecht
dasrecht / instagram-media-rename.bash
Created June 15, 2025 12:12 — forked from thomaswitt/instagram-media-rename.bash
Take an Instagram data export, use metadata from media.json file, rename pictures and add EXIF/IPTC date and title, so they're ready to import in a photo management application like iPhoto
#!/bin/bash
if [[ ! -s "media.json" ]]; then
echo "*** ERROR: No media.json file in current directory"
exit 1
fi
mkdir result
echo -n "Processing "
@dasrecht
dasrecht / umlaute.pl
Last active December 3, 2015 12:24 — forked from kogakure/umlaute.pl
Perl: Remove all Umlauts and special characters from filenames
#!/usr/bin/perl
#===============================================================================
#
# FILE: renametree.pl
#
# USAGE: ./renametree.pl
#
# DESCRIPTION: rename files and directories in the current tree to
# eliminate special characters
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
if [ -z "$1" ]; then
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp)
cat > $TMP <<EOF
# Allow NFS Operations without password prompt
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart

Keybase proof

I hereby claim:

  • I am dasrecht on github.
  • I am dasrecht (https://keybase.io/dasrecht) on keybase.
  • I have a public key whose fingerprint is 5A8A 18E7 250B 52AD 2DAD E476 83C0 997E 603A 823E

To claim this, I am signing this object:

@dasrecht
dasrecht / tmcleanup.md
Last active August 29, 2015 14:07 — forked from linjer/tmcleanup.md

Prerequisites

  • gfind (via brew install findutils)
  • Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
  • Admin/sudo access in the OSX terminal

Script

  • Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
  • By default, it erases all backups older than 30 days. Adjust as desired.
## Add Gitconfig to VM - see https://github.com/mitchellh/vagrant/issues/3021
config.vm.provision :file, source: '~/.gitconfig', destination: '/home/vagrant/.gitconfig' if File.exists?(ENV['HOME'] + '/.gitconfig')
@dasrecht
dasrecht / 0_reuse_code.js
Created January 24, 2014 13:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
########## Close web browsers ##########
openSafariBrowser=$(ps auxwww | grep '/Applications/Safari.app/Contents/MacOS/Safari' | grep -v 'grep' | wc -l)
if [ $openSafariBrowser -ge 1 ]; then
echo "Safari was found running, will restart after install" >/dev/null 2>&1
$PRECMD killall -TERM Safari ; sleep 2
fi
openChromeBrowser=$(ps auxwww | grep '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' | grep -v 'grep' | wc -l)
if [ $openChromeBrowser -ge 1 ]; then
echo "Chrome was found running, will restart after install" >/dev/null 2>&1
@dasrecht
dasrecht / offer.js
Last active January 1, 2016 15:09
BitTorrent Installer Deconstruction
/**
* Skip the offer if the current country is not within this list.
*/
var cList = ["AU", "AT", "BR", "CA", "DK", "FI", "FR", "DE", "HK", "IN", "IE", "IT", "KR", "MX", "NL", "NO", "SG", "ES", "SE", "CH", "TW", "GB", "US"];
var country = window.installer.getenv("COUNTRY");
if (country !== "??") {
var ret = cList.filter(function(c) {if (c == country) {return c;}});
if (ret === undefined || ret === null || ret.length === 0) {
143.5630516