Tag: bash
-
Bash Script: Calculate before/after averages
in Dev StuffOptimize your performance testing with a little bash script that computes average percent changes quickly.
-
Sending Prowl Alerts via Bash
in Dev StuffLearn how to send alerts using Prowl for server scripting, ensuring proper alert notifications, even after struggling with other options like Twilio.
-
Supercharge Your Clipboard with a Shell Function for iTerm2
in Dev StuffDiscover a nifty shell function tailored for iTerm2 on macOS, bridging the gap between your terminal and clipboard, making it seamless to copy content directly to your clipboard, even from remote servers.
-
More Garbage Sysadmin: Reboot Linux Server on Kernel Panic
in Dev StuffFacing kernel panics on your Raspberry Pi? Dive into a less-than-ideal but efficient fix involving an automatic reboot using a startup script, ensuring your server recovers swiftly on kernel panics.
-
Bad Hack: Restart Linux Server when memory is low 😬
A hack on a Raspberry Pi server uses a script to monitor and restart the server if memory is too low. Checking swap and physical memory, it reboots if levels drop below specific thresholds. Scheduled to run every five minutes, the script logs instances when it prevents system freezes by rebooting.
-
Pi-hole, Google Wifi, and Device Names
Using a custom script with `nmap` to find device hostnames on a Google Wifi network. The script outputs to `/etc/pihole/custom.list` with manual MAC to hostname mappings. It can be slow, especially on a Raspberry Pi 1.
-
Quick Tip: Looping a command in bash
in Dev StuffDiscover how to monitor disk space usage efficiently while running slow programs to prevent sudden command failures. Use `watch -n10 bash -c “df -h | ack disk1s5″` for real-time updates, where `disk1s5` represents the desired partition. Run `df` to find the correct device file.
-
Disabling Laptop Screen with Ubuntu Server
As a part of my home network setup, I use an old laptop as my “server.” One issue I had was disabling the screen when closed.