Skip to content

Instantly share code, notes, and snippets.

View huksley's full-sized avatar
🐈
Step on no pets

Ruslan Gainutdinov huksley

🐈
Step on no pets
View GitHub Profile
@huksley
huksley / decodeGoogleNewsUrl.ts
Last active July 3, 2026 20:07
This script decodes Google News generated encoded, internal URLs for RSS items
/**
* This magically uses batchexecute protocol. It's not documented, but it works.
*
* Licensed under: MIT License
*
* Copyright (c) 2024 Ruslan Gainutdinov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@huksley
huksley / next.config.js
Last active June 27, 2026 12:59
Modern nextjs custom server which supports both development mode and production standalone builds
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// Avoid ERR_MODULE_NOT_FOUND by transpiling motion, or framer-motion
transpilePackages: ["motion", "framer-motion"],
experimental: {
scrollRestoration: true,
webVitalsAttribution: ["CLS", "LCP"],
serverSourceMaps: true,
webpackBuildWorker: true,
@huksley
huksley / proxvm.sh
Last active May 26, 2026 20:30
Get list of all virtual machines on proxmox 4+, both LXC and QEMU and detect IP addresses
#!/bin/bash
# proxvm
# Output in specifed format (default csv) all virtual machines on proxmox 4+
SERVER=localhost
USERNAME=apiread@pve
PASSWORD=123456
FORMAT=csv
while [[ $# > 0 ]]; do
key="$1"
@huksley
huksley / mount-s3.sh
Last active May 25, 2026 06:51
Mount S3 as a directory using GeeseFS https://github.com/yandex-cloud/geesefs
#!/bin/bash
set -e
INSTALLS=""
if command -v fio >/dev/null 2>&1; then
echo "fio already installed"
else
INSTALLS="$INSTALL fio"
fi
@huksley
huksley / disabling-photoanalysisd.md
Last active May 12, 2026 18:35
Disabling photoanalysisd

For what it's worth (and with all the usual disclaimers about potentially making your mac unstable by disabling system services), here's some commands that will manipulate this service and services like it. Note the $UID in the command, that's just a bash shell variable that will resolve to some number. That's your numeric UID. You just run these commands from a Terminal command line. No special privileges needed.

If you want to disable it entirely, the first command stops it from respawning, and the second kills the one that is currently running:

launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd

(If you kill it without disabling it will die, but a new one will respawn and pick up where the old one left off)

@huksley
huksley / index.js
Last active January 22, 2026 05:57
No env @next/env
module.exports = {}
@huksley
huksley / LazyImport.patch
Created January 14, 2026 11:08
Disable LazyImport magic
diff --git a/sky/adaptors/common.py b/sky/adaptors/common.py
index 38c24ad4f..ceffb1fd3 100644
--- a/sky/adaptors/common.py
+++ b/sky/adaptors/common.py
@@ -59,18 +59,6 @@ class LazyImport(types.ModuleType):
except AttributeError:
# Dynamically create a new LazyImport instance for the submodule
submodule_name = f'{self._module_name}.{name}'
- try:
- # Check if the submodule exists
@huksley
huksley / .vscode-settings.json
Last active December 17, 2025 15:17
Automatic code formatting settings for VSCode - never commit to git - put it to .vscode/settings.json file
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.alwaysShowStatus": true,
"typescript.preferences.importModuleSpecifier": "non-relative",
"files.exclude": {
"**/.git": true,
@huksley
huksley / train.yml
Last active November 27, 2025 11:25
Skypilot + Verda Cloud training examples
#
# Example job to run on Verda Cloud (formerly DataCrunch).
# This will launch a cluster which will be autodeleted in 120 minutes and will run the training job on it.
#
# $ mkdir -p ${HOME}/.verda
# $ echo { "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" } > ${HOME}/.verda/config.json
# $ pip install skypilot[verda]
# $ sky launch -i 120 train.yaml
#
name: minGPT-ddp
@huksley
huksley / deploy-cluster.sh
Last active November 21, 2025 08:37
Deploy B300, 200 or H200 clusters via Verda Cloud (formerly DataCrunch) API
#!/usr/bin/env bash
set -euo pipefail
if [ $# -lt 1 ]; then
echo "usage: $0 ENVIRONMENT" >&2
exit 1
fi
ENVIRONMENT="$1"