Skip to content

Instantly share code, notes, and snippets.

View fibergames's full-sized avatar
🏠
Working from home

Frostinit fibergames

🏠
Working from home
View GitHub Profile
@fibergames
fibergames / diskchecker.sh
Last active August 9, 2017 16:51
Solaris 5.10 Diskspace checker updated from nixcraft.
#Original script here: https://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html
#Updated for Solaris 10 by Loranth Moroz
#!/usr/bin/bash
df -h | egrep -v '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output |grep -v 'capacity'| awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 80 ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)"|
@fibergames
fibergames / dnsupdater.sh
Last active January 10, 2022 13:21
DigitalOcean dynamic DNS updater script for your subdomain
#!/bin/bash
# Created by fibergames.net // Loranth Moroz // v.0.5
# Required tools to run this script as is: curl (https://curl.haxx.se/) & jq (https://stedolan.github.io/jq/)
# This only works for Digitalocean - 10$ credit referral link: https://m.do.co/c/fed75101475f
# Edit token, domain, subdomain to fit your needs
# Substitute ipinfo.io with your own ip-checker e.g. ipecho.net/plain
# This is to be used with crontab -> example entry to run it every 3hours:
# 0 */3 * * * sh /path/to/script/dnsupdater.sh
# Don't forget to make it executable: chmod +x /path/to/script/dnsupdater.sh