Skip to content

Instantly share code, notes, and snippets.

@aaronNGi
aaronNGi / wordle.bash
Last active April 1, 2025 00:30
Wordle in 20 lines of bash
#!/usr/bin/env bash
mapfile -t words < <(grep -x '[a-z]\{5\}' "${WORDLIST:-/usr/share/dict/words}")
word=${words[RANDOM % ${#words[@]}]} pool=abcdefghijklmnopqrstuvwxyz
for ((round=1; round <= ${ROUNDS:=6}; round++)); do
while read -rp "$round/$ROUNDS: " guess || exit 1; do
[[ " ${words[@]} " == *" ${guess,,} "* ]] && guess=${guess,,} && break
done
for ((i=0, chars=0; i < ${#word}; i++)); do
[[ ${word:i:1} != ${guess:i:1} ]] && chars+=${word:i:1}
done
@fl64
fl64 / main.go
Created February 5, 2022 12:50
kubebuilder mutating webhook
/*
Copyright 2022 fl64 <[email protected]>.
*/
package main
import (
"flag"
"github.com/fl64/gitlab-job-mutator/mutator"
"os"
@sts10
sts10 / rust-command-line-utilities.markdown
Last active January 3, 2026 19:27
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@0xack13
0xack13 / cond.go
Created December 23, 2021 03:07 — forked from fracasula/cond.go
GoLang: How to use sync.Cond
package main
import (
"sync"
"fmt"
"time"
)
func main() {
lock := sync.Mutex{}
package main
import (
"io/ioutil"
"log"
"strings"
)
func main() {
input, err := ioutil.ReadFile("myfile")
@teocci
teocci / go-exec-pid-sample.go
Created November 22, 2021 10:46
golang exec run get pid
package main
import (
"bytes"
"context"
"fmt"
"log"
"os"
"os/exec"
"sync"
@sbailliez
sbailliez / vagrant-vmware-tech-preview-apple-m1-pro.md
Last active May 23, 2025 19:01
Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

UPDATE November 20, 2022: VMWare Fusion 13

VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.

Summary

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated

@cesarcneto
cesarcneto / flink-quickstart-scala.sh
Created September 1, 2021 19:46
Create an apache-flink scala project using the provided quickstart archetype
@visualphoenix
visualphoenix / docker-machine-setup.sh
Created September 1, 2021 15:04
docker-machine setup for mac with nfs and vmware
#!/bin/bash
#
# the following functions can be used to provision, or reprovision docker-machine as a replacement for docker-for-mac
# it has only been tested with vmware on osx catalina
#
# it assumes the following has already been run:
# brew install docker-machine docker
#
get-interface-ip-from-ip-route() {
@orhun
orhun / arch_linux_installation.md
Last active December 11, 2025 09:48
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)