Skip to content

Instantly share code, notes, and snippets.

View theKAKAN's full-sized avatar

KAKAN theKAKAN

View GitHub Profile
@theKAKAN
theKAKAN / SELLERS.md
Created April 20, 2024 19:48
List of alternatives to amazon/flipkart and such
@theKAKAN
theKAKAN / getDirection.js
Created February 14, 2021 17:09
Convert degrees or angles to cardinal direction
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 / 0-download.sh
Last active December 24, 2023 17:25
Download music and save to m3u playlist using yt-dlp
#!/bin/bash
# 0-file means this is important for the script to run (script itself and sources list)
# 1-file means its important in a re-run (download log)
# 2-file would mean its for user's convenience (m3u playlist)
# 3-file would mean its for debugging/seeing if something went wrong
# Should work for all playlists
yt-dlp \
--verbose \
@theKAKAN
theKAKAN / user.js
Created December 12, 2023 12:36
Personal configuration setting for a more performant/pleasing Firefox, at the expense of more RAM usage.
// Default font
user_pref("font.internaluseonly.changed", true);
user_pref("font.minimum-size.x-western", 12);
user_pref("font.name.monospace.x-western", "JetBrains Mono");
user_pref("font.name.sans-serif.x-western", "Cantarell");
user_pref("font.name.serif.x-western", "Cantarell");
user_pref("font.size.monospace.x-western", 14);
user_pref("font.size.variable.x-western", 18);
// Reading mode
@theKAKAN
theKAKAN / tracker.md
Created February 23, 2021 09:14
Apps that track and/or sync watched episodes/chapters to online services such as Kitsu, MAL or AniList

Anime/Manga trackers with auto updates:


FOR WINDOWS

  • Updates only Anime.
@theKAKAN
theKAKAN / kitsuFetch.sh
Created February 22, 2021 15:51
Fetch your "Completed" section of anime or manga and their IDs as well as their ratings using bash and put them into a CSV
#!/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 / backup-packages-name.sh
Created December 6, 2018 14:13
Backs up all the installed packages using pacman. Can be used to reinstall them later...
#!/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 / backup.sh
Created January 20, 2021 13:27
Backup all my important files to where-ever I choose
# 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 November 19, 2020 19:06
Convert all [{container format}] in a directory to any other kind of file using bash and ffmpeg
# 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 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