Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@bonelifer
bonelifer / kodi-backup.sh
Created October 2, 2025 20:25 — forked from ShockwaveNN/kodi-backup.sh
script for making backup of kodi settings
#!/bin/bash
DATE=$(date '+%Y-%m-%d-%H-%M-%S')
BACKUP_NAME=kodi-backup-$DATE.tar.gz
TEMP_BACKUP_LOCATION=/tmp/backups/kodi
BACKUP_DIR=/home/pi/.kodi
ARCHIVE_DIR=/media/routher_share/Backup/kodi
mkdir -pv $TEMP_BACKUP_LOCATION
chmod 777 $TEMP_BACKUP_LOCATION
@bonelifer
bonelifer / vignettage_kodi.sh
Created October 2, 2025 20:25 — forked from dzogrim/vignettage_kodi.sh
Kodi video "poster" automatic generator for series episode and so on
#!/usr/bin/env bash
# _ __ _ _
# | |/ /___ __| (_)
# | ' </ _ \/ _` | |
# |_|\_\___/\__,_|_|
#
#########################################
# Kodi video "poster" automatic generator
@bonelifer
bonelifer / blauton.sh
Created October 2, 2025 20:24 — forked from crpb/blauton.sh
First draft for adding registered bluetooth speakers or headsets to ~/.asoundrc for #osmc #kodi
#!/usr/bin/env bash
IFS=$'\n' BLAU_OUTPUT=( $(echo "exit" |bluetoothctl |grep Device |cat -A |cut -c59-) )
lines=${#BLAU_OUTPUT[@]}
for i in ${BLAU_OUTPUT[@]}; do addr+=(${i:0:17}); name+=(${i:18}); done
SKEL='pcm.PCMNAME {\n
type plug\n
slave.pcm {\n
@bonelifer
bonelifer / kodi.sh
Created October 2, 2025 20:23 — forked from jangeador/kodi.sh
Kodi remote commands update library and export library
#!/usr/bin/env bash
# Update library
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
# Clean library
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
# Export library to separate files:
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Export", "params": { "options": { "overwrite": false, "actorthumbs": false, "images": true } }, "id": 1 }' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
@bonelifer
bonelifer / mediasources.sh
Created October 2, 2025 20:17 — forked from cleanhands/mediasources.sh
Generate mediasources.xml for Kodi using https://github.com/AquilaIrreale/urlencode
#!/bin/bash
IFS= read -rp 'Server name: ' server_name < /dev/tty
IFS= read -rp 'Username: ' username < /dev/tty
IFS= read -rsp 'Password: ' password < /dev/tty
echo 1>&2
password_encoded=$(urlencode -bc $' "#$%&\'*+,/:;<=>?@[\\]^`{|}~' <<< "$password")
tee "$HOME/.kodi/userdata/mediasources.xml" <<EOF
<mediasources>
@bonelifer
bonelifer / kodi-install-ubuntu-ppa.sh
Created October 2, 2025 20:15 — forked from bluesku/kodi-install-ubuntu-ppa.sh
kodi-install-ubuntu repo
#! /bin/sh
add-apt-repository ppa:team-xbmc/ppa
apt update ; apt install kodi -y
#keep reading https://launchpad.net/~team-xbmc/+archive/ubuntu/ppa
@bonelifer
bonelifer / kodi-setup.sh
Created October 2, 2025 20:08 — forked from quantenschaum/kodi-setup.sh
install script for kodi standalone mediacenter
#!/bin/bash
# prepare a Ubuntu server minimal installation with working network using network manager
# this works on raspbian, too
apt-get install software-properties-common -y
# install KODI
add-apt-repository ppa:team-xbmc/ppa -y
apt-get update && apt-get install -y kodi xserver-xorg xinit dbus-x11 alsa-utils avahi-daemon
@bonelifer
bonelifer / create_mysql_backup_user.sql
Created October 2, 2025 19:53 — forked from oliworx/create_mysql_backup_user.sql
Create MySQL user to backup databases
CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY '***';
GRANT SELECT ,
RELOAD ,
FILE ,
SUPER ,
LOCK TABLES ,
SHOW VIEW ON * . * TO 'dbbackup'@'localhost' IDENTIFIED BY '***'
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
@bonelifer
bonelifer / new-mysql-db-and-user.sql
Created October 2, 2025 19:47 — forked from oliworx/new-mysql-db-and-user.sql
Create a New DB and User in MySQL
CREATE DATABAESE MYNEWDB;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON MYNEWDB.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
@bonelifer
bonelifer / Linux-cheat-sheet.md
Created October 2, 2025 19:46 — forked from oliworx/Linux-cheat-sheet.md
Linux-cheat-sheet

My Linux Cheat Sheets

Create a Backup of the home partition

sudo xfsdump -l 0 -L "Backup level 0 of /home `date`" -M Full  - /home | lzop > /media/oli/Seagate_4TB/Backup/vostro/xfsdump/home-xfsdump-`date +%Y-%m-%d`.lzo

ISO date in bash

DATE=`date +%Y-%m-%d`

check open ports

netstat -tulpn