Skip to content

Instantly share code, notes, and snippets.

errf("opening");
FILE *f = fopen("test", "rb");
fread(ctx->udp_buf + SHADOWVPN_PACKET_OFFSET, 1, 1024, f);
if (-1 == crypto_decrypt(ctx->tun_buf, ctx->udp_buf, 1000)) {
errf("failure");
} else {
errf("success");
}
@clowwindy
clowwindy / Microbot.ino
Created July 25, 2015 16:13
BLE Microbot
#include <Servo.h>
#include "GoBLE.h"
#include "Metro.h"
Metro servoMove(50);
Servo myservoLF;
Servo myservoLR;
Servo myservoRF;
Servo myservoRR;
$ g++ -g LRU.cpp
In file included from LRU.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map:212:5: warning:
Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map> [-W#warnings]
# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
^
1 warning generated
$ lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
@clowwindy
clowwindy / Makefile
Last active January 4, 2016 03:18
stringByAddingPercentEncodingWithAllowedCharacters Crash
test: main.m
gcc -o main main.m -framework Foundation
@clowwindy
clowwindy / aes.c
Created November 11, 2014 16:07
PolarSSL aes-256-cfb minimal
#if !defined(POLARSSL_CONFIG_FILE)
#include "polarssl/config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#if defined(POLARSSL_AES_C)
#include "polarssl/aes.h"
clowwindy@localhost:~/workspace/test_git$ git clone /Users/clowwindy/workspace/test_git/repo/ another_user
Cloning into 'another_user'...
done.
clowwindy@localhost:~/workspace/test_git$ cd another_user/
clowwindy@localhost:~/workspace/test_git/another_user$ git fsck --lost-found
Checking object directories: 100% (256/256), done.
dangling commit 69710fb2d9e9057701d4bdacbd1df6df14f63a61
clowwindy@localhost:~/workspace/test_git/another_user$ git show 69710fb2d9e9057701d4bdacbd1df6df14f63a61
commit 69710fb2d9e9057701d4bdacbd1df6df14f63a61
Author: clowwindy <clowwindy42@gmail.com>
@clowwindy
clowwindy / 0. remote.conf
Last active November 14, 2018 03:26
SigmaVPN configure
[peername]
proto = nacltai
proto_publickey = LOCAL_PUBKEY
proto_privatekey = REMOTE_PRIKEY
local = tuntap
local_interface = tunnel
local_tunmode = 1
peer = udp
peer_localaddr = REMOTE_IP
peer_localport = 8000
curl --socks5-hostname 127.0.0.1:1080 -v http://www.google.com/ 2>&1 | python test_latency.py
var a = 'SOCKS5 127.0.0.1:1080;SOCKS 127.0.0.1:1080;DIRECT';
function FindProxyForURL(url, host) {
var b = a;
a = 'DIRECT';
return b;
}
@clowwindy
clowwindy / gist:7889692
Last active August 19, 2021 11:46
Create 100 Linodes from Stackscript
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import json
# Linode API Key
key = 'API_KEY'
# set your VPS root password
root_pass = 'AWESOME_PASSWORD'