Skip to content

Instantly share code, notes, and snippets.

View muayyad-alsadi's full-sized avatar

Muayyad Alsadi muayyad-alsadi

View GitHub Profile
from aiohttp import web
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from starlette.requests import Request as ASGIRequest
from aiohttp_asgi import ASGIResource
aiohttp_app = web.Application()
app = FastAPI()
@muayyad-alsadi
muayyad-alsadi / my_cracker.py
Created December 29, 2022 12:13
priority cracker
import random
import itertools
ord_a = ord('a')
ord_z = ord('z')
ord_A = ord('A')
ord_Z = ord('Z')
alpha = [chr(i) for i in range(ord_a, ord_z)]
ALPHA = [chr(i) for i in range(ord_A, ord_Z)]
alphanum = alpha+ALPHA+list('0123456789')
@muayyad-alsadi
muayyad-alsadi / helloworld.proto
Last active November 10, 2021 14:40 — forked from dvas0004/decompiler.py
grpc-web reverse engineer, just pass the minified javascript file
syntax = "proto3";
package helloworld;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloResponse);
rpc SearchResults (Empty) returns (SearchResponse);
}
message HelloRequest {
@muayyad-alsadi
muayyad-alsadi / aiotools.py
Last active March 29, 2021 17:05
aiotools unordered_bulks
import asyncio
# also consider asyncio.Semaphore(10) see https://docs.python.org/3/library/asyncio-sync.html#semaphore
async def unordered_bulks(size, aiterable):
tasks = set()
async for task in aiterable:
tasks.add(task)
if len(tasks)>=size:
for coro in asyncio.as_completed(tasks):
yield coro
@muayyad-alsadi
muayyad-alsadi / transform_graph.py
Last active August 1, 2019 11:53
pure python tensorflow transform_graph
#! /usr/bin/env python
from __future__ import print_function
import argparse
import os
import tensorflow as tf
# from tensorflow.python.framework import graph_util
# from tensorflow.python.framework import graph_io
@muayyad-alsadi
muayyad-alsadi / git_ps1.rc
Created November 14, 2018 13:55
add git branch to bash prompt
# add the below to your ~/.bash_profile
parse_git_branch() {
[ -d .git ] && {
echo -n '@'
git rev-parse --abbrev-ref HEAD
}
}
export PS1='[\u@\h \W$(parse_git_branch)]\$ '
@muayyad-alsadi
muayyad-alsadi / rnd_pool.py
Created July 27, 2018 15:40
tensorflow 2D random pooling
import tensorflow as tf
import numpy as np
import math
PADDING_VALID, PADDING_SAME = 'VALID', 'SAME'
FORMAT_NHWC, FORMAT_NCHW = 'NHWC', 'NCHW'
# TODO: support N=?
def rnd_pooling2d(inputs, ksize=2, strides=2, padding=PADDING_VALID, data_format=FORMAT_NHWC, name=None):
@muayyad-alsadi
muayyad-alsadi / docker-compose.yml
Last active January 1, 2018 17:52
AWX docker compose
version: '3'
services:
postgres:
image: "postgres:9.6"
environment:
POSTGRES_USER: awx
POSTGRES_PASSWORD: awxpass
POSTGRES_DB: awx
rabbitmq:
diff --git a/README.md b/README.md
index f224b04..c272d09 100644
--- a/README.md
+++ b/README.md
@@ -186,7 +186,8 @@ then just `pip install dumb-init`.
## Usage
Once installed inside your Docker container, simply prefix your commands with
-`dumb-init`.
+`dumb-init` (and make sure that you're using [the recommended JSON
@muayyad-alsadi
muayyad-alsadi / debian-ssl.txt
Created June 1, 2016 20:59
openssl ciphers in linux
AES128-GCM-SHA256
AES128-SHA
AES128-SHA256
AES256-GCM-SHA384
AES256-SHA
AES256-SHA256
CAMELLIA128-SHA
CAMELLIA256-SHA
DES-CBC3-SHA
DHE-DSS-AES128-GCM-SHA256