Skip to content

Instantly share code, notes, and snippets.

View ronin13's full-sized avatar

Raghavendra Prabhu ronin13

View GitHub Profile
@ronin13
ronin13 / gist:e4f00da7c11e897383aa
Created May 27, 2015 14:05
Socat SO_REUSEPORT test
For server:
=====
for x in {1..10};do detach ./socat -u TCP-LISTEN:50000,reuseport,fork GOPEN:/tmp/socat-$x.log; done
For client:
======
for x in {1..10};do date +%r | ./socat -u stdio TCP:0.0.0.0:50000; sleep 2s; done
/tmp/socat-1.log:07:16:18 PM
/tmp/socat-1.log:07:16:24 PM
/tmp/socat-10.log:07:16:08 PM
/tmp/socat-4.log:07:16:14 PM
/tmp/socat-6.log:07:16:06 PM
/tmp/socat-7.log:07:16:16 PM
/tmp/socat-7.log:07:16:22 PM
/tmp/socat-8.log:07:16:10 PM
/tmp/socat-8.log:07:16:12 PM
/tmp/socat-9.log:07:16:20 PM
strace -f -e trace=network ./socat -u TCP-LISTEN:41445,fork,reuseport stdio
socketpair(PF_LOCAL, SOCK_DGRAM, 0, [3, 4]) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
recvfrom(3, 0x3fc72724000, 519, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(3, 0x3fc72724000, 519, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
setsockopt(5, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
bind(5, {sa_family=AF_INET, sin_port=htons(41445), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
getsockname(5, {sa_family=AF_INET, sin_port=htons(41445), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0
listen(5, 5) = 0
recvfrom(3, 0x3fc72723e60, 519, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
@ronin13
ronin13 / gist:4fc2f49152ccb3fc2692
Created May 5, 2015 16:50
GDB with namespace support
sudo gdb -p 31802
GNU gdb (GDB) 7.9.50.20150429-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@ronin13
ronin13 / fallocate-punch-filefrag
Created April 29, 2015 05:09
Effects of hole punching on fragmentation and size (on XFS)
dd if=/dev/urandom of=abc.ibd bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 10.5109 s, 10.0 MB/s
dd if=/dev/urandom of=abc.ibd bs=1M count=100 0.00s user 10.48s system 99% cpu 10.512 total
filefrag -v abc.ibd
Filesystem type is: 58465342
File size of abc.ibd is 104857600 (25600 blocks of 4096 bytes)

Keybase proof

I hereby claim:

  • I am ronin13 on github.
  • I am rdprabhu (https://keybase.io/rdprabhu) on keybase.
  • I have a public key whose fingerprint is B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977

To claim this, I am signing this object:

ttytter -synch=0 -runcommand="/friends +200" | grep -oE '\([a-zA-Z_]+\)' | tr -d '()' | =grep -v Verified | awk '{ print "@"$0 }' | tr '\n' ' ' | xargs -I{} sed -ie 's/readline=.*/readline="{}"/' ~/.ttytterrc
@ronin13
ronin13 / file1.txt
Created May 28, 2013 09:09
the description for this gist
String file contents
@ronin13
ronin13 / file1.txt
Created May 28, 2013 09:08
the description for this gist
String file contents
@ronin13
ronin13 / file1.txt
Created May 28, 2013 09:08
the description for this gist
String file contents