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

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
diff --git a/config_translation.module b/config_translation.module
index 3523a09..0f77503 100644
--- a/config_translation.module
+++ b/config_translation.module
@@ -17,11 +17,19 @@ function config_translation_help($path) {
case 'admin/help#config_translation':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Configuration Translation module lets you translate configuration from all around your Drupal site. Views, your site name, contact module categories, vocabularies, menus, blocks, and so on are all stored with Drupal\'s unified configuration system and can be translated with this module. Content, such as nodes, taxonomy terms, custom blocks, and so on are translatable with the <em>Content translation</em> module in Drupal core, while the built-in user interface (such as registration forms, content submission and administration interfaces) are translated with the <em>Interface translation</em> module. Use these three modules effectively together to