Skip to content

Instantly share code, notes, and snippets.

View ronin13's full-sized avatar

Raghavendra Prabhu ronin13

View GitHub Profile
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

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:

@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)
@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:
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)
/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
@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
net_get_random_once(&inet_ehash_secret, sizeof(inet_ehash_secret));
return __inet_ehashfn(laddr, lport, faddr, fport,
inet_ehash_secret + net_hash_mix(net));
...............
...........
static inline unsigned int __inet_ehashfn(const __be32 laddr,
const __u16 lport,
hostile.sh -m 100 curl -L http://google.com
===============
Thread 2 (Thread 0x7fd1b0039740 (LWP 31959)):
#0 0x00007fd1af2e6e8d in poll () from /usr/lib/libc.so.6
#1 0x00007fd1afa16131 in ?? () from /usr/lib/libcurl.so.4
#2 0x00007fd1afa0a180 in curl_easy_perform () from /usr/lib/libcurl.so.4
#3 0x000000000040a6b2 in ?? ()
#4 0x000000000040bfdd in ?? ()
#5 0x000000000040247a in ?? ()
@ronin13
ronin13 / ui.c
Created September 4, 2010 15:00
#if defined(FEAT_GUI) || defined(WIN3264) || defined(PROTO)
/*
* Called when focus changed. Used for the GUI or for systems where this can
* be done in the console (Win32).
*/