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
Category | Tools | |
---|---|---|
Batch Processing |  |
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 | |
usage() { | |
echo "Usage: $0 COMMAND" | |
echo "" | |
echo "Commands:" | |
echo " start <output-dir> <interval> [<cpu-mem-net-log> <hdd-log>] Start the monitor" | |
echo " stop Stop the monitor" | |
exit 1 | |
} |
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
# Install node.js | |
# --------------- | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install | |
export PATH=$PATH:~/local/bin | |
curl https://npmjs.org/install.sh | sh |
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
<?php | |
function progress_bar($done, $total, $info="", $width=50) { | |
$perc = round(($done * 100) / $total); | |
$bar = round(($width * $perc) / 100); | |
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info); | |
} |
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
import java.util.ArrayList; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.message.BasicNameValuePair; | |
public class Request { | |
private String resource; | |
private ArrayList<NameValuePair> params; | |
private ArrayList<NameValuePair> headers; | |