Skip to content

Instantly share code, notes, and snippets.

View 0xjac's full-sized avatar

Jacques Dafflon 0xjac

View GitHub Profile

Keybase proof

I hereby claim:

  • I am 0xjac on github.
  • I am 0xjac ( on keybase.
  • I have a public key ASA-NPIxmyFQ1ismXY0MvmW8bisZKMokD0XOFXQdGhZgHAo

To claim this, I am signing this object:

0xjac /
Created December 4, 2017 10:13
SmallTalk ifTrue ifFalse implementation in Java for my Programming Styles class
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Supplier;
public abstract class Bool {
public static final Bool TRUE = new True();
public static final Bool FALSE = new False();
public abstract <T> T ifTrueIfFalse(Supplier<T> fTrue, Supplier<T> fFalse);
private static class True extends Bool {
public <T> T ifTrueIfFalse(Supplier<T> fTrue, Supplier<T> fFalse) {
0xjac /
Last active December 14, 2016 12:55
modified version showing the Easytrace, Credits to Giacomo
#!/usr/bin/env python
import argparse
import sys
from scapy.all import IP, UDP, Packet, XIntField, XByteField, bind_layers, Ether, sendp, sniff
class EasyTrace(Packet):
PORT = 0x6901
0xjac /
Last active September 27, 2023 21:16
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare

0xjac /
Last active December 7, 2016 14:33
Help for the Assignment 2 of Advance Networking.

Adv-Ntw: Assignment 2 Help

Hello, I found that this assignment had quite a bit of overhead to setup everything properly. The information below should facilitate your work with vagrant, Mininet and Ryu. I however will not provide any help on how to do the actual assignment.

If anything is unclear or if something does not work, don't hesitate to comment below.


If you find the information below helpful and use part or all of it for your assignment, I would appreciate if you could mention it in your submission. Either just by indicating my name or the link to this gist.

0xjac /
Created September 23, 2016 14:27
#!/usr/bin/env bash
gcc -o main main.c;
ELAPSED=`( time ./main ) 2>&1 > /dev/null`
FLOPS=$(echo "$FLOP/$ELAPSED" | bc)
0xjac / acalab
Last active April 19, 2016 09:29
View acalab
#!/usr/bin/env bash
function cleanup {
# Poweroff the machine on exit or failure
VBoxManage controlvm "$VMNAME" poweroff
0xjac / BluetoothCursors.pde
Created April 7, 2016 11:50
Arduino Android Bluetooth communication example
View BluetoothCursors.pde
* <p>Ketai Library for Android:</p>
* <p>KetaiBluetooth wraps the Android Bluetooth RFCOMM Features:
* <ul>
* <li>Enables Bluetooth for sketch through android</li>
* <li>Provides list of available Devices</li>
* <li>Enables Discovery</li>
* <li>Allows writing data to device</li>
* </ul>
0xjac / fix_icorsi.user.js
Last active February 3, 2017 01:48
Shows course names instead of ids on icorsi.
View fix_icorsi.user.js
// ==UserScript==
// @name fix_icorsi
// @namespace
// @version 0.4
// @description Shows the course names instead of ides on the side menu.
// @author Jacques Dafflon
// @match*
// @website
// @source
// @updateURL
Traceback (most recent call last):
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/", line 1477, in full_dispatch_request