Skip to content

Instantly share code, notes, and snippets.

View amoilanen's full-sized avatar
💭
"Simplicity is prerequisite for reliability." Edsger W. Dijkstra

Anton Moilanen amoilanen

💭
"Simplicity is prerequisite for reliability." Edsger W. Dijkstra
View GitHub Profile
@amoilanen
amoilanen / ascii_to_string.js
Created August 26, 2026 20:22
Convert an array of ASCII codes into a String
// Converts an array of ASCII character codes into a String.
function asciiToString(codes) {
// String.fromCharCode expands the array into individual char-code arguments
return String.fromCharCode(...codes);
}
// The specific input to decode
const input = [
82, 101, 100, 105, 115, 69, 114, 114, 111, 114, 58, 32, 73, 110,
118, 97, 108, 105, 100, 32, 83, 69, 84, 32, 99, 111, 109, 109, 97,
@amoilanen
amoilanen / install_claude_desktop.sh
Last active July 5, 2026 14:04
Install Claude Desktop and Zenflow on an Arch based Linux
#!/usr/bin/env bash
#
# Install the latest Claude Desktop on any Arch Linux derivative
# (Arch, Manjaro, EndeavourOS, CachyOS, Garuda, ...).
#
# Anthropic only ships Claude Desktop as a Debian .deb (amd64). Rather than
# rely on dpkg, we resolve the newest package from Anthropic's apt repository,
# verify its SHA256, extract it, and copy the /opt and /usr payload into place.
set -euo pipefail
@amoilanen
amoilanen / opencode_and_ollama_useful_configs_commands.md
Last active September 13, 2025 21:45
Useful commands and configs for Ollama and Opencode

Managing Ollama models

ollama run qwen3:0.6b
ollama stop qwen3:0.6b
ollama rm qwen3:0.6b

Requests to locally running Ollama

@amoilanen
amoilanen / clone_user_repos.py
Created March 25, 2025 22:02
Python script to clone all the Github repos of a given user
import argparse
import requests
import subprocess
import os
def get_repos(username, api_key):
url = f"https://api.github.com/users/{username}/repos"
headers = {"Authorization": f"token {api_key}"}
repos = []
@amoilanen
amoilanen / rtl8812au.sh
Created January 27, 2025 20:53 — forked from watzon/rtl8812au.sh
Install rtl8812au driver arch
sudo pacman -S base-devel linux-headers
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
make
sudo cp 8812au.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo depmod -a
@amoilanen
amoilanen / launch.json
Created November 29, 2023 13:43
VSCode debug configuration for running the current test file with Jest
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug test",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
@amoilanen
amoilanen / npm_install_local_package.sh
Created November 7, 2023 19:57
Installs a local NPM package to a local project for testing purposes. Usage: npm_install_local_package package_dir project_dir
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` npm_package_dir project_dir"
echo "Installs a local NPM package to a local project for test purposes"
exit 0
fi
PACKAGE_DIR=$1
REPO_DIR=$2
PACKAGE_DIR=$1
@amoilanen
amoilanen / bash_utilities.sh
Last active May 15, 2025 10:26
.bashrc utilities
#!/bin/bash
free_port() {
kill -9 $(lsof -t -i:$1)
}
terminate() {
pids_to_kill=$(ps aux|grep $1|grep -v grep|grep -v terminate.sh |awk '{print $2}')
[[ ! -z $pids_to_kill ]] && kill -9 $pids_to_kill
@amoilanen
amoilanen / compress_video_utilities.sh
Created October 14, 2023 19:03
.bashrc fragment with utility commands to compress videos
#!/bin/bash
compress_videos() {
for f in "$@"; do compress_video $f; done;
}
compress_video() {
fullname=$1
extension="${fullname##*.}"
name_without_extension="${fullname%.*}"
@amoilanen
amoilanen / kind.useful.commands.md
Last active May 7, 2023 16:05
Useful commands for creating a local Kubernetes cluster and running local images with Kubernetes using Kind