Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
brahimmachkouri / nano_apache_syntax_hilighting
Created June 12, 2016 14:27
Gives nano syntax highlighting for Apache configuration files
# Apache files
syntax "apacheconf" "httpd\.conf|mime\.types|\.conf$"
color yellow ".+"
color brightcyan "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
color brightcyan "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
color brightcyan "(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"
color brightcyan "(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"
color brightcyan "(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"
color brightcyan "(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLD
@brahimmachkouri
brahimmachkouri / .bashrc
Last active September 5, 2023 15:18
To Download : wget bit.ly/my-bashrc
alias ll='ls -laFhGH'
alias h='history'
alias cd..='cd ..'
alias df='df -h'
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
bleu="\[\e[0m\]\[\e[00;34m\]"
@brahimmachkouri
brahimmachkouri / export_csv_win.php
Created January 24, 2016 19:57
PHPExcel : Enregistrement CSV en ISO-8859-1, avec tabulation comme séparateur, pas de délimiteur, et retour à la ligne façon Windows.
// enregistrement du fichier
$objWriter = PHPExcel_IOFactory::createWriter($objWorksheet, 'CSV');
$objWriter->setEnclosure("");
$objWriter->setDelimiter("\t");
$objWriter->setLineEnding("\r\n"); // cr lf (Windows)
ob_start();
$objWriter->save('php://output');
$excelOutput = ob_get_clean();
// conversion en iso-8859-1, car PHPExcel genere de l'utf-8
$f = mb_convert_encoding($excelOutput, 'iso-8859-1');
@brahimmachkouri
brahimmachkouri / PHPExcel_Basics.md
Created January 22, 2016 20:40 — forked from r-sal/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@brahimmachkouri
brahimmachkouri / output.php
Created January 22, 2016 20:26 — forked from IamSmith/output.php
Output as a download
<?php
$phpExcel = new PHPExcel();
$phpExcel->getActiveSheet()->setTitle("My Sheet");
$phpExcel->setActiveSheetIndex(0);
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"filename.xls\"");
header("Cache-Control: max-age=0");
$objWriter = PHPExcel_IOFactory::createWriter($phpExcel, "Excel5");
@brahimmachkouri
brahimmachkouri / AES.c
Created January 6, 2016 18:12 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@brahimmachkouri
brahimmachkouri / brotrainer.ct
Created December 23, 2015 19:50
Trainer made with Cheat Engine
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
<Forms>
<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>
</Forms>
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"Grenades infi
@brahimmachkouri
brahimmachkouri / cdp.py
Created November 7, 2015 03:35 — forked from trhura/cdp.py
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
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@brahimmachkouri
brahimmachkouri / .bashps1
Created January 10, 2015 14:21
Bash Prompt
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\]"