Skip to content

Instantly share code, notes, and snippets.

@SaltwaterC
SaltwaterC / wireshark-capture
Created January 29, 2012 18:46
HTTP POST / PUT race condition when using with Expect: 100-continue
No. Time Source Destination Protocol Length Info
1 0.000000 127.0.0.1 127.0.0.1 TCP 74 54511 > 80 [SYN] Seq=0 Win=32792 Len=0 MSS=16396 SACK_PERM=1 TSval=4593254 TSecr=0 WS=64
Frame 1: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 00:00:00:00:00:00 (00:00:00:00:00:00), Dst: 00:00:00:00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 54511 (54511), Dst Port: 80 (80), Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
2 0.000014 127.0.0.1 127.0.0.1 TCP 74 80 > 54511 [SYN, ACK] Seq=0 Ack=1 Win=32768 Len=0 MSS=16396 SACK_PERM=1 TSval=4593254 TSecr=4593254 WS=64
@SaltwaterC
SaltwaterC / .gitignore
Created March 27, 2012 12:31 — forked from necenzurat/cache.php
php cache curl
/cache/
@SaltwaterC
SaltwaterC / README.md
Created May 12, 2012 13:54
Async frameworks "Hello World" showdown
@SaltwaterC
SaltwaterC / README.md
Created May 15, 2012 05:57
Browser launchers for RAM drive cache

These are some speed hacks for browsers by moving the cache from the disk to a tmpfs mount point. This hack is not recommended for machines that don't have enough installed memory. These scripts are developed with Ubuntu in mind, therefore they may need adaptation for specific distributions.

Although it may greatly improve the browser responsiveness with slower hard drives, it adds quite a lot of overhead to the cold start-up time. Subsequent launches are fast since all the cache is preloaded in the tmpfs drive.

Firefox needs to change the location of the disk cache in order to achieve this goal. Go to about:config and change this value: browser.cache.disk.parent_directory to /dev/shm/firefox-$USER/ where $USER is the output of id -nu in your user terminal. If browser.cache.disk.parent_directory does not exist, add it as a new String value.

The Google Chrome launcher works out of the box. The cache is limited to 512 MiB. If you need more cache, change the hard-coded value from the chrome-launcher scr

@SaltwaterC
SaltwaterC / COMMENT.md
Created August 8, 2012 12:38
JavaScript string encoding
> Buffer.byteLength('\uD834')
3
> Buffer.byteLength('\uDF06')
3
> Buffer.byteLength('\uD834 \uDF06')
7
// as surrogate pair
> Buffer.byteLength('\uD834\uDF06')
4
@SaltwaterC
SaltwaterC / gist:4256963
Created December 11, 2012 08:34 — forked from necenzurat/gist:4240437
nginx configuration file
server {
listen 80; ## listen for ipv4
server_name www.sent.ro sent.ro;
if ($host = 'www.sent.ro' ) {
rewrite ^/(.*)$ http://sent.ro/$1 permanent;
}
access_log /srv/www/sent.ro/logs/access.log;
@SaltwaterC
SaltwaterC / README.md
Last active December 24, 2015 15:59
Public exploit patches
@SaltwaterC
SaltwaterC / salt1.png
Last active December 27, 2015 03:59
Memory leak in salt-master issue images
salt1.png
@SaltwaterC
SaltwaterC / .gitignore
Last active August 29, 2015 13:59
A place for dumping my broken libxmljs build
node_modules/
@SaltwaterC
SaltwaterC / get_cert.sh
Last active April 5, 2019 14:00
get_cert
function get_cert()
{
local host="$1"
local port="$2"
if [ -z "$port" ]
then
port="443"
fi
openssl s_client -showcerts -connect $host:$port -servername $host </dev/null 2>/dev/null | openssl x509 -text -noout