Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@bonelifer
bonelifer / backupPartition
Created February 19, 2016 05:04 — forked from giggio/backupPartition
Backup sd card partitions
#!/bin/bash
echo deleting local files older than a week...
find /media/data/backup/* -mtime +7 -type f -delete
echo backuping up /dev/mmcblk0p1...
if [ ! -f /media/data/backup/$(date +%Y%m%d)_mmcblk0p1.img ]; then
dd if=/dev/mmcblk0p1 of=/media/data/backup/$(date +%Y%m%d)_mmcblk0p1.img
fi
echo backuping up /dev/mmcblk0p2...
@bonelifer
bonelifer / 85-external-drive-rule.rules
Created May 6, 2016 18:05 — forked from eib/85-external-drive-rule.rules
How to automatically mount/unmount an external USB hard drive
# File: /etc/udev/rules.d/85-external-drive-rule.rules
# Rules for auto-mounting/unmounting USB drives
ACTION=="add", ENV{ID_MODEL}=="USB_to_ATA_ATAPI_bridge", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="2338", RUN+="/usr/local/bin/automount.sh"
ACTION=="remove", ENV{ID_MODEL}=="USB_to_ATA_ATAPI_bridge", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="2338", RUN+="/usr/local/bin/unmount.sh"
# Notes:
# To detect your own drive's ID_MODEL, ID_MODEL_ID, and ID_VENDOR_ID, run "udevadm monitor --environment --udev" before plugging/unplugging the drive
# To force udev to reload these rules (without reboot), run "udevadm control --reload-rules" and "udevadm trigger"
# To change udev's logging level (written to /var/log/syslog), you can run "udevadm control --log-priority=info" (or debug), or configure it via /etc/udev/udev.conf
@bonelifer
bonelifer / KodiBackup.sh
Created May 6, 2016 18:12 — forked from EldonMcGuinness/KodiBackup.sh
KODI Cloning Script
### This should be run from /sdcard/Android/data/org.xbmc.kodi/files
tar cvzf /usbdisk/kodi_backup.tar.gz --exclude=.kodi/userdata/Database/Textures13.db --exclude=.kodi/userdata/Thumbnails --exclude=.kodi/temp .kodi
@bonelifer
bonelifer / rpi.py
Created May 6, 2016 18:20 — forked from HappyCodingRobot/rpi.py
Simple XBMC/Kodi controller via http POST request and JSONRPC
#!/usr/bin/python
'''
Very simple XBMC/Kodi controller via http POST request and JSONRPC
(testing the principle..)
'''
import httplib
import sys, argparse
import json
PI = '192.168.162.33'
@bonelifer
bonelifer / reparse_bbcodes.php
Created June 7, 2016 04:09 — forked from 3D-I/reparse_bbcodes.php
Copied from STK for Olympus and customized to work on Ascraeus (phpBB 3.1). For me it works. Tell me if it works for you too. (Please be logged in as administrator if you call it)
<?php
/**
*
* @package Support Toolkit - Reparse BBCode
* @version $Id$
* @copyright (c) 2009 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@bonelifer
bonelifer / convert-avatars.php
Created April 2, 2019 22:13 — forked from tierra/convert-avatars.php
phpBB 3.1 script that fetches all remote avatars, and converts them to uploaded avatars hosted locally.
<?php
/**
* Converts all phpBB 3.1 remote avatars to uploaded avatars.
*
* To use this script:
*
* 1. Copy this file into the root of your phpBB installation.
* 2. Run the script from the command line: php convert-avatars.php
*
* Any avatar will be skipped if any errors come up, like these:
@bonelifer
bonelifer / doorbell.yaml
Created May 3, 2020 19:20 — forked from frenck/doorbell.yaml
Blog: For just $2, convert any existing wired doorbell into a smart doorbell; using ESPHome and Home Assistant: https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/
---
esphome:
name: doorbell
platform: ESP8266
board: esp01_1m
# WiFi connection, correct these
# with values for your WiFi.
wifi:
ssid: !secret wifi_ssid
@bonelifer
bonelifer / HASS.md
Created May 3, 2020 19:31
Home Assistant Linux Docker installation

Hassio FAQ

Frequently asked questions from the Discord channel

This first one isn't a question, but a strong recommendation:

INSTALL ONE OF THE SSH ADDONS

Do it! Do it now! Pick one from either the official repo or the community repo (recommended) and install it, set up a user/pass or key, and then forget about it if you want. But leave it running and set to run at startup.

I run in a VM and already have SSH access. Why would I need to do that?

@bonelifer
bonelifer / hassio_ubuntu_install_commands.sh
Created May 3, 2020 19:58 — forked from frenck/hassio_ubuntu_install_commands.sh
Simple install command for installing Hass.io on a Generic Ubuntu/Debian machine
sudo -i
add-apt-repository universe
apt-get update
apt-get install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat software-properties-common
curl -sSL https://get.docker.com | sh
systemctl disable ModemManager
apt-get purge modemmanager
curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s