This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <tchar.h> | |
#include <conio.h> | |
#include <math.h> | |
// Структура, описывающая заголовок WAV файла. | |
struct WAVHEADER | |
{ | |
// WAV-формат начинается с RIFF-заголовка: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |