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 http from 'http'; | |
import httpProxy from 'http-proxy'; | |
// Create a proxy server with custom application logic | |
const proxy = httpProxy.createProxyServer({}); | |
// Create your server that makes an operation that waits a while | |
// and then proxies the request | |
http.createServer((req, res) => { | |
// Modify headers |
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
# Prioritize NVIDIA packages | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin | |
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
# Fetch NVIDIA keys | |
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | |
# Add NVIDIA repos | |
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" |
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 sqlite from 'better-sqlite3'; | |
let populate_data = ` | |
-- Create the 'customers' table | |
CREATE TABLE IF NOT EXISTS customers ( | |
customer_id INTEGER PRIMARY KEY, | |
first_name TEXT, | |
last_name TEXT, | |
email 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 sqlite3 from 'sqlite3'; | |
import fs from 'node:fs/promises' | |
import { glob } from 'glob' | |
import {fromMarkdown} from 'mdast-util-from-markdown' | |
import {frontmatter} from 'micromark-extension-frontmatter' | |
import {frontmatterFromMarkdown, frontmatterToMarkdown} from 'mdast-util-frontmatter' | |
import { syntax } from 'micromark-extension-wiki-link' | |
import * as wikiLink from 'mdast-util-wiki-link' | |
// const db = new sqlite3.Database(':memory:'); |
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
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() |
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
version: '3.1' | |
services: | |
db: | |
image: postgres | |
container_name: postgres | |
restart: always | |
environment: | |
POSTGRES_USER: postgres |
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
version: '3.1' | |
services: | |
db: | |
image: postgres | |
container_name: postgres2 | |
restart: always | |
environment: | |
POSTGRES_USER: postgres |
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
# 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 |
NewerOlder