Skip to content

Instantly share code, notes, and snippets.

@5p0ng3b0b
5p0ng3b0b / mwan-config.sh
Created November 25, 2021 10:29 — forked from braian87b/mwan-config.sh
/etc/config/mwan
# My documentation:
#
# Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3
#
# We have Interfaces, Members, Policyes y Rules:
#
# Interfaces: Allows to identify the wan interface, we just need to have it enabled`
# the others parameters are only to track if the interface it is up or down.
#
# Members: Can be defined in some metric and weight, both values will be important ambos when used in policyes.
@5p0ng3b0b
5p0ng3b0b / init-opt.sh
Last active July 21, 2020 16:59
ix4-300d boot script
#!/bin/sh
# IX4-300D startup and optware-ng init script
# Set path for additional files use USB or HDD
# If USB then specify UUID of USB drive
files=HDD
UUID="1827a6c8-c9a7-442c-adda-34806977c107"
# Wait until storage pool is mounted
while [ ! "$(ls -a /mnt/pools/A/A0/ 2>/dev/null)" ]; do sleep 2; done
@5p0ng3b0b
5p0ng3b0b / autoexec.py
Last active February 26, 2019 15:53
Kodi startup script to enable all addons.
import xbmc, xbmcvfs, xbmcaddon, xbmcgui,re, os, glob, thread
from datetime import datetime
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
def main():
class enableAll():
def __init__(self):
self.databasepath = xbmc.translatePath('special://database/')
self.addons = xbmc.translatePath('special://home/addons/')
@5p0ng3b0b
5p0ng3b0b / apkdrop.sh
Last active January 15, 2019 11:00
Script for processing APK files from cron
#!/bin/sh
# 11/01/2019
# Drop Folder script for renaming APKs
# Read apk file from SRC folder and move it to TGT folder while changing filename to APKLABEL_APKVERSION.apk
# If an existing version of the APK exists in the target folder then script will remove it
# Define METHOD as "aapt" or "apktool" depending upon what is available on server
# Script is much slower using apktool method
# Variables
METHOD="aapt"
@5p0ng3b0b
5p0ng3b0b / sslsetup.sh
Created January 6, 2019 00:49
Script for generating and registering ssl certs
#!/bin/sh
# sslsetup.sh
# This script is designed to be run on a shared hosting service to automatically genrate and register SSL certs
# Upload to your server and then run via ssh then set a cron job to renew every 90 days
# Prerequisites: openssh, openssl, perl, gcc,
# Usage: sslsetup <domainname> or: sslsetup
# Initial setup (if not setup already)
if [ ! -d ~/bin ]; then mkdir ~/bin; fi
if [ ! -d ~/.cpan ]; then echo 'Configuring cpan'; echo y | cpan > /dev/null 2>&1; fi