Skip to content

Instantly share code, notes, and snippets.

View hedinasr's full-sized avatar

Hedi Nasr hedinasr

  • SonarSource
  • Geneva, Switzerland
View GitHub Profile
@hedinasr
hedinasr / leap_motion.py
Created October 8, 2016 21:17
Atomistic code for leap motion control with Python
#!/usr/bin/env python2.7
import sys
#sys.path.insert(0, "../lib") # utile pour avoir la lib en locale
import Leap
class MyListener(Leap.Listener):
def __init__(self):
super(MyListener, self).__init__()
self.controller = Leap.Controller()
self.controller.add_listener(self)

Keybase proof

I hereby claim:

  • I am ananasr on github.
  • I am ananasr (https://keybase.io/ananasr) on keybase.
  • I have a public key ASBzrDUg8738E1N8Nidm5TqMliWOe4Pn9s8Py7f9zemAGwo

To claim this, I am signing this object:

@hedinasr
hedinasr / client.py
Last active November 15, 2016 10:34
Client/Server application using Python Socket API
# -*- coding: utf-8 -*-
import socket
from utils import readlines
"""
Client.
"""
# Création de la socket TCP
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@hedinasr
hedinasr / flood_udp.py
Created January 10, 2017 10:24
Python UDP Flooder
"""
UDP Flooder.
This is a 'Dos' attack program to attack servers, you set the IP
and the port and the amount of seconds and it will start flooding to that server.
(inspire from http://hazardedit.com/forum/viewtopic.php?t=73)
Usage : ./flood_udp <ip> <port> <second>
"""
import time
import socket
@hedinasr
hedinasr / Makefile
Created March 15, 2017 20:52
Generic Makefile for C++ projects
ECHO = printf
CAT = cat
RM = rm
FIND = find
UNAME = $(shell uname)
CPPFLAGS = -ggdb -Wall -pedantic -ansi
LDFLAGS =
CC = g++
LD = g++
@hedinasr
hedinasr / add-preseed-and-firmware-to-debian.sh
Created July 5, 2017 14:00
Script to add firmware files and preseed file to a debian ISO
#!/bin/bash
# add-preseed-and-firmware-to-debian: Add non-free firmware and preseed to Debian install media
#
# Copyright (C) 2016-2017 Hedi Nasr <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@hedinasr
hedinasr / move-vm
Last active July 11, 2017 07:30
Script for moving Xen virtual machine using only SSH, rsync and lvm
#!/bin/bash
#
# Auteur : Hedi Nasr, Nicolas Carel
# Version : 1.2
# Description : script de deplacement de vm
# Prérequis:
# - Hyperviseur: Xen
# - LVM
# - Nom des volumes: <nom-vm>-<disk|swap|data>
#
@hedinasr
hedinasr / .vimrc
Created November 19, 2017 16:56
My .vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
@hedinasr
hedinasr / traefik-ds.yaml
Last active January 3, 2018 09:46
DaemonSet for Traefik with NodeSelector (role=ingress-controller)
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata: