Skip to content

Instantly share code, notes, and snippets.

View mibmo's full-sized avatar

mib mibmo

View GitHub Profile
@mibmo
mibmo / hanoi.rs
Last active October 25, 2023 13:53
Rust recursive towers of hanoi
fn main() {
let solution = hanoi(3, 'A', 'B', 'C');
for (i, hanoi_move) in solution.iter().enumerate().map(|(i, m)| (i + 1, m)) {
eprintln!("{i}: {hanoi_move:?}");
}
}
#[derive(Debug)]
struct Move {
from: Peg,
@mibmo
mibmo / README.md
Created May 28, 2022 19:22
Completely wipe user directory with one command from the run box.

Opens a background process that completely wipes all files in the user profile directory.

To run, copy the command below and paste into the Run box (opened through Windows + R).

powershell.exe Start-Process powershell.exe -NoNewWindow -argument '-nologo -noprofile -executionpolicy bypass -command Remove-Item $env:userprofile\* -Recurse -Force'

Contributions

I've very little experience with Windows; optimizations & fixes are very welcome!

@mibmo
mibmo / resolv.conf
Created December 28, 2021 00:24
DNS configuration for the privacy conscious and uptime paranoid.
# dns.watch
nameserver 84.200.69.80
nameserver 2001:1608:10:25::1c04:b12f
nameserver 84.200.70.40
nameserver 2001:1608:10:25::9249:d69b
# quad9
nameserver 9.9.9.9
nameserver 2620:fe::fe
nameserver 149.112.112.112
@mibmo
mibmo / Dockerfile
Last active April 11, 2022 09:24
Ideal Rust containerfile
ARG PKG_NAME=example
ARG RUST_VERSION=1.53.0
FROM docker.io/rust:${RUST_VERSION}-alpine AS build
ARG PKG_NAME
WORKDIR /build/
# fetch package dependencies
RUN apk add build-base cmake musl-dev openssl-dev