Skip to content

Instantly share code, notes, and snippets.

View itslukej's full-sized avatar
🥑

Luke James itslukej

🥑
View GitHub Profile
@itslukej
itslukej / joey.ts
Created December 18, 2025 10:40
Ah, nigga, don't hate me 'cause I'm beautiful, nigga. Maybe if you got rid of that old yee-yee ass haircut you got you'd get some bitches on your dick. Oh, better yet, maybe Tanisha'll call your dog-ass if she ever stop fuckin' with that brain surgeon or lawyer she fucking with. Nigga...
#!/usr/bin/env bun
import { PollyClient } from "@aws-sdk/client-polly";
import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity";
import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity";
import { getSynthesizeSpeechUrl } from "@aws-sdk/polly-request-presigner";
const REGION = "us-west-2";
const IDENTITY_POOL_ID = "us-west-2:42521701-f77a-4555-8b1c-e160ad0210da";
const polly = new PollyClient({
@itslukej
itslukej / lib.rs
Created December 18, 2025 08:51
lrclib.net pow cuda kernel
use cudarc::driver::{CudaDevice, LaunchAsync, LaunchConfig};
use cudarc::nvrtc::compile_ptx;
use data_encoding::HEXUPPER;
use ring::digest::{Context, SHA256};
use anyhow::{Result, anyhow};
use std::panic;
const CUDA_KERNEL: &str = r#"
// SHA256 constants
__constant__ unsigned int k[64] = {
// ==UserScript==
// @name Imgur.com → Imgur.lol
// @namespace https://luke.gg/
// @version 1.3
// @description i.imgur.com -> imgur.lol
// @author luke
// @match *://*/*
// @run-at document-start
// @grant none
// ==/UserScript==
@itslukej
itslukej / import.bash
Last active June 14, 2025 02:46
bgp.tools
curl -s -H "user-agent: " https://bgp.tools/table.jsonl \
| jq '{cidr: .CIDR, asn: .ASN, hits: .Hits}' \
| clickhouse-client --user admin --password "${CH_PWD}" --database bgp --query="INSERT INTO routes FORMAT JSONEachRow"
curl -s -H "user-agent: " https://bgp.tools/asns.csv \
| csvformat -U 1 -D ',' \
| python3 -c 'import csv,json,sys; [print(json.dumps({**row, "asn": int(row["asn"].replace("AS", ""))})) for row in csv.DictReader(sys.stdin) if (lambda asn: asn >= 0)(int(row["asn"].replace("AS", "")) if row["asn"].replace("AS", "").isdigit() else -1)]' \
| clickhouse-client --user admin --password "${CH_PWD}" --database bgp --query="INSERT INTO asns FORMAT JSONEachRow"
clickhouse-client --user admin --password "${CH_PWD}" --database bgp --query="OPTIMIZE TABLE asns FINAL"
@itslukej
itslukej / nginx.conf
Last active April 29, 2025 23:32
Emulates a syslog server to push nginx request data to StatsD. A lot of this is fit for my implementation
log_format json escape=json
'{'
'"timestamp":"$time_iso8601",'
'"request_time":"$request_time",'
'"request_time_ms":"$msec",'
'"upstream_cache_status":"$upstream_cache_status",'
'"remote_addr":"$remote_addr",'
'"cf_connecting_ip":"$http_cf_connecting_ip",'
'"range":"$http_range",'
'"uri":"$uri",'
#!/usr/bin/env python3
# Download your data dump and place this file in the messages folder of your data dump.
# Then run it!
from datetime import datetime, timedelta, timezone
import dateutil.parser
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
import csv
#!/usr/bin/env python3
# Download your data dump and place this file in the messages folder of your data dump.
# Then run it!
from datetime import datetime, timedelta, timezone
import dateutil.parser
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
import csv
@itslukej
itslukej / proxmox.md
Created December 3, 2023 15:52
Swap from legacy boot to UEFI - Proxmox ZFS
  1. Get a proxmox ISO mounted

  2. boot to bios, switch to uefi, boot to ISO

  3. head to Install Proxmox (Debug Mode) under advanced options

  4. press ctrl-d to launch a terminal

  5. mount zfs, then chroot into it

@itslukej
itslukej / tunneling.md
Created September 16, 2023 01:12
Tunneling a whole process through wireguard

Tunneling a whole process through wireguard

Certain company blocking a certain hosting provider? No problem, just tunnel the process through a small VPS with wireguard.

Consider server A your blocked server and server B your VPS.

Step 1: Generate a keypair on server A and server B

Server A:

# Caches movie covers, tv covers and other media
# Replace <YOUR PLEX TOKEN> with a random plex token
# docker-compose.yml
# varnish:
# image: "varnish:fresh"
# network_mode: "host"
# environment:
# VARNISH_SIZE: 2G
# VARNISH_HTTP_PORT: 32500