This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.java' -exec basename {} .java \; | awk '{ print length " " $0 }' | sort -n -r | head -n 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Generate a string of 10 random alphanumeric characters | |
env LC_CTYPE=C tr -cd "[:alnum:]" < /dev/urandom | head -c 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# This script updates a field for all documents in a view. Modify as needed. | |
# | |
# This script requires couchdbkit: | |
# $ sudo easy_install -U Couchdbkit | |
from couchdbkit import Server | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
/** | |
* A Groovy port of the Scala script at http://log4p.com/2010/10/09/scala-shellscripts/ | |
*/ | |
if (args.length < 1) { | |
println "usage: ./scrabble <filename>" | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script lists all commands that appear more than once in your $PATH. | |
# For of each command its locations and the number of occurrences are displayed. | |
# | |
# Nils Breunese <[email protected]>, 2012. | |
for command in `compgen -c` | |
do | |
count=`which -a $command | wc -l | tr -d ' '` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$0 = "rm -rf /"; | |
print "Press ENTER to exit\n"; | |
<STDIN>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy -ne 'if (line.size() == 4 && line.toLowerCase().toList().sort().join() =~ /^e?l?n?o?p?q?$/) println line' /usr/share/dict/words |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exclude all paths for directories named 'target' in the ~/Projects directory (which I use for my Maven projects) | |
# Sticky excludes (without -p and sudo) are not that useful, because 'mvn clean' removes the target directory | |
find ~/Projects -type d -name target | xargs sudo tmutil addexclusion -p | |
# List all items excluded by path | |
plutil -convert xml1 -o - /Library/Preferences/com.apple.TimeMachine.plist | xmllint -xpath /plist/dict/array[2] - | |
# List all items with sticky excludes | |
mdfind "com_apple_backup_excludeItem = com.apple.backupd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find ~ -not -user $USER -ls |
OlderNewer