Skip to content

Instantly share code, notes, and snippets.

View hottabxp's full-sized avatar
🏠
Working from home

hottabxp

🏠
Working from home
View GitHub Profile
USER='username'
PASS='passwd'
sudo useradd -m -d /home/$USER --password $(echo "$PASS" | openssl passwd -1 -stdin ) $USER
# omit 1,2 if env variables are otherwise set.
@hottabxp
hottabxp / .bash_aliases
Created February 18, 2021 22:13 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@hottabxp
hottabxp / main.cpp
Created February 6, 2021 21:19 — forked from alexey-detr/main.cpp
Читаем заголовок WAV файла на C++
#include <stdio.h>
#include <tchar.h>
#include <conio.h>
#include <math.h>
// Структура, описывающая заголовок WAV файла.
struct WAVHEADER
{
// WAV-формат начинается с RIFF-заголовка:
@hottabxp
hottabxp / cross-compile-zlib-windows.sh
Created January 30, 2021 17:39 — forked from artynet/cross-compile-zlib-windows.sh
Cross compile zLib for mingw32-w64
#!/bin/bash
# PREFIXDIR=$HOME/Programmi/Zlib-1.2.11-win32-x86
PREFIXDIR=$HOME/Programmi/win32-cross
make -f win32/Makefile.gcc BINARY_PATH=$PREFIXDIR/bin INCLUDE_PATH=$PREFIXDIR/include LIBRARY_PATH=$PREFIXDIR/lib SHARED_MODE=1 PREFIX=i686-w64-mingw32- install
@hottabxp
hottabxp / img_sqlite3.py
Created February 19, 2020 16:53
Write image to sqlite3
import sqlite3
import base64
file_db = 'mydb.db'
def create_db(filename):
conn = sqlite3.connect(filename)
cursor = conn.cursor()
cursor.execute("CREATE TABLE MyTable(id INTEGER,name TEXT)")
@hottabxp
hottabxp / FindPng.py
Created February 19, 2020 16:47
Поиск png в бинарных файлах
import random
with open('wiatArms.is','rb') as file:
data = file.read()
def save_File(data,filename):
with open(f'{filename}.png','wb') as file:
file.write(data)
@hottabxp
hottabxp / main.py
Created January 31, 2020 16:48
Find bytes in binary files
with open('test.mp3','rb') as file:
data = file.read()
start_png = data.find(bytes.fromhex('89 50 4E 47 0D 0A 1A 0A'))
end_png = data.find(bytes.fromhex('49 45 4E 44 AE 42 60 82'))+8
with open('test.png','wb') as f:
f.write(data[start_png:end_png])
print(start_png)
print(end_png)