Skip to content

Instantly share code, notes, and snippets.

View SofianeHamlaoui's full-sized avatar
:octocat:
Making the world a better place

Sofiane Hamlaoui SofianeHamlaoui

:octocat:
Making the world a better place
View GitHub Profile
@SofianeHamlaoui
SofianeHamlaoui / docker-compose.yml
Created June 9, 2024 17:14
Updated Project Send Docker Compose File
services:
projectsend:
image: linuxserver/projectsend
container_name: projectsend
environment:
- PUID=998
- PGID=100
- TZ=Europe/Paris
- MAX_UPLOAD=51200
volumes:
@SofianeHamlaoui
SofianeHamlaoui / MetaTags.md
Created December 18, 2023 18:11
Meta Tags

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
<meta name='language' content='ES'>
<meta name='robots' content='index,follow'>
@SofianeHamlaoui
SofianeHamlaoui / AesUsage.py
Created November 23, 2023 13:39
AES usage in Python using the cryptography python module
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives.padding import PKCS7
from cryptography.hazmat.backends import default_backend
import base64
def aesencrypt(plaintext, key):
cipher = Cipher(algorithms.AES(key), modes.ECB(), backend=default_backend())
encryptor = cipher.encryptor()
padder = PKCS7(algorithms.AES.block_size).padder()
padded_data = padder.update(plaintext) + padder.finalize()
@SofianeHamlaoui
SofianeHamlaoui / convert.py
Created July 18, 2023 09:15
Converting EPSG 4326 to EPSG 2154 using X,Y,Z
def convert_coordinates(x, y, z):
src_crs = pyproj.CRS.from_epsg(4326)
dest_crs = pyproj.CRS.from_epsg(2154)
transformer = pyproj.Transformer.from_crs(src_crs, dest_crs, always_xy=True)
# Perform the transformation
dest_x, dest_y, dest_z = transformer.transform(x, y, z)
return dest_x, dest_y, dest_z
@SofianeHamlaoui
SofianeHamlaoui / file.obj
Created June 23, 2023 07:16
Test OBJ file of buildings
This file has been truncated, but you can view the full file.
o
v -350.9375 -202 7.996002197265625
v -350.0625 -201 7.996002197265625
v -347.3125 -197.5 7.996002197265625
v -347.3125 -197.5 7.996002197265625
v -347.0625 -197 7.996002197265625
v -347.8125 -197.5 7.996002197265625
v -351.0625 -201.5 7.996002197265625
v -351.1875 -202.5 7.996002197265625
v -350.9375 -202 7.996002197265625
@SofianeHamlaoui
SofianeHamlaoui / instance.sh
Created June 28, 2022 09:52
Get AWS Instance IP
#!/bin/bash
echo "Instance Name ?"
read name
aws ec2 describe-instances --filters 'Name=tag:Name,Values='$name --query 'Reservations[*] .Instances[*].PublicIpAddress' --output text
@SofianeHamlaoui
SofianeHamlaoui / GetRandomBuf.c
Last active March 11, 2022 13:22
Conti.Functions()
char* GetRandomBuf()
{
char tempFileName[MAX_PATH];
char targetFileName[MAX_PATH];
// random
size_t randomNum = 8;
WIN32_FIND_DATAA ffd;
DWORD size = 0;
@SofianeHamlaoui
SofianeHamlaoui / prnt.sc_Dowloader.py
Created March 9, 2022 17:38
Python script to download from prnt.sc worst screenshot tool used by the worst people in this univers.
import re
import requests
from bs4 import BeautifulSoup as BS
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.71'
}
with open('links.txt') as f:
Lines = f.readlines()
count = 0
@SofianeHamlaoui
SofianeHamlaoui / haproxy.cfg
Created March 6, 2022 13:52
HAProxy to Nginx (Web + V2Ray WebSocket) + OpenConnect + ShadowsocksR (TLS OBFS)
defaults
timeout connect 5s
timeout client 24h
timeout server 24h
global
log /dev/log local0
frontend ssl
log global
import re
import sys
key=sys.argv[1]
REGEX = {
"MD5 Hash":"[a-f0-9]{32}",
"Artifactory API Token":'(?:\s|=|:|"|^)AKC[a-zA-Z0-9]{10,}',
"Basic Auth Credentials":"(?<=:\/\/)[a-zA-Z0-9]+:[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z]+",
"Cloudinary Basic Auth":"cloudinary:\/\/[0-9]{15}:[0-9A-Za-z]+@[a-z]+",