Skip to content

Instantly share code, notes, and snippets.

@joxer
joxer / gist:f1dc636a97b555c2bc6f45747897f90d
Last active February 20, 2019 16:13
Objdump inotify code example
~$ objdump -d -S a.out
a.out: file format elf64-x86-64
Disassembly of section .init:
00000000000006e0 <_init>:
6e0: 48 83 ec 08 sub $0x8,%rsp
6e4: 48 8b 05 fd 18 20 00 mov 0x2018fd(%rip),%rax # 201fe8 <__gmon_start__>
@joxer
joxer / inotify_example.c
Created January 25, 2019 16:04
Inotify example
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/inotify.h>
#include <unistd.h>
#include <limits.h>
#include <string.h>
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
//create first a directory called chroot!
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
#include <sys/types.h>
void printDirInformation(DIR* dir) {
import java.io.*;
import java.util.*;
class Solution {
static int getNumberOfIslands(int[][] binaryMatrix) {
int island = 0;
for(int i = 0; i < binaryMatrix.length; i++){
for(int j = 0; j < binaryMatrix[i].length; j++){
if(binaryMatrix[i][j] == 1){
@joxer
joxer / dutchflag.ipynb
Last active March 8, 2018 20:19
Dutch Flag Problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joxer
joxer / dataset.csv
Created October 5, 2017 19:04
Regioni Dataset
Valle d'aosta Pila 19 7.2899 45.7214 Montagna
Piemonte Arona 33 8.5582 45.7586 Lago
Valle d'aosta Châtillon 13 7.6128 45.7486 Montagna
Valle d'aosta Saint Nicolas 12 2.77939 50.30413 Montagna
Piemonte Bardonecchia 35 6.69888 45.07462 Montagna
Piemonte Sestriere 47 6.87751 44.95864 Montagna
Piemonte Pragelato 25 6.94161 45.01364 Montagna
Valle d'aosta La Thuile 33 6.95099 45.71366 Montagna
Valle d'aosta Courmayeur 69 6.96893 45.79659 Montagna
Valle d'aosta Pré-Saint-Didier 17 6.98579 45.76416 Montagna
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joxer
joxer / FriendInterestedEvent.ipynb
Created September 13, 2017 19:09
IPython Notebook - Facebook Friend interested in events through FacebookTrackingExposed CSV
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joxer
joxer / clustering.ipynb
Last active August 27, 2017 16:34
Clustering in ipython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.