Skip to content

Instantly share code, notes, and snippets.

View Derkades's full-sized avatar

Robin Derkades

  • 21:55 (UTC +02:00)
View GitHub Profile
@Derkades
Derkades / bitmagnet-magnetico-import.md
Created February 16, 2024 13:52
Import torrents from magnetico into bitmagnet DHT crawler

See bitmagnet's import endpoint documentation for more information.

sqlite3 -json -batch database.sqlite3 "$(cat magnetico-import.sql)" | 
  jq -r --indent 0 '.[]' | 
  curl --verbose -H "Content-Type: application/json" -H "Connection: close" --data-binary @- http://localhost:3333/import
@Derkades
Derkades / ns-login.py
Created November 8, 2023 09:15
NetworkManager script to automatically log into NS "WiFi in de trein" network. Place in `/etc/NetworkManager/dispatcher.d`.
#!/usr/bin/env python3
import syslog
import os
import sys
import requests
import time
from bs4 import BeautifulSoup
def attempt_login():
@Derkades
Derkades / ComponentSidebar.java
Created October 5, 2021 18:52
Basic sidebar utility using adventure components
package xyz.derkades.derkutils.bukkit.sidebar2;
import net.kyori.adventure.text.Component;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
@Derkades
Derkades / lang.py
Created October 1, 2021 19:24
Script to duplicate minecraft language files for all languages in a resource pack
import json
import shutil
DOTMINECRAFT = '/home/robin/.minecraft'
VERSION = '1.17'
INPUT_FILE = 'lang.json'
OUTPUT_DIR = 'out/'
language_codes = []
@Derkades
Derkades / storj-compose.yaml
Last active February 14, 2021 02:36
Storj docker compose
version: '2.4'
services:
storagenode:
container_name: 'storagenode'
image: 'storjlabs/storagenode:beta'
ports: ['28967:28967', '14002:14002']
volumes:
- type: 'bind'
source: '/storj/identity'
@Derkades
Derkades / sonoff-diy-tool-linux.md
Last active November 12, 2019 19:54
Run Sonoff DIY tools GUI from source on Linux / OS X

tested in ubuntu 19.10 but should work on any other linux or bsd distribution as well with some minor modifications

  1. Install python 3.7, pip3, git
  2. Open a terminal in a directory
  3. git clone https://github.com/MarkoVcode/Sonoff_Devices_DIY_Tools
  4. cd Sonoff_Devices_DIY_Tools/code
  5. sudo pip3 install -r requirements.txt
  6. chmod +x *
  7. sudo python3 01DIY85.py
@Derkades
Derkades / readme.md
Last active April 13, 2023 11:51
Downloading from webcolleges.uva.nl

You way want to download lectures from webcolleges.uva.nl, for example to watch while travelling.

Exporting cookies

Make sure you're logged in, then use a browser extension to export your cookies to a cookies.txt file in netscape cookie format.

Use one of these extensions to save cookies to a cookies.txt file in a directory, for example your home directory.

Download the video

@Derkades
Derkades / minecraft_bluetooth.md
Last active July 1, 2022 10:21
Minecraft multiplayer over bluetooth

This guide describes how to play Minecraft (Java edition) multiplayer over bluetooth on Windows 10 laptops/desktops. This is useful if you want to play together with friends, without an internet connection or even wifi network.

Prerequisites

  • You need to have downloaded the files to set up a server. For some server softwares (e.g. paper), the first server startup requires an internet connection
  • Everyone needs to have started up the game (on the correct version) at least once,l so the launcher has downloaded the required files.

Setting up a server

You need to set up a Minecraft server. I used a Paper server, but a vanilla Minecraft server works too. After running it for the first time, edit server.properties and set online-mode to false. Restart your server.

Connecting everyone to Bluetooth PAN

@Derkades
Derkades / BAZARR_FREEBSD.md
Created February 2, 2019 16:31
Bazarr FreeBSD installation instructions

Disclaimer: I don't know how rc.d works so the script is pretty crappy and doesn't have start/stop/status functionality. It only starts the program on startup, which was enough for me.

Installing Bazarr on FreeBSD

  • Install the required software pkg update && pkg install git python27 py27-pip py27-libxml2 py27-libxslt py27-sqlite3
  • cd /usr/local
  • Clone the repository using git clone https://github.com/morpheus65535/bazarr.git (this will download the files to /usr/local/bazarr)
  • cd bazarr
  • Install Python requirements using pip install -r requirements.txt
  • Check if it works python2.7 bazarr.py. You should see BAZARR is started and waiting for request on http://0.0.0.0:6767/