Skip to content

Instantly share code, notes, and snippets.

chantra chantra

Block or report user

Report or block chantra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sodium_init.c
#include <sodium.h>
#include <unistd.h>
#include <stdlib.h>
static void misuse(void){
printf("Misused handler!\n");
exit(2);
}
View sodium_init_misused.c
#include <sodium.h>
#include <unistd.h>
#include <stdlib.h>
static void misuse(void){
printf("Misused handler!\n");
exit(2);
}
View sodium_init.c
#include <sodium.h>
#include <unistd.h>
int main(){
if(chroot("/tmp") != 0){
printf("Failed to chroot\n");
return 1;
}
View busyspin.diff
diff --git a/lib/exabgp/reactor/network/connection.py b/lib/exabgp/reactor/network/connection.py
index 15763d7..def737f 100644
--- a/lib/exabgp/reactor/network/connection.py
+++ b/lib/exabgp/reactor/network/connection.py
@@ -43,9 +43,11 @@ class Connection (object):
# peer and local are strings of the IP
try:
self.defensive = environment.settings().debug.defensive
+ self.max_loop_speed = environment.settings().reactor.speed
self.logger = Logger()
View multiplecerts.diff
diff --git a/dnscrypt-wrapper.sh b/dnscrypt-wrapper.sh
index 0ef7e6f..d7a8592 100755
--- a/dnscrypt-wrapper.sh
+++ b/dnscrypt-wrapper.sh
@@ -29,15 +29,13 @@ new_key() {
--crypt-secretkey-file="${STKEYS_DIR}/${ts}.key" \
--provider-cert-file="${STKEYS_DIR}/${ts}.cert" \
--cert-file-expire-days=1 && \
- mv -f "${STKEYS_DIR}/${ts}.cert" "${STKEYS_DIR}/dnscrypt.cert" && \
/opt/dnscrypt-wrapper/sbin/dnscrypt-wrapper --gen-cert-file \
View dnscrypt_cert.diff
Binary files dnscrypt.old/dnscrypt_cert.dir/2_chacha.cert and dnscrypt.new/dnscrypt_cert.dir/2_chacha.cert differ
diff -ruN dnscrypt.old/dnscrypt_cert.dir/dnscrypt_cert.conf dnscrypt.new/dnscrypt_cert.dir/dnscrypt_cert.conf
--- dnscrypt.old/dnscrypt_cert.dir/dnscrypt_cert.conf 2017-03-06 09:56:29.000000000 -0800
+++ dnscrypt.new/dnscrypt_cert.dir/dnscrypt_cert.conf 2017-06-01 19:14:27.000000000 -0700
@@ -22,5 +22,6 @@
dnscrypt-secret-key: 1.key
dnscrypt-secret-key: 2.key
dnscrypt-provider-cert: 1.cert
+ dnscrypt-provider-cert: 2_chacha.cert
dnscrypt-provider-cert: 2.cert
View dnscrypt_cert.tgz.diff
Binary files dnscrypt.new/dnscrypt_cert.dir/2_chacha.cert and dnscrypt.old/dnscrypt_cert.dir/2_chacha.cert differ
diff -ruN dnscrypt.new/dnscrypt_cert.dir/dnscrypt_cert.conf dnscrypt.old/dnscrypt_cert.dir/dnscrypt_cert.conf
--- dnscrypt.new/dnscrypt_cert.dir/dnscrypt_cert.conf 2017-06-01 19:14:27.000000000 -0700
+++ dnscrypt.old/dnscrypt_cert.dir/dnscrypt_cert.conf 2017-03-06 09:56:29.000000000 -0800
@@ -22,6 +22,5 @@
dnscrypt-secret-key: 1.key
dnscrypt-secret-key: 2.key
dnscrypt-provider-cert: 1.cert
- dnscrypt-provider-cert: 2_chacha.cert
dnscrypt-provider-cert: 2.cert
View chacha.diff
diff --git a/dnscrypt/cert.h b/dnscrypt/cert.h
index 50c9f81..def2ca2 100644
--- a/dnscrypt/cert.h
+++ b/dnscrypt/cert.h
@@ -15,12 +15,12 @@ struct SignedCert {
uint8_t version_minor[2];
// Signed Content
+ uint8_t signed_content[64];
uint8_t server_publickey[crypto_box_PUBLICKEYBYTES];
View gist:a1a69b4b3601f712712aa7b64b91b3ac
2016/05/19 19:08:52 panic: runtime error: invalid memory address or nil pointer dereference
goroutine 114 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
/usr/lib/go-1.6/src/runtime/debug/stack.go:24 +0x80
runtime/debug.PrintStack()
/usr/lib/go-1.6/src/runtime/debug/stack.go:16 +0x18
github.com/facebook/augmented-traffic-control/src/api.ErrorHandler.func1.1(0x7f1ef08f3ed0, 0xc8203d8750)
/home/chantra/augmented-traffic-control/.gopath/src/github.com/facebook/augmented-traffic-control/src/api/utils.go:89 +0xc5
panic(0x9df200, 0xc82000e150)
/usr/lib/go-1.6/src/runtime/panic.go:426 +0x4e9
View gist:ae127acf799d6b6fa25a8b6ec4bc18f1
chantra  sparts   master ✹  PYTHONPATH=. python demo/producer_consumer.py --Producer-foobar a b [ruby-2.2.1] 10:08:53
INFO:ProducerConsumer.Producer:Producer put 0.883608399041 into queue
DEBUG:ProducerConsumer:All tasks started
INFO:ProducerConsumer.Producer:option foobar type: <type 'str'> value: ['a', 'b']
DEBUG:ProducerConsumer:VService Active. Awaiting graceful shutdown.
INFO:ProducerConsumer.Producer:Producer put 0.504389502792 into queue
INFO:ProducerConsumer.Producer:option foobar type: <type 'str'> value: ['a', 'b']
INFO:ProducerConsumer.Producer:Producer put 0.341550019729 into queue
INFO:ProducerConsumer.Producer:option foobar type: <type 'str'> value: ['a', 'b']
INFO:ProducerConsumer.Producer:Producer put 0.674296821862 into queue
You can’t perform that action at this time.