Skip to content

Instantly share code, notes, and snippets.

View theKAKAN's full-sized avatar

KAKAN theKAKAN

View GitHub Profile
@theKAKAN
theKAKAN / notify-mqtt.sh
Last active May 23, 2020 17:15
Checks for MQTT subbed-topic in Termux or linux and sends push notifications on receiving a message
#!/usr/bin/env bash
IP="10.0.0.1" #Change to IP of server
TOPIC="torrent/finished" # Change to your liking
VERSION="mqttv5"
if [ -n "$(command -v mosquitto_sub)" ]; then
echo "Found mosquitto"
if [ "$( uname )" == "Linux" ]; then
if [ -n "$( command -v termux-notification )" ]; then
echo "Running in termux"
mosquitto_sub -h "$IP" -V "$VERSION" -t "$TOPIC" | while read OUTPUT; do termux-notification -c "$OUTPUT"; done
@theKAKAN
theKAKAN / javaplugin.properties
Created May 15, 2020 17:46
For use with github.com/theKAKAN/vcmp-java-demo
jvmLibPath=/usr/lib/jvm/jre-1.8.0/lib/amd64/server/libjvm.so
mainEventsClass=ModeEventHandler
classPath=./java-vcmp-1.0-STAGING-all.jar
maxMemory=100m
@theKAKAN
theKAKAN / waitForEl.js
Last active September 9, 2018 17:27
Wait for element
var waitForEl = function (selector, callback) {
jQuery.when(jQuery(selector)).then(callback);
}
// Example for adding an item to cart
// in Amazon
var element = '#add-to-cart-button';
waitForEl(element, function (self) {
self.trigger('click');
@theKAKAN
theKAKAN / backup-github.sh
Created June 20, 2018 07:34 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)