Skip to content

Instantly share code, notes, and snippets.

#!/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 / 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
@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 / 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 / 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:

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies

@brahimmachkouri
brahimmachkouri / aes-cfb-example.go
Created December 24, 2016 12:46 — forked from temoto/aes-cfb-example.go
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))
@brahimmachkouri
brahimmachkouri / pushbullet.php
Created March 31, 2017 17:52 — forked from ghostbitmeta/pushbullet.php
Synology + Pushbullet
<?php
// Used code from the following sources:
// https://gist.github.com/styxit/e34d4c6f8cb23d55f5af#file-synology-pushover-php
// http://pastebin.com/iHAFAHGq
// Thanks to: https://styxit.com/2014/05/10/synology-pushover.html
// Only allow request made by localhost?
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
@brahimmachkouri
brahimmachkouri / FilesSnapshot.xml
Created January 8, 2020 18:00
setuserfta v1.7.1 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\setuserfta\setuserfta.nupkg" checksum="89CC7893D63C1EBB7C197C96F92DB706" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\setuserfta.nuspec" checksum="89839B7401F25F411F211FDE27A68D46" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\SetUserFTA.zip.txt" checksum="800F22077EB541F743EBAE8C49647854" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\chocolateyInstall.ps1" checksum="E47D4E57864F5C479884AD819CDBE6EA" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\EULA.txt" checksum="E8BB21C92A8C13EFA572DC3B2AC5F538" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\SetUserFTA\EULA.txt" checksum="E8BB21C92A8C13EFA572DC3B2AC5F538" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\SetUserFTA\SetUserFTA - the kolbicz blog.url"