Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / pool-info.c
Created October 18, 2015 12:58
TM1608 Display
/**
* gcc -std=c99 clk.c -o clk -lbcm2835 -ltm1638
*
* @file
* @brief Hello World for TM1638 based displays
* @author Martin Oldfield <[email protected]>
* @version 0.1
*
* @section DESCRIPTION
*
@kenci
kenci / gist:d7bdb93a69642caa5e9d
Created October 19, 2015 00:41
ESP8266 Generic
Flash frequency = 80 Mhz
Cpu frequency = 160 Mhz
Flash Size = 1M (256K SPIFFS)
DIO
Speed = 921.000
@kenci
kenci / disk-idle.sh
Last active October 20, 2015 03:47
Disk status check
#!/bin/bash
result=$(sudo /sbin/hdparm -C /dev/sda1)
if [[ $result == *"active"* ]]
then
echo true;
else
echo false;
fi
@kenci
kenci / lib.m path
Created October 22, 2015 06:36
Arduino ieee754_sqrt
C:\Users\kenci\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9\xtensa-lx106-elf\lib
@kenci
kenci / install-duplicity.txt
Last active October 25, 2015 10:20
Duplicity installation
sudo apt-get install ncftp
sudo apt-get install duplicity
sudo apt-get install python-paramiko python-gobject-2
@kenci
kenci / installation.txt
Created October 30, 2015 12:37
Hifiberry OSMC
Programs -> OSMC Settings -> PI Config -> Hardware Support -> Soundcard overlay = "hifiberry-digi-overlay"
Remove LIRC from config
Reboot
Settings -> System -> Audio Output -> Audio Output Device -> "Alsa: Default(snd_hifiberry_digi...)
@kenci
kenci / tx433_watchdog_10min.ino
Last active November 20, 2015 23:49
TinyTX433_WATCHDOG_10MIN
// RFM12B Sender for DHT22 Sensor with Watchdog (saves much more Power!)
//
// Basiert zum Teil auf der Arbeit von Nathan Chantrell
//
// modified by meigrafd @ 12.01.2015
//------------------------------------------------------------------------------
#include <RFM12B.h>
#include <avr/sleep.h>
#include <DHT22.h> // https://github.com/nathanchantrell/Arduino-DHT22