Skip to content

Instantly share code, notes, and snippets.

Jacques Dafflon 0xjac

Block or report user

Report or block 0xjac

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 keybase.md

Keybase proof

I hereby claim:

  • I am 0xjac on github.
  • I am 0xjac (https://keybase.io/0xjac) on keybase.
  • I have a public key ASA-NPIxmyFQ1ismXY0MvmW8bisZKMokD0XOFXQdGhZgHAo

To claim this, I am signing this object:

@0xjac
0xjac / Bool.java
Created Dec 4, 2017
SmallTalk ifTrue ifFalse implementation in Java for my Programming Styles class
View Bool.java
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
0xjac / client_server.py
Last active Dec 14, 2016
modified version showing the Easytrace, Credits to Giacomo
View client_server.py
#!/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):
PROTOCOL = 0xFD
PORT = 0x6901
@0xjac
0xjac / private_fork.md
Last active Mar 30, 2020
Create a private fork of a public repository
View private_fork.md

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 git@github.com:usi-systems/easytrace.git
@0xjac
0xjac / Adv-Ntw_A2_help.md
Last active Dec 7, 2016
Help for the Assignment 2 of Advance Networking.
View Adv-Ntw_A2_help.md

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.

Disclaimer

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.

View flops.sh
#!/usr/bin/env bash
FLOP=4000000;
gcc -o main main.c;
TIMEFORMAT=%R
ELAPSED=`( time ./main ) 2>&1 > /dev/null`
FLOPS=$(echo "$FLOP/$ELAPSED" | bc)
View acalab
#!/usr/bin/env bash
HOSTNAME="aca-lab"
VMNAME="aca-lab"
HOST_PORT=3022
SSH_PORT=22
function cleanup {
# Poweroff the machine on exit or failure
VBoxManage controlvm "$VMNAME" poweroff
@0xjac
0xjac / BluetoothCursors.pde
Created Apr 7, 2016
Arduino Android Bluetooth communication example
View BluetoothCursors.pde
/**
* <p>Ketai Library for Android: http://KetaiProject.org</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
0xjac / fix_icorsi.user.js
Last active Feb 3, 2017
Shows course names instead of ids on icorsi.
View fix_icorsi.user.js
// ==UserScript==
// @name fix_icorsi
// @namespace https://gist.github.com/jacquesd/
// @version 0.4
// @description Shows the course names instead of ides on the side menu.
// @author Jacques Dafflon
// @match https://www2.icorsi.ch/*
// @website https://gist.github.com/jacquesd/a322655dd93b30f0bba8
// @source https://gist.githubusercontent.com/jacquesd/a322655dd93b30f0bba8/raw/fix_icorsi.user.js
// @updateURL https://gist.githubusercontent.com/jacquesd/a322655dd93b30f0bba8/raw/fix_icorsi.user.js
View token_tb.py
Traceback (most recent call last):
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/app.py", 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/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jd/.virtualenvs/indico-mobile/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
You can’t perform that action at this time.