Skip to content

Instantly share code, notes, and snippets.

top's Config File (Linux processes with windows)
Id:j, Mode_altscr=0, Mode_irixps=1, Delay_time=3.0, Curwin=0
Def fieldscur=ķ�')*+,-./012568<>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
winflags=162580, sortindx=18, maxtasks=0, graph_cpus=1, graph_mems=2, double_up=1, combine_cpus=0
summclr=1, msgsclr=1, headclr=3, taskclr=6
Job fieldscur=(Ļ@<�*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
winflags=195892, sortindx=0, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=<MBN�34�'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
winflags=195892, sortindx=21, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0
@ccraig
ccraig / menu.sh
Created June 17, 2014 17:14
Example of a basic menu driven program in bash
#!/bin/bash
function p
{
echo $@
}
function displayMenu
{
p ""
@ccraig
ccraig / ds_store_destroyer.sh
Last active August 29, 2015 14:02
Recursively removes all .DS_Store files from a given directory. Usage: ds_destroyer [-n] directory. Shamelessly stole the -n flag from rsync
#!/bin/bash
dry_run=$1
dir=$2
if [ $# == 1 ]; then
dir=$1
if [ ! -d $dry_run ]; then
echo "Directory '$dir' does not exist"
echo "Usage: ds_destroyer [-n] <directory>"
@ccraig
ccraig / ccc.sh
Last active April 30, 2024 07:57
My current rsync script for cloning my HD ( OS X 10.8 ). The rsync flags are what Carbon Copy Cloner uses.
#!/bin/bash
target_drive=/Volumes/Clone
if [ -d $target_drive ]; then
echo "Last backup: " `cat ~/.last_backup`
sudo echo "And we're off!"
echo "Started: " `date`
echo `date` > ~/.last_backup
sudo time nice -n19 rsync -A -X -H -go --numeric-ids -D --protect-decmpfs -l -rtpx -N --fileflags --force-change --protect-args --delete-before --ignore-errors --filter='._/Users/i/.rsync-filter' // ${target_drive}; bless -folder ${target_drive}/System/Library/CoreServices
else
echo "${target_drive} is not mounted"
@ccraig
ccraig / f
Created January 15, 2013 17:09
A very basic find script. Takes one parameter and does a non-case sensitive, wildcard based search on the parameter, in the current directory. On my system the file is simply named "f" and is located in my ~/bin directory. You may want to put this in your /usr/local/bin directory if you dont' have a ~/bin. Should work just fine on any Unix or Li…
#!/bin/bash
find . -iname "*${1}*"