This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Display the top applications of memory usage | |
# http://www.cyberciti.biz/faq/linux-check-memory-usage/#comment-51021 | |
while read command percent rss; do | |
if [[ "${command}" != "COMMAND" ]]; then | |
rss="$(bc <<< "scale=2;${rss}/1024")" | |
fi | |
printf " %-26s%-8s%s\n" "${command}" "${percent}" "${rss} MB" \ | |
| sed 's/COMMAND/PROGRAM/' | sed 's/RSS MB/#MEM/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Backup files with sequential numbering and optional tag | |
# Display usage if given the incorrect number of parameters | |
if [ $# -ne 2 -a $# -ne 3 ]; then | |
echo "${0##*/} [file] [dir] [*tag]- Backup files with sequential numbering, opt. tag" | |
exit 1; fi | |
# Test if first and second parameters are a file and a directory | |
if [ ! -e "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create temporary file(s) and open in gedit | |
# Program required: gedit test | |
hash gedit 2>&- || { echo " Program required \"gedit\" not installed"; exit 1; } | |
# Display usage | |
if [[ $1 == -h ]]; then | |
echo "gt [name*] [name*]... - create temporary file(s) and open in gedit" | |
exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Link shortcut | |
# Display usage if incorrect number of parameters given | |
if [ $# != 2 ]; then | |
echo " ${0##*/} <source> <link> - ln shortcut" | |
exit 1; fi | |
# Source absolute path | |
if [ ! -e "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Switch between AMD's integrated video card and discrete video card | |
# Active GPU | |
gpu_active=$(aticonfig --px-list | cut -d " " -f 2) | |
# Restart X.org server | |
xorg_restart () { | |
gnome-session-quit --logout # GNOME, will still prompt if unsaved | |
# --no-prompt causing problems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Backup system configurations | |
# Source Directory (should be root (/) as include and exclude files use full paths) | |
src_dir="/" | |
# Destination Parent Directory | |
dsp_dir="/mnt/Backup" | |
dsp_dir="/run/media/todd/Backup/rsync" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create screencasts of area, full-screen, or window | |
# Required program(s) | |
req_progs=(ffcast ffmpeg) | |
for p in ${req_progs[@]}; do | |
hash "$p" 2>&- || \ | |
{ echo >&2 " Required program \"$p\" not installed."; exit 1; } | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Name=cVLC | |
GenericName=Media Player | |
GenericName[ca]=Reproductor multimèdia | |
GenericName[de]=Medienwiedergabe | |
GenericName[fr]=Lecteur multimédia | |
GenericName[it]=Lettore multimediale | |
GenericName[ja]=メディアプレーヤー | |
X-GNOME-FullName=Command Line VLC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Print disk usage | |
# Key word exclusions (seperated by space) | |
exclude=(sandfox) | |
df -h | grep -e '^Filesystem' -e '^/dev' | \ | |
grep -vf <(printf "%s\n" "${exclude[@]}") | \ | |
sed 's/^/ /g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Enable external monitor if connected and disable laptop monitor, else v.v. | |
case "$1" in | |
resume | thaw ) | |
export DISPLAY=:0 | |
su -c - todd /home/todd/.scripts/bugfixes/externalmonitor | |
;; | |
esac |