Skip to content

Instantly share code, notes, and snippets.

@merovingian
merovingian / gist:67cbd782c8c64267084a
Created September 30, 2015 20:05
Clear Linux print queue Bash script, invoke the script with your printer on the commandline.
#! /bin/bash
# This script can be used to easily clear a print queue
# Specify your printer as the first argument
E_NO_ARGS=65
if [ $# -eq 0 ] # You must specify a printer as argument.
then
echo "Please invoke this script with one or more command-line arguments."
@merovingian
merovingian / gist:ca69a91ed1e54e8df1cb
Created September 30, 2015 19:47
Little Bash script to check the CPU load and kill Flashplayer if the load goes over a designated number. Useful for Linux VDI environments.
#! /bin/bash
# This little script kills the Flashplayer Plugin at
# a CPU load above N.*
# Fetch the average CPU load:
cpuload=$(cat /proc/loadavg | awk '{ print $1 }')
if [[ $cpuload = 5.* ]]
then $(pkill plugin-containe) # <- Yes without the r
fi