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 | |
# Exit on any error | |
set -e | |
echo "🚀 Starting Password Entropy Calculator setup..." | |
# Create project structure | |
PROJECT_DIR="password-entropy-calc" | |
mkdir -p $PROJECT_DIR/{cmd/server,wasm,static} |
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 | |
# Exit on any error | |
set -e | |
echo "🚀 Starting Go WASM Hello World setup..." | |
# Check if Go is installed, if not install it | |
if ! command -v go &> /dev/null; then | |
echo "📦 Installing Go..." |
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 | |
echo "Listing processes and their associated user namespaces:" | |
for pid in $(ls /proc | grep '^[0-9]*$'); do | |
if [ -e /proc/$pid/ns/user ]; then | |
# Get the process command line | |
cmdline=$(cat /proc/$pid/cmdline | tr '\0' ' ') | |
# Get the process owner |
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 | |
# bash_c_example.sh | |
# Directory to store the C source file and the executable | |
EXAMPLES_DIR="$HOME/bash_c_examples" | |
# Ensure the directory exists, create it if not | |
mkdir -p "$EXAMPLES_DIR" | |
# Check if hello_world.c and hello_world executable already exist |
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
# bcrypt-argon2-pbkdf2-hash-test.py | |
import threading | |
import bcrypt | |
from pwdlib.hashers import argon2 | |
from pwdlib import PasswordHash | |
from pwdlib.hashers.argon2 import Argon2Hasher | |
from hashlib import pbkdf2_hmac | |
import time | |
import psutil |
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
# lnd-postgres-kv-decoder.py | |
from decouple import config | |
import psycopg2 | |
import psycopg2.extras | |
import pandas as pd | |
import time | |
tables = ['channeldb_kv', 'decayedlogdb_kv', 'macaroondb_kv', | |
'towerclientdb_kv', 'towerserverdb_kv', 'walletdb_kv'] |
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
### PostgreSQL: format multiple columns into string for each row using a semicolon as separator between fields | |
``` | |
SELECT | |
FORMAT('%s; %s; %s; %s', | |
col_one, col_two, col_three, col_four) | |
AS entries | |
FROM table_name; | |
``` |
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
[Unit] | |
Description=I2P Router written in C++ | |
Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/ | |
After=network.target | |
ConditionFileIsExecutable=/usr/sbin/i2pd | |
[Service] | |
User=i2pd | |
Group=i2pd | |
RuntimeDirectory=i2pd |
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
# bitcoin-inflation.py | |
# based on: https://github.com/ndsvw/Bitcoin-Supply-Calculator/blob/master/btcsupply.py | |
def btc_supply_at_block(b): | |
max_supply = 20999999.9769 | |
if b >= 33 * 210000: | |
return max_supply, 1.0 | |
else: | |
reward = 50e8 | |
supply = 0 |
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
### Python Clean Code Tips & Tools | |
Check the quality of your code inside your CI pipeline. | |
- flake8 - style guide enforcer | |
- black - code formatting | |
- isort - optimize imports | |
- bandit - check for security vulnerabilities | |
- safety - check for security vulnerabilities of dependencies |
NewerOlder