Skip to content

Instantly share code, notes, and snippets.

View mekza's full-sized avatar
🍷

Martin-Zack Mekkaoui mekza

🍷
View GitHub Profile
@mekza
mekza / keybase.md
Last active November 22, 2016 10:44

Keybase proof

I hereby claim:

  • I am mekza on github.
  • I am martinzack (https://keybase.io/martinzack) on keybase.
  • I have a public key whose fingerprint is 2A2C 76AF 2787 C7EC 3EAC F618 19B3 5E48 4E16 E5E4

To claim this, I am signing this object:

@mekza
mekza / betterthanboto.py
Last active September 29, 2023 17:40
Signed URLs and Signed Cookies for CloudFront in Python with boto
from boto.cloudfront.distribution import Distribution
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
import base64
class BetterThanBoto(Distribution):
def sign_rsa(self, message):

Keybase proof

I hereby claim:

  • I am mekza on github.
  • I am martinzack (https://keybase.io/martinzack) on keybase.
  • I have a public key whose fingerprint is 4D2D C6E3 6C40 A59E 5F15 1E49 06ED B97F 4C30 871F

To claim this, I am signing this object:

@mekza
mekza / countries.py
Last active December 23, 2022 23:04
WTForms Select Field for country
from wtforms import SelectField
import pycountry
class CountrySelectField(SelectField):
def __init__(self, *args, **kwargs):
super(CountrySelectField, self).__init__(*args, **kwargs)
self.choices = [(country.alpha_2, country.name) for country in pycountry.countries]
@mekza
mekza / nginx.conf
Created February 2, 2014 21:43
Quick reverse proxy to pretend you are in France

1- Have a server in France

2- Install nginx

3- Configure it

4- Start it

5- PROFIT

#!/usr/bin/python
# -*- coding:utf-8 -*-
import itertools
import requests
import json
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
password_length = 6
gen = itertools.combinations_with_replacement(characters,password_length)
@mekza
mekza / genmac.py
Last active December 16, 2015 05:58
Mac address Generator
#!/usr/bin/env python
import random
def GenMac(number):
mac_list = []
for i in range(number):
mac = [ 0x52, 0x54, 0x00,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
root@filer-1:~# dmesg
March 25, 2013 07:25:19 PM CET
Mar 25 19:18:01 filer-1 nfs4cbd[489]: [ID 867284 daemon.notice] nfsv4 cannot determine local hostname binding for transport tcp6 - delegations will not be available on this transport
Mar 25 19:18:01 filer-1 isa: [ID 202937 kern.info] ISA-device: asy1
Mar 25 19:18:01 filer-1 genunix: [ID 936769 kern.info] asy1 is /pci@0,0/isa@1f/asy@1,3f8
Mar 25 19:18:01 filer-1 isa: [ID 202937 kern.info] ISA-device: asy0
Mar 25 19:18:01 filer-1 genunix: [ID 936769 kern.info] asy0 is /pci@0,0/isa@1f/asy@1,2f8
Mar 25 19:18:02 filer-1 rootnex: [ID 349649 kern.info] xsvc0 at root: space 0 offset 0
Mar 25 19:18:02 filer-1 genunix: [ID 936769 kern.info] xsvc0 is /xsvc@0,0
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -Ilevent2 -Ilevent2/include -D_XPG4_2=1 -I/usr/local/include -I/usr/include/yajl -g -O2 -pthread -MT yajl_version.o -MD -MP -MF .deps/yajl_version.Tpo -c -o yajl_version.o yajl_version.c
yajl_version.c:1:31: error: yajl/yajl_version.h: No such file or directory
yajl_version.c: In function ‘yajl_version’:
yajl_version.c:5: error: ‘YAJL_VERSION’ undeclared (first use in this function)
yajl_version.c:5: error: (Each undeclared identifier is reported only once
yajl_version.c:5: error: for each function it appears in.)
make[3]: *** [yajl_version.o] Error 1
make[3]: Leaving directory `/usr/src/Pincaster/src/yajl'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/usr/src/Pincaster/src/yajl'
@mekza
mekza / python_dev_fr.markdown
Last active December 12, 2015 04:58
Job Python à Paris.

Développeur Python

A propos de Swelen

Swelen est une start-up en plein essor basée à Paris. Nous sommes spécialisé dans le traitement et la diffusion de l'information numérique. Notre technologie est capable de recommander des annonces publicitaires pertinentes et de façon intelligente. Elle repose sur des analyses anonymes effectuées sur l’engagement des internautes et sur leur intelligence collective. Aujourd’hui, la technologie publicitaire de Swelen est utilisée par la plupart des régies mobiles et des grands éditeurs français.

Vos Responsabilités

Vous rejoindrez la team Infrastructure.