Skip to content

Instantly share code, notes, and snippets.

@izzyleung
izzyleung / Dockerfile
Last active August 23, 2024 07:08
Docker in Docker-ized Jenkins agent
FROM jenkins/ssh-agent:debian-jdk17
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y sudo curl && \
curl -fsSL https://get.docker.com > docker.sh && \
bash docker.sh && \
systemctl disable docker && \
rm -f docker.sh && \
echo '#!/usr/bin/env bash' >> /usr/local/bin/new_entry_point.sh && \
@izzyleung
izzyleung / setup.sh
Created May 23, 2024 19:19
Manage Homebridge as a SystemD service via Podman
#!/usr/bin/env bash
SYSTEMD_SERVICE_NAME="homebridge"
SYSTEMD_USER_DIR="$HOME/.config/systemd/user"
SYSTEMD_SERVICE_FILE="${SYSTEMD_USER_DIR}/${SYSTEMD_SERVICE_NAME}.service"
HOMEBRIDGE_VOLUME_DIR="$HOME/.containers/volumes/homebridge"
podman pull docker.io/homebridge/homebridge
@izzyleung
izzyleung / README.md
Last active May 23, 2024 19:20
Simplified QMK firmware building guide

Prerequisite

  • Podman or Docker
  • Git

Clone the repository with all the submodules

$ git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git

Create your keymap

@izzyleung
izzyleung / README.md
Last active April 15, 2024 17:51
Strands from New York Times Assistant

Assistant for New York Times Puzzle - Strands

This is a super primitive assistant to help you solve Strands from New York Times

Explanation

  • Read words from /usr/share/dict/words
  • Build Trie
  • BFS on each coordinate, only search when neighbor is not seen, and its letter can make up a word
How to cheat
@izzyleung
izzyleung / README.md
Last active July 17, 2023 21:50
NYT Digits Solver

About

This is a program that tries to solve the New York Times Digits game

Usage:

usage: digits_solver [-h] number number number number number number number

NYTimes Digits Solver

positional arguments:
@izzyleung
izzyleung / README.md
Last active August 14, 2024 20:05
Update your WireGuard public key in Mullvad via its public API

Generate a new pair of keys via wg

$ wg genkey | tee privatekey | wg pubkey > publickey

Rotate your public key via the same logic as in Mullvad's source code:

  • Step 1: Obtaining an access token:
$ curl -fsSL -X POST \
    -H 'Content-Type: application/json' \
@izzyleung
izzyleung / README.md
Last active September 25, 2024 16:49
Run TeamCity agents in your Kubernetes cluster

How to run TeamCity agents in your Kubernetes cluster

For typical CI/CD tasks that don't require Docker daemon access, use the agent.yml pod sepc.

For CI/CD jobs that need Docker daemon to build Docker images, use the privileged-agent.yml pod spec.

Notes

Make sure you are running TeamCity server version >= 2020.1 or have the Kubernetes support plugin installed.

@izzyleung
izzyleung / AndroidManifest.xml
Created May 23, 2018 19:54
Example of how to use AutoValue in a Bazel Android Project
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="1"
android:targetSdkVersion="27" />
<application