Month: September 2014
-
Kobo on Linux, skip installation
Activate: Find the hidden .kobo dir after attaching the kobo to your pc/laptop Install sqlite3 sqlite3 KoboReader.sqlite INSERT INTO “user” VALUES(‘aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa’,’aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa’,’xxxx@xxxx.xx’,’xxxx@xxxx.xx’,’2aaaa aaaaaaaaaaaaa==’,NULL,NULL); sqlite> .exit Add dictionaries: http://www.mobileread.com/forums/showthread.php?t=196931
-
Nagios, nrpe and selinux policies (audit)
Selinux seems to “dontaudit” logs by default. This means that when selinux is permissive, your plugins will work, and when you setenforce 1 your server, plugins fail. This all happens without warnings. If you see this happening: Disable dontaudit: semodule -DB See avc entries filling up audit.log, pipe through audit2allow. Enable again: semodule -B
-
Bash percentage calculate snippet
MEMLINE=$( tac $MGRBASE/$REL_LOGLOC/server.status.log | egrep -m1 ‘\*\*.*Memory Status:’ ) USED=$( echo “$MEMLINE” | egrep -o ‘[0-9\.,]+ MB Used’ | sed ‘s/\..*//;s/,//’ ) MAX=$( echo “$MEMLINE” | egrep -o ‘[0-9\.,]+ MB Max’ | sed ‘s/\..*//;s/,//’ ) PERC=$( printf “%.0f” $(echo “scale=2;($USED/$MAX)*100″ | bc) ) if [[ $PERC -gt $MEM_CRIT_PERC ]]; then ERRORS=”$ERRORS memory ${PERC}%” elif [[…
-
Bash file age check snippet
if [[ -f $BACKUP_LOCKFILE ]]; then #Check age if [[ $(( $( date +%s ) – $(stat -c %Y $BACKUP_LOCKFILE ) )) -gt $BACKUP_MAXLENGTH_SECS ]]; then echo “Backup takes too long” else echo “Doing backup” fi fi
-
Changing default browser in Fedora
Open gnome-control-center, go to system, details, default applications