Skip to content

Instantly share code, notes, and snippets.

View betawax's full-sized avatar

Holger Weis betawax

  • Germany
View GitHub Profile
@betawax
betawax / gist:3b78c76f3ec8ce4dff8d
Created October 23, 2014 06:23
Reset Launchpad
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
@betawax
betawax / gist:92a5945d00ffe8354de2
Created December 18, 2014 06:49
Get the HTTP response and request header with curl
curl -I http://example.com
curl -v -I http://example.com
@betawax
betawax / gist:6e94b3513055f9c23e1f
Created December 18, 2014 07:36
Repair a HTML string
tidy_repair_string($string, ['show-body-only' => true], 'utf8');
@betawax
betawax / gist:464028a57a899a49cada
Created February 3, 2015 14:37
Redirect non SSL requests via mod_rewrite
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
@betawax
betawax / gist:f54c5411ad00c5e189f0
Created April 1, 2015 14:27
List all DNS records for a domain
dig @8.8.8.8 example.com any
@betawax
betawax / gist:96de9614afa4165a88d5
Created August 11, 2015 07:04
Shell syslog logger
logger -p local5.info "info"
logger -p local5.error "error"
logger -p local5.debug "debug"
@betawax
betawax / gist:43158907217df9457ce7
Created August 25, 2015 06:50
Fix unknown MySQL collation & character set
:%s/utf8mb4_unicode_ci/utf8_unicode_ci/g
:%s/utf8mb4/utf8/g
@betawax
betawax / gist:794736
Created January 25, 2011 10:01
Recursively remove Mac OS X .DS_Store files
find . -name '.DS_Store' -exec rm -f {} \;
@betawax
betawax / gist:794975
Last active September 24, 2015 19:07
Recursively adjust permissions for files and directories
find * -type f -exec chmod 644 {} \;
find * -type d -exec chmod 755 {} \;
@betawax
betawax / gist:804020
Created January 31, 2011 13:25
Generate a random key
sha1(microtime(TRUE).mt_rand(10000, 90000));