Skip to content

Instantly share code, notes, and snippets.

View ahmed-bhs's full-sized avatar
👽

Ahmed EBEN HASSINE 脳の流れ ahmed-bhs

👽
View GitHub Profile
# ROT Encoder/Decoder now with input validation.
import sys
# Sets alphabet characters for comparison.
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p",
"q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
# Performs ROTation based on user input.
import requests
import qrtools
import re,os
def decode_qr(r,i):
img="http://35.184.20.243:8002/qrweb/"+r[10:22]
os.system("curl "+img+" >> code"+str(i)+".png")
qr = qrtools.QR()
qr.decode("code"+str(i)+".png")
return qr.data
@ahmed-bhs
ahmed-bhs / a.py
Last active February 4, 2018 20:57
import requests
import qrtools
import re,os
from shell_command import shell_call
shell_call("rm -f *.png")
def decode_qr(r):
img="http://35.184.20.243:8002/qrweb/img/"+r
os.system("curl "+img+" >> "+r)
qr = qrtools.QR()
from PIL import Image
im = Image.open("binpeg.jpg")
rgb_im = im.convert('RGB')
w,h= rgb_im.size
#size is 256 by 256
st=''
k=0
for x in range(h):
for y in range(w):
  1. create ssymfony app with security compononet with 4 times bcrypt algo encrypted password.
  2. give the player only .git with a recent commit
  3. create a login page under md5(admin)/login.php + captcha controle
  4. use crc32(pass) function to hash the password
#!/usr/bin/env python
import sys
def score(text):
charset = "_{}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.'\n"
p = 0
for s in text:
if s in charset or s == ' ' or s == '\'':
p+=1
return p
security:
encoders:
Gain\Bundle\UserBundle\Entity\User: sha512
role_hierarchy:
ROLE_ACCESS_BACKEND: []
ROLE_ACCESS_FRONTEND: []
ROLE_ADMIN: [ROLE_USER, ROLE_ACCESS_BACKEND]
ROLE_ADMIN_PUBLISHER: [ROLE_USER, ROLE_ACCESS_BACKEND] # Not used yet 2017-09-06
@ahmed-bhs
ahmed-bhs / gist:6a4ad11acc2dc9d0679f818181364192
Created March 25, 2018 17:05 — forked from tlrobinson/gist:1073865
Autocomplete Makefile targets. Add this to your shell config file.
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make
    /**
     * @param mixed  $entity
     * @param array  $parameters
     * @param string $method
     * @param array  $validationGroups
     *
     * @throws InvalidFormException
     *
     * @return mixed
portal/src/Member/
├── Domain
│   ├── Command
│   │   ├── Baresto
│   │   └── Gain
│   ├── Handler
│   │   ├── Baresto
│   │   └── Gain
│   ├── Model