Skip to content

Instantly share code, notes, and snippets.

Avatar

KAKAN theKAKAN

View GitHub Profile
@theKAKAN
theKAKAN / tracker.md
Created Feb 23, 2021
Apps that track and/or sync watched episodes/chapters to online services such as Kitsu, MAL or AniList
View tracker.md

Anime/Manga trackers with auto updates:


FOR WINDOWS

Taiga - Github link

  • Updates only Anime.
@theKAKAN
theKAKAN / kitsuFetch.sh
Created Feb 22, 2021
Fetch your "Completed" section of anime or manga and their IDs as well as their ratings using bash and put them into a CSV
View kitsuFetch.sh
#!/bin/bash
# Config
USERNAME="KAKAN"
mediaType="ANIME"
# Let's get it using HTTP
AFTER=$( http --pretty none -b -f https://kitsu.io/api/graphql query="query{findProfileBySlug(slug: \"$USERNAME\"){library{completed(first:100, mediaType:$mediaType){pageInfo{startCursor}}}}}" \
| jq .data.findProfileBySlug.library.completed.pageInfo.startCursor )
@theKAKAN
theKAKAN / getDirection.js
Created Feb 14, 2021
Convert degrees or angles to cardinal direction
View getDirection.js
function getDirection( angle ){
// We divide it into 16 sections
let directions = ["N","NNE","NE","ENE","E",
"ESE", "SE", "SSE","S",
"SSW","SW","WSW","W",
"WNW","NW","NNW" ];
// This means, every 360 / 16 degree, there's a section change
// So, in our case, every 22.5 degree, there's a section change
// In order to get the correct section, we just need to divide
let section = parseInt( angle/22.5 + 0.5 );
@theKAKAN
theKAKAN / backup.sh
Created Jan 20, 2021
Backup all my important files to where-ever I choose
View backup.sh
# Where should we store the backups?
BACKUP_DIR="/mnt/backup_drive/$(hostname)/$(date -u +\"%Y-%m-%d\")"
# Backup /etc
sudo rsync -avzP /etc $BACKUP_DIR
# Backup /var excluding many heavy files
sudo rsync -avzP --exclude 'cache' \
--exclude 'lib/flatpak' \
--exclude 'lib/dnf' --exclude 'lib/dpkg' \
--exlclude 'lib/libvirt' \
--exclude 'lock' --exclude 'run' \
@theKAKAN
theKAKAN / ffmpegConvert.sh
Created Nov 19, 2020
Convert all [{container format}] in a directory to any other kind of file using bash and ffmpeg
View ffmpegConvert.sh
# Modify the ffmpeg command to your liking if you want :)
for name in ./*; do ffmpeg -i "$name" -vn "./mp3/${name%.*}.mp3"; done
# Change ./* to ./*.mp4 to select only MP4 files and so on.
# Change .mp3 to any format you like and
# ffmpeg will automatically adjust to the container format
# because of -vn
@theKAKAN
theKAKAN / notify-mqtt.sh
Last active May 23, 2020
Checks for MQTT subbed-topic in Termux or linux and sends push notifications on receiving a message
View notify-mqtt.sh
#!/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
For use with github.com/theKAKAN/vcmp-java-demo
View javaplugin.properties
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 / backup-packages-name.sh
Created Dec 6, 2018
Backs up all the installed packages using pacman. Can be used to reinstall them later...
View backup-packages-name.sh
#!/bin/bash
# A script to back up all the program names.
# Can be used to install them again later on
TSTAMP=`date +%H:%M_%d-%m-%Y`
# Get all the programs available in the repos
# And paste them in a file
pacman -Qentq > ./native-packages_${TSTAMP}.txt
@theKAKAN
theKAKAN / waitForEl.js
Last active Sep 9, 2018
Wait for element
View waitForEl.js
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 / IPStack.md
Last active Jul 1, 2018
Using IPStack without a API key.
View IPStack.md