Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Copied script from https://wiki.eddyn.net/CloudAtCost_Custom_OS
# Usage:
# curl -sL https://git.io/JqSg7 2>&1 | bash
cdr2mask ()
{
# Number of args to shift, 255..255, first non-255 byte, zeroes
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
[[ $1 -gt 1 ]] && shift ${1} || shift
@chidoli
chidoli / sysi
Created September 17, 2015 08:28
sysi - sh script that grabs system stats
#!/bin/sh
# Author: Chihyun Lim
# Email: [email protected]
# Description: sh script that grabs system stats
# Output Order:
# users, cpus, load 1m, load 5m, load 15m,
# total tasks, running tasks, sleeping tasks, stopped tasks, zombie tasks,
# un-niced user cpu usage, kernel cpu usage, niced user cpu usage,
# I/O wait cpu usage, HW interrupt cpu usage, SW interrupt cpu usage,
# stolen cpu usage, total memory, used memory, free memory, buffers,