Skip to content

Instantly share code, notes, and snippets.

@startuml
start
floating note
Can you use OpenIconic<&question-mark> Yes! <&check>
endnote
' Action
:First Thing;
@nayrangnu
nayrangnu / power.sh
Created November 30, 2016 19:50 — forked from chrisyco/power.sh
Suspend, hibernate, restart or shutdown the computer without sudo!
#!/bin/sh
# Suspend, hibernate, restart or shutdown the computer without sudo!
# by Chris Wong
# Released to the public domain.
NAME=$0
usage() {
echo "Usage: $NAME suspend|hibernate|restart|shutdown"

Test

This Gist was

#!/bin/bash
# --- Version history ---
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
# Usage: cputrack [PID] [filename]