Skip to content

Instantly share code, notes, and snippets.

@hagaram
hagaram / diskio_check.sh
Created April 24, 2020 11:33
Check disk io statistic without additional software (awk only)
#!/usr/bin/bash
#The machine I needed to debug was so messed up, that it was impossible to install anything like iostat,sar etc.
#So I had to work with what was available.
awk '{print "DEVICE: " $3"\n" $1" - major number\n" \
$2" - minor number\n" \
$4" - read comleted succesfully\n" \
$5" - reads merged\n" \
@hagaram
hagaram / mikrotik_DNS_checker.md
Last active August 7, 2022 07:43
Mikrotik DNS checker(changer) in case local DNS goes down

I use pihole on some OLD repurposed chinese media box with armbian and I wanted my Mikrotik to automatically change DNS to ISP DNS in case that the pi-hole goes down and send me notification. Script is copied directly from config export.

  1. I run it every minute via scheduler
  2. I've lowered DHCP lease time to 5 minutes...but yes, there can be short downtime for clients...
/system script
@hagaram
hagaram / Magnet link browser handler for remote torrent client - MacOS.md
Last active April 24, 2020 11:25
Add magnet link to remote qbittorent client on 1 click from browser (MacOS)