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
function g() { | |
local C="$HOME/.cdirs" | |
case $1 in | |
"") nl "$C" || touch "$C";; | |
-e) ${EDITOR:-vi} "$C";; | |
.) pwd >> "$C";; | |
1-9]*) cd "$(sed -ne "${1}p" "$C")";; | |
*) cd "$(grep "$1" "$C" | head -1)";; | |
esac | |
} |
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
# https://gist.github.com/pcdv | |
function g() { | |
local HLP="Bookmark your favorite directories: | |
g : list bookmarked dirs | |
g . : add current dir to bookmarks | |
g -e : edit bookmarks | |
g <num> : jump to n-th dir | |
g <regex> : jump to 1st matching dir" | |
local D=_; local CFG="$HOME/.cdirs" | |
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
# Reuse an existing ssh-agent on login, or create a new one. Append this to your .bashrc | |
# I have no idea who the author of the original concept was for reusing agents. This | |
# version also handles the case where the agent exists but has no keys. | |
# | |
# Adapted for Git Bash on Windows | |
GOT_AGENT=0 | |
for FILE in $(find /tmp/ssh-* -type s -user ${USERNAME} -name "agent.[0-9]*" 2>/dev/null) | |
do |
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
public class Args { | |
private static final String USAGE // | |
= String.join("\n", | |
"", | |
"tool [options] files...", | |
"", | |
"", | |
"Options:", | |
" -d PORT : filter on given port", | |
" -h : prints this help", |
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 | |
# Example: gradlerun path/to/ivyrepo com.example:mylib:+ com.example.MyMainClass arg1 | |
REPO=$1 | |
DEP=$2 | |
MAIN=$3 | |
ARG=$4 | |
shift 4 | |
SCRIPT=/tmp/gradlescript$$ |
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
STANDARD SOCKET | |
pi@raspberrypi ~/jocket $ ./run-bench.sh -Dtcp=true | |
Java ServerSocket listening on 3333 | |
Warming up : 50000 reps, pause between reps: 0ns... done in 18206ms | |
Running test : 300000 reps, pause between reps: 0ns... done in 100855ms | |
Dumping results in /tmp/Socket | |
1.0% ( 297000) : 309.99 (us) | |
10.0% ( 270000) : 312.99 (us) | |
50.0% ( 150000) : 317.99 (us) |
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
STANDARD SOCKET | |
$ /opt/jdk1.7.0_25/bin/java -Dtcp=true -cp jocket-0.5.0pre1.jar:jocket-bench-0.5.0pre1.jar jocket.bench.BenchClient | |
Warmup (50000) ... | |
Running test (300000) ... | |
Done in 58681ms. Dumping results in Socket | |
1.0% ( 297000) : 101,54 (us) | |
10.0% ( 270000) : 193,04 (us) | |
50.0% ( 150000) : 194,36 (us) | |
99.0% ( 3000) : 242,23 (us) |