Skip to content

Instantly share code, notes, and snippets.

@dentropy
dentropy / delete_all_sqlite_tables.py
Created April 13, 2023 03:00
SQLAlchemy Delete all tables in database
from sqlalchemy import create_engine, MetaData
import os
# set up the connection to the database
engine_path = "sqlite+pysqlite:///" + "/".join(os.getcwd().split("/")) + "/scraped_data.db"
engine = create_engine(engine_path)
conn = engine.connect()
# get all table names
meta = MetaData()
@dentropy
dentropy / docker-compose.yml
Last active August 4, 2023 08:35
Second postgres docker-compose
version: '3.1'
services:
db:
image: postgres
container_name: postgres
restart: always
environment:
POSTGRES_USER: postgres
@dentropy
dentropy / postgres2.yml
Last active August 4, 2023 08:36
Postgres docker-compose
version: '3.1'
services:
db:
image: postgres
container_name: postgres2
restart: always
environment:
POSTGRES_USER: postgres
# REMEMBER TO CHANGE THIS TO APP YOU WANT PASSWORD FOR
# App name can be found in umbrel-app.yml for example ./mediagoblin/umbrel-app.yml
app=mediagoblin
UMBREL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)"
# UMBREL_ROOT when umbrel installed on user dentropy is /home/dentropy/umbrel/app-data
app_entropy_identifier="app-${app}-seed"
derive_entropy () {
# Make sure we use the seed from the real Umbrel installation if this is
num_lines = 3
import os
from glob import glob
files = glob("./dentropydaemon-wiki/**", recursive=True)
from pprint import pprint
for file_name in files:
if "md" in file_name and os.path.isfile(file_name):
file_contents = open(file_name, 'r').readlines()[3:]
new_file = open(file_name, 'w')
new_file.write("".join(file_contents))
prepend_string = '''---
share: true
---
'''
import os
from glob import glob
files = glob("./files/**", recursive=True)
from pprint import pprint
for file_name in files:
if "md" in file_name and os.path.isfile(file_name):
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run > ~/code-server-install.txt
curl -fsSL https://code-server.dev/install.sh | sh
echo -e "export PASSWORD=\`tr -cd '[:alnum:]' < /dev/urandom | fold -w31 | head -n1\`" > ~/run-code-sever.sh
echo -e "PASSWORD=\$PASSWORD" >> ~/run-code-sever.sh
echo -e "echo 'Password posted below'" >> ~/run-code-sever.sh
echo -e "echo \$PASSWORD" >> ~/run-code-sever.sh
echo "code-server --disable-telemetry --cert --auth password --bind-addr 0.0.0.0:8082" >> ~/run-code-sever.sh
chmod +x ~/run-code-sever.sh
cat ~/run-code-sever.sh
~/run-code-sever.sh
["https://github.com/bitcoin/bitcoin","https://github.com/bitcoin/bips","https://github.com/ethereum/go-ethereum","https://github.com/ethereum/py-evm","https://github.com/ethereum/aleth","https://github.com/ethereum/web3.py","https://github.com/ethereum/solidity","https://github.com/ethereum/sharding","https://github.com/ethereum/casper","https://github.com/paritytech/parity","https://github.com/solana-labs/solana","https://github.com/input-output-hk/cardano-sl","https://github.com/input-output-hk/js-cardano-wasm","https://github.com/input-output-hk/plutus","https://github.com/input-output-hk/rust-cardano","https://github.com/input-output-hk/cardano-chain","https://github.com/paritytech/polkadot","https://github.com/dogecoin/dogecoin","https://github.com/dogecoin/libdohj","https://github.com/centrehq/centre-tokens","https://github.com/terra-project/core","https://github.com/litecoin-project/litecoin","https://github.com/smartcontractkit/chainlink","https://github.com/smartcontractkit/chainlink-ruby","https://
// 2
const { Ed25519Provider } = require('key-did-provider-ed25519')
//import { Ed25519Provider } from 'key-did-provider-ed25519'
// 3
const { randomBytes } = require('@stablelib/random')
const seed = randomBytes(32)
// 4
const provider = new Ed25519Provider(seed)