8 (Undefined offset: 8) in /home/mark/public_html/code/lazydoc.php:184
software/things/index

Things


Minor stuff i think of as useful for people who happen to be the not me kind of person.

sitnol.sh


Send SIGHALT or SIGCONT to all user-processes, except SSH and everything that runs on a TTY. Good to run on LID events, stops f***ing flash shit from producing entropy.
#!/bin/sh

uids="$(cat /etc/passwd | egrep ":x:[0-9]{4,}" | cut -d ":" -f 3 | tr "\n" " ")"
#pids="$(ps U "${uids:0:-1}" -o pid | tr "\n" " ")"
pids="$(ps U "${uids:0:-1}" | egrep -v "(ssh)|(PID TTY)" | cut -d " " -f 1 | tr "\n" " ")"

if [ "$1" == "close" ]; then
    for p in a $pids; do
        if [[ "$p" =~ ^[0-9]+$ ]]; then
            logger "Stopping $p"
            kill -STOP $p
        fi
    done
else
    for p in a $pids; do
        if [[ "$p" =~ ^[0-9]+$ ]]; then
            logger "Starting $p"
            kill -CONT $p
        fi
    done
fi

If it doesn't work change the cut parameter "-f 1" to "-f 2".

dmount


Simple script to mount/unmount things using dmenu.
https://gist.github.com/0mark/6282407

rdbks


Simple backup script using rsync. Set a list of directories to back up within the script. Each directory can have a file ".exclude" with a list of thing to exclude from backup (rsync notation).
https://gist.github.com/0mark/6282320
** Things Minor stuff i think of as useful for people who happen to be the not me kind of person. *** sitnol.sh Send SIGHALT or SIGCONT to all user-processes, except SSH and everything that runs on a TTY. Good to run on LID events, stops f***ing flash shit from producing entropy. [code] #!/bin/sh uids="$(cat /etc/passwd | egrep ":x:[0-9]{4,}" | cut -d ":" -f 3 | tr "\n" " ")" #pids="$(ps U "${uids:0:-1}" -o pid | tr "\n" " ")" pids="$(ps U "${uids:0:-1}" | egrep -v "(ssh)|(PID TTY)" | cut -d " " -f 1 | tr "\n" " ")" if [ "$1" == "close" ]; then for p in a $pids; do if [[ "$p" =~ ^[0-9]+$ ]]; then logger "Stopping $p" kill -STOP $p fi done else for p in a $pids; do if [[ "$p" =~ ^[0-9]+$ ]]; then logger "Starting $p" kill -CONT $p fi done fi [/code] If it doesn't work change the cut parameter "-f 1" to "-f 2". *** dmount Simple script to mount/unmount things using dmenu. https://gist.github.com/0mark/6282407 *** rdbks Simple backup script using rsync. Set a list of directories to back up within the script. Each directory can have a file ".exclude" with a list of thing to exclude from backup (rsync notation). https://gist.github.com/0mark/6282320
total: 248.7ms (include: 0.85, request: 0.44, trace: 0.13, init: 1.23, load: 245.93, parse: 0.34, menu: 0.98, template: 0.03, minify: )