Skip to content

Instantly share code, notes, and snippets.


Brahim Machkouri brahimmachkouri

View GitHub Profile
View Populate dropdown according to another dropdown selection
<script type="text/javascript">
var myJson = new Array();
$(document).ready(function() {
// Pas en asynchrone pour le dev (debug)
async: false
brahimmachkouri / form.php
Last active Aug 29, 2015
Simple form example with Silex
View form.php
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
'locale_fallbacks' => array('en'),
$app->register(new Silex\Provider\FormServiceProvider());
$form = $app['form.factory']->createBuilder('form')
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
brahimmachkouri / interfaces
Created Nov 11, 2014
raspbian : wifi settings
View interfaces
#paste these lines in /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-ssid your-ssid-here
View interfaces
# put the following content in /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
brahimmachkouri /
Created Dec 2, 2014
Adjust keyservers settings in puphpet file configurations
function replacehkp {
sedserver=`echo $1 | awk -F '.' '{ print $1 "\\\." $2 "\\\." $3 }'`
grep -ri "'$server" * | awk -F ':' '{ print $1 }' | xargs sed -i "s/'$sedserver/'hkp:\/\/$sedserver:80/g"
View .bashps1
export PS1="\[\e[00;33m\]\A\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[00;34m\]\u\[\e[0m\]\[\e[00;37m\] [\H] \[\e[0m\]\[\e[00;31m\]\w\[\e[0m\]\[\e[00;37m\]\n\[\e[0m\]\[\e[00;32m\]\\$\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
#!/usr/bin/env python
# encoding: utf-8
import tweepy #
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
brahimmachkouri /
Created Nov 7, 2015 — forked from trhura/
A small python script for cdp device discovery
#! /usr/bin/env python
# A small script for cdp devices discovery
import sys
import pcapy
import socket
from dpkt import ethernet
from dpkt import cdp
from docopt import docopt
brahimmachkouri / brotrainer.ct
Created Dec 23, 2015
Trainer made with Cheat Engine
View brotrainer.ct
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
<CETrainer Class="TTrainerForm" Encoding="Ascii85">#Zygh):Zrz)lwuh!4U{_PKXm45=pp7$,ERtX].p)A2(C7yIOVQ%5m57Kj3$9K;QEHFThRGHtohFPMi]uexCRFh],TF!tvShA.yBx9K.zHQ#%Oj*j/zNvi0?A:m5PQ%hoT^!hF^HjoKe+CdaLJni-Ipq(zpapu;Ps$mIs(R[hHS$@+s:FrD)DKBf}Z/@@5Rm:9,;Nd-V2C/qAiiWYRpz)y[)!eqv%RJ)Q)#@J!j)V!HlYrFdNTAr?VSqc]D9GDY,!}-w)]eCmEp{(B%w#VpoZW?HG(N*8Z0PE).m{w7hdVB![vT8S*%bnf)oa;r{$uJTb2wg,AlI72)/hkql)IxgTF@;AX!t@I*+gx08P%X=N%.yR@-DKbPhI{r_U^#o:Q!cAuH#1R^MR!WBq1{D(orild^HS8kZ%=aSn28i1*3J?3sRo[U!.MspyHjnQX#0Hk^w61lwDfXZj_[piod^oqpL)9Zp69H=Ix5FGwfYyEY;W//6ZqoBL?4%vGcGK(WqfoRCc(T@/8IV%({MhjKHJiUqY/QXkG4@3)2J6:S=hAQ+6-[DFHA2[$6OSyMJ83TXxnUcRW^8wu1vF8L-hhg8f6;Dd(xX4ExfFYc%]oF;TF+DZ4679uC$wW%1(WK:1kgQM(,WEmet]I]q;-z6pB;PO4j3Z/)gzrJn!Zsno{s8;Le=FsiVf)a[6)^rIOwd37K[Nzp8K5:yu8m;P97FzNkoSr$dUB3ZE{6SG[C2;13!Ddrn^9;9l^[srC.{-_jela7F*vON9Oa</CETrainer>
<Description>"Grenades infi
brahimmachkouri / AES.c
Created Jan 6, 2016 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
View AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* MCrypt API available online:
#include <mcrypt.h>