Skip to content

Instantly share code, notes, and snippets.

@kenci
kenci / check-mount.sh
Last active October 19, 2015 12:48
Check if storage is properly mounted
#!/bin/bash
nfsdir="/mnt/kenonas"
if [ ! -d $nfsdir ]; then
echo false
else
echo true
fi
@kenci
kenci / hyperion-control.sh
Last active October 17, 2015 21:26
Hyperion remote start/stop
#!/bin/sh
test -f /usr/bin/hyperiond || exit 0
case $1 in
start)
curl -s -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Enabled","image":"/home/osmc/scripts/hyperion.png"}}' http://127.0.0.1/jsonrpc > /dev/null
sudo /usr/sbin/service hyperion start
;;
stop)
curl -s -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Disabled","image":"/home/osmc/scripts/hyperion.png"}}' http://127.0.0.1/jsonrpc > /dev/null
@kenci
kenci / wordpress-chmod.sh
Created December 6, 2013 09:16
Fix wordpress permissions
##!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=owner # <-- wordpress owner
WP_GROUP=psacln # <-- wordpress group
WP_ROOT=./httpdocs # <-- wordpress root directory