Skip to content

Instantly share code, notes, and snippets.

View dbrack's full-sized avatar

Dominik Brack dbrack

View GitHub Profile
@dbrack
dbrack / Mkdir.sh
Created January 21, 2012 15:58
Mkdir with subdirectories and naming patterns
mkdir -p test/subdir/x{86,64}/{gnome,openbox}/config
@dbrack
dbrack / CreateFiles.sh
Created October 31, 2012 16:53
This will create directories 00 till 13 with 100 files each 100 Mbytes in size. So 14 times 10 GB a total of 140 GBytes
for d in {00..13}
do
mkdir $d
for f in {000..100}
mkfile 100m $d/$f
done
@dbrack
dbrack / Recursive copy file.sh
Created January 11, 2013 12:46
Copy all files from sourcedir, including sub-dirs, to targetdir
find sourcedir -type f -print0 -exec cp {} targetdir \;
@dbrack
dbrack / CharPopUp.sh
Created January 23, 2013 07:21
DisableCharPopUpLionSublime
defaults write com.sublimetext.2 ApplePressAndHoldEnabled -bool false
@dbrack
dbrack / DisableCharPopUp.sh
Created January 23, 2013 07:24
DisableCharPopUp OS X Lion
defaults write -g ApplePressAndHoldEnabled -bool false
@dbrack
dbrack / FlushDNSMac
Created February 2, 2013 14:59
Flush DNS Mac OS X
Mac OS X 10.7 and 10.8
sudo killall -HUP mDNSResponder
Mac OS X 10.5 and 10.6
dscacheutil -flushcache
@dbrack
dbrack / RemoveKnownSSHHost.sh
Last active March 13, 2016 15:37
Remove a known hostname or ip from ~/.ssh/known_hosts
ssh-keygen -R hostnameORip
@dbrack
dbrack / FindEmptyFolders.ps1
Last active August 23, 2017 06:15
Power shell script to find empty folders in a given path.
# to run this script, execute .\EmptyFolders.ps1 -path "path\to\search" -output "path\to\outputfile.txt"
# if output is not supplied, the file is created in the current working directory
#
# to run unsigned powershell scripts that were created on your local computer, run the following command in PowerShell (Run as administrator)
# set-executionpolicy remotesigned
#
# to completly disable signture checks, run
# set-executionpolicy unrestricted
param (
@dbrack
dbrack / ChangeTextEncoding
Created September 29, 2013 16:26
Script to change text encoding of files
find . -type f -name "*.java" | xargs vim +"argdo set bomb | set fileencoding=utf-8 | w"
find . -type f -name "*.java" | xargs vim +"argdo set fileencoding=utf-8 | w"
@dbrack
dbrack / change-java-version.sh
Last active March 13, 2016 15:36
Change JDK/Java Version on OS X
/usr/libexec/java_home -v 1.7.0_45 --exec javac -version # http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html