This file contains hidden or 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
| git checkout -b experiment |
This file contains hidden or 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 | |
| JAVA_PROCESS_ID=$1 | |
| LABEL=$2 | |
| if [[ -z "$JAVA_PROCESS_ID" ]] | |
| then | |
| echo >&2 "No Java process specified" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| PIDS=`ps auxh | awk '{print $2}'`; for pid in $PIDS; do mem=`pmap -d $pid | tail -n 1 | awk '{print $4}'`; echo "$pid $mem"; done |
This file contains hidden or 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
| public class Throwable implements Serializable { | |
| //... | |
| public Throwable() { | |
| fillInStackTrace(); | |
| } | |
| //... |
This file contains hidden or 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
| [ "cat", "dog", "bird" ] as String[] |
This file contains hidden or 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
| class StringTest { | |
| public static void main(String[] args) { | |
| String switchString = "StringTest"; | |
| switch (switchString) { | |
| case "FirstString": return; | |
| case "SecondString": return; | |
| case "StringTest": | |
| System.out.println("Here it is"); | |
| return; |
This file contains hidden or 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 | |
| sudo yum -y install js-devel | |
| mkdir -p ~/bin | |
| curl -L http://github.com/micha/jsawk/raw/master/jsawk > ~/bin/jsawk | |
| chmod 755 ~/bin/jsawk |
This file contains hidden or 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
| ssh root@node02 'restorecon -R -v /root/.ssh' |
This file contains hidden or 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 | |
| set -e | |
| #receipt http://stackoverflow.com/questions/14062895/bash-argument-case-for-args-in/14063511#14063511 | |
| while [[ $# -gt 0 ]] && [[ ."$1" = .--* ]]; do | |
| optname="$1"; | |
| shift; #expose next argument | |
| case "$optname" in |
This file contains hidden or 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 | |
| branch_url=$1 | |
| rev=`svn log --stop-on-copy $branch_url | tail -4 | awk '{print $1}' | cut -c 2-500 | head -n 1` | |
| git svn fetch -r $rev | |
| git svn fetch |