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
Handling request for http://margaine.com/ | |
debugger invoked on a HTTPICKLE::HTTPICKLE-CONDITION in thread | |
#<THREAD "main thread" RUNNING {1003266DB3}>: | |
on incoming HTTP REQUEST | |
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. | |
restarts (invokable by number or by possibly-abbreviated name): |
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
[ralt@zap httpickle]$ PORT=4445 ./build/httpickle | |
Handling request for / | |
debugger invoked on a SIMPLE-ERROR in thread | |
#<THREAD "main thread" RUNNING {1003266AC3}>: | |
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. | |
restarts (invokable by number or by possibly-abbreviated name): | |
0: [PRINT-HEADERS] Print the headers and their values |
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
# Laap | |
[ralt@zap wrk]$ curl localhost:9092 | |
Pong | |
[ralt@zap wrk]$ ./wrk -H "Connection: close" -t12 -c400 -d10s http://localhost:9092 | |
Running 10s test @ http://localhost:9092 | |
12 threads and 400 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 11.48ms 75.29ms 1.67s 98.27% | |
Req/Sec 2.97k 1.62k 7.21k 61.38% |
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
# Lisp event loop-based HTTP server | |
[ralt@zap wrk]$ ./wrk -t12 -c400 -d10s http://localhost:5560 | |
Running 10s test @ http://localhost:5560 | |
12 threads and 400 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 11.79ms 76.32ms 1.67s 98.24% | |
Req/Sec 3.13k 2.17k 8.72k 63.38% | |
347075 requests in 10.09s, 15.23MB read | |
Socket errors: connect 0, read 0, write 0, timeout 12 | |
Requests/sec: 34395.16 |
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
# 1000 concurrent HTTP requests to 127.0.0.1 where default nginx is sitting | |
# Using golang | |
[ralt@zap golang]$ time ./golang | |
real 0m0.083s | |
user 0m0.165s | |
sys 0m0.087s | |
[ralt@zap golang]$ time ./golang |
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
# In the paramiko server... this is super ugly. | |
from subprocess import Popen, PIPE | |
import select | |
def _read_chan(chan, stdin): | |
x = chan.recv(1) | |
if ord(x) == 13: | |
chan.send("\r\n") | |
stdin.write("\n") | |
else: |
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
root@localhost:/mnt# gcc is_frozen.c -o is_frozen | |
root@localhost:/mnt# ./is_frozen / | |
frozen status: 0 | |
root@localhost:/mnt# fsfreeze --freeze / | |
root@localhost:/mnt# ./is_frozen / | |
frozen status: 4 | |
root@localhost:/mnt# fsfreeze --unfreeze / | |
root@localhost:/mnt# ./is_frozen / | |
frozen status: 0 |
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 | |
if [ ! -z "$1" ]; then | |
echo "$1 doesn't exist." | |
exit 1 | |
fi | |
git filter-branch --force --index-filter \ | |
"git rm --cached --ignore-unmatch $1" \ | |
--prune-empty --tag-name-filter cat -- --all |
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
export PASSPHRASE="REALLY COMPLICATED PASSWORD :)" | |
REM_IF_OLDER="54W" | |
FULL_IF_OLDER="8W" | |
ORIG_DIR=/home/foo/Backup | |
BACKUP_DIR=s3://s3-eu-west-1.amazonaws.com/foo/bar | |
duplicity --s3-use-new-style --force --s3-european-buckets remove-older-than $REM_IF_OLDER $BACKUP_DIR | |
duplicity --s3-use-new-style --s3-european-buckets --full-if-older-than $FULL_IF_OLDER \ | |
--exclude /home/foo/Backup/Dotfiles/gnupg/random_seed \ |
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
diff --git a/utils.c b/utils.c | |
index f10c178..04207b5 100644 | |
--- a/utils.c | |
+++ b/utils.c | |
@@ -937,22 +937,20 @@ static int is_loop_device (const char* device) { | |
static int resolve_loop_device(const char* loop_dev, char* loop_file, | |
int max_len) | |
{ | |
- int ret; | |
- FILE *f; |