Skip to content

Instantly share code, notes, and snippets.

View najtin's full-sized avatar

Jan Philipp Bittner najtin

View GitHub Profile
@najtin
najtin / fixWifiOnICE.md
Last active April 3, 2023 13:55
Fix WifiOnICE with Linux/ubuntu/docker

If WifiOnICE does not work on your Linux/Development Laptop, then it might be due to overlapping ip ranges. On my devices, the default docker network is 172.18.0.0/16 which is the same as the WifiOnICE network. You might experience that you can ping 172.18.0.1 but your browser does not auto detect the portal.

Now that we know why it does not work, the fix is straigt forward.

sudo systemctl stop docker

Edit or create /etc/docker/daemon.json Choose whatever range you like/is compatible with your setup.

@najtin
najtin / wasm_random_string.rs
Created December 28, 2021 17:24
generate a random string in rust wasm
use rand_chacha::{self, rand_core::SeedableRng, rand_core::RngCore};
use web_sys;
let mut seed = [0u8; 8];
web_sys::window().unwrap().crypto().unwrap().get_random_values_with_u8_array(&mut seed).unwrap();
let mut s = 0u64;
for i in seed {
s |= i as u64;
s = s<<8;
@najtin
najtin / README.MD
Last active February 22, 2021 02:34
proxy quoted numbers in json into numbers

Did you ever found yourself in a situation were you wanted to monitor something and pulled your hair out, because the measurements provided by the app are quoted numbers in json?

No more!

echo '"http://myupstream.app:80/monitor.json"' > upstream.json

python3 proxy-quoted-number.py

LICENSE