Skip to content

Instantly share code, notes, and snippets.

View dasrecht's full-sized avatar

Bastian dasrecht

View GitHub Profile
@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
@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.
@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