Skip to content

Instantly share code, notes, and snippets.

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

bjarneo bjarneo

🏠
Working from home
View GitHub Profile
@bjarneo
bjarneo / coolify.tf
Created November 6, 2024 06:44
Using the Coolify predefined image
# Set the variable value in *.tfvars file
# or using the -var="hcloud_token=..." CLI option
variable "hcloud_token" {
type = string
default = ""
}
# Set the path to your SSH key
variable "ssh_key" {
type = string
@bjarneo
bjarneo / .js
Created May 3, 2025 17:24
pgmqdemo
import pkg from 'pg';
const { Pool, Client } = pkg;
const DATABASE_NAME = 'queue_demo';
const QUEUE_NAME = 'my_simple_queue';
const DEFAULT_DB = 'postgres';
const dbConfig = {
user: 'postgres',
host: 'localhost',
@bjarneo
bjarneo / .sh
Created May 4, 2025 17:32
psql cheatsheet
# psql Cheatsheet
# Connect to a specific database as a specific user
psql -d mydatabase -U myuser -h localhost -p 5432
# Connect using defaults
psql
# List all psql meta-commands
\?
@bjarneo
bjarneo / .sh
Last active July 1, 2025 19:27
coercion.sh
#!/bin/bash
# The URL to which the curl requests will be sent
URL="http://localhost:5173/api/healthz"
# The total duration to run the script in seconds (10 minutes)
END_TIME=$((SECONDS + 600))
# The target number of concurrent curl processes
CONCURRENCY=400
@bjarneo
bjarneo / .sh
Created July 5, 2025 14:01
dmi_fetch.sh
#!/bin/bash
#
# dmi_fetch.sh
#
# This script gathers system information from `dmidecode` across multiple types
# and presents it in a static, 2x2 'btop'-like dashboard view.
#
# It requires root privileges to run dmidecode and will prompt for them.
#
# Usage: ./dmi_fetch.sh
variable "hcloud_token" {}
# Configure the Hetzner Cloud Provider
provider "hcloud" {
token = var.hcloud_token
}
resource "hcloud_server" "server" {
name = "sandbox1"
server_type = "cx22"
@bjarneo
bjarneo / package_search.sh
Last active September 17, 2025 07:19
Search for packages affected by the Shai-Halud attack
#!/bin/bash
# Extract packages from npm.sh and search for them across the system
# This script searches through package.json, yarn.lock, bun files, and node_modules
# Default search paths (can be overridden with SEARCH_PATHS environment variable)
DEFAULT_SEARCH_PATHS="/Users/ob907/Code"
SEARCH_PATHS="${SEARCH_PATHS:-$DEFAULT_SEARCH_PATHS}"
# Array of packages with versions extracted from npm.sh
@bjarneo
bjarneo / .sh
Created September 25, 2025 16:40
ansi.sh
#!/bin/bash
set -euo pipefail
# This script displays the 16 standard ANSI colors (0-15) as large squares
# in two rows: first row shows colors 0-7, second row shows colors 8-15
echo ""
# First row: ANSI colors 0-7 (dark colors)
@bjarneo
bjarneo / .lua
Created October 12, 2025 06:13
aether.nvim with custom colors
return {
{
"bjarneo/aether.nvim",
name = "aether",
priority = 1000,
opts = {
disable_italics = false,
colors = {
-- Monotone shades (base00-base07)
base00 = "#141114", -- Default background
@bjarneo
bjarneo / hackerman.json
Created October 20, 2025 18:05
Hackerman Blueprint for Aether
{
"name": "Hacker",
"timestamp": 1760965387035,
"palette": {
"wallpaper": "",
"colors": [
"#0B0C16",
"#31f759",
"#4fe88f",
"#50f7d4",