Skip to content

Instantly share code, notes, and snippets.

@mdPlusPlus
mdPlusPlus / CopyNewDrivesToDisk.java
Created May 31, 2016 21:42
check for new drives periodically and copy content to given location
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileStore;
import java.nio.file.FileSystems;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import org.apache.commons.io.FileUtils;
import static java.lang.System.exit;
public class HashReplace {
#!/bin/bash
##Original from here: https://www.makemkv.com/forum2/viewtopic.php?f=3&t=5266&start=30#p56468
build_dir="/tmp/build-makemkv/"
build_log="/tmp/makemkv_install.log"
url_ffmpeg_releases="https://www.ffmpeg.org/releases/"
url_makemkv="https://makemkv.com/download/"
url_makemkv_serial="https://forum.makemkv.com/forum/viewtopic.php?f=5&t=1053"
serial_makemkv=$(curl -s4 --url "${url_makemkv_serial}" | grep -oP 'T-[\w\d@]{66}')
vers_ffmpeg=$(curl -s4 "${url_ffmpeg_releases}" | grep -E -o 'ffmpeg-([0-9]{1,}\.)+[0-9]{1,}' | sort -t. -rn | head -n 1)
##If there are problems, use 3.2.4 - https://makemkv.com/forum2/viewtopic.php?f=3&t=16059
@mdPlusPlus
mdPlusPlus / lineage_devices.sh
Last active December 11, 2020 09:45
Provides a textfile with all officially supported LineageOS devices to import into a spreadsheet (LibreOffice calc)
#!/bin/bash
table_file=./table.txt
echo "wait"
echo -n "" > $table_file
wget -q https://github.com/LineageOS/lineage_wiki/archive/master.zip
unzip -q master.zip
rm master.zip
@mdPlusPlus
mdPlusPlus / compile_newest_stable_kernel_with_acso_patch.sh
Last active March 22, 2023 12:19
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/bin/bash
function install_dependencies() {
echo "Installing dependencies..."
sudo apt -qq update
sudo apt -qq install -y curl git wget
# sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev
sudo apt -qq install -y bison flex libelf-dev libssl-dev
}
@mdPlusPlus
mdPlusPlus / Dockerfile
Last active September 22, 2018 20:15
Dockerfile: jd-headless-openvpn (use JDownloader behind OpenVPN client)
#FROM alpine:latest
#FROM debian:stable
FROM ubuntu:rolling
MAINTAINER mdPlusPlus
RUN \
apt -qq update ; \
apt -qq full-upgrade -y
# 1. Put items in brackets on new lines "xxx (abc@gmail.com" -> "xxx \nabc@gmail.com"
# 2. Get only email addresses (contains "@")
# 3. Get rid of placeholders ("*")
# 4. Remove all spaces
# 5. Convert uppercase to lowercase
# 6. Sort and remove duplicates
sanitized_input=$(sed -e 's/(/\n/g' -e 's/)//g' "$1" | grep -F '@' | grep -F -v '*' | sed 's/ //g' | tr '[:upper:]' '[:lower:]' | sort -u)
# Get all Google accounts (without the @domain part)
google_accs=$(echo "${sanitized_input}" | grep -F -i -e '@gmail.com' -e '@googlemail.com' | sed -e 's/@googlemail.com//g' -e 's/@gmail.com//g' | sort -u)
@mdPlusPlus
mdPlusPlus / web_de.txt
Last active November 8, 2019 18:42
web.de FreeMail list for uBlock Origin
! Add via "https://gist.github.com/mdPlusPlus/35bee203897bed57ced1f1a5e1d2148a/raw"
! https://web.de
web.de###footer
web.de###loginsearch-ad
web.de###mainnav
web.de###promoline
web.de###rightnav
web.de##.games
web.de##.logout-modules
web.de##.partner-links
@mdPlusPlus
mdPlusPlus / fix-vega-reset.patch
Last active July 5, 2019 12:36 — forked from numinit/0-index.md
Modified version to apply on 5.1+
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index cc616a5..1a5c04a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3433,6 +3433,11 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034, quirk_no_bus_reset);
* accesses to the child may fail.
*/
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CAVIUM, 0xa100, quirk_no_bus_reset);
+/*
+ * Radeon RX Vega devices break on bus reset. Oi...
@mdPlusPlus
mdPlusPlus / openwrt-imagebuilder-commands.txt
Last active March 31, 2020 16:26
OpenWRT imagebulder commands
# Dependencies:
# apt-get install build-essential libncurses5-dev libncursesw5-dev zlib1g-dev gawk git gettext libssl-dev xsltproc wget unzip python
# Files:
# update.sh wg_mullvad_ip.sh wg-watchdog.sh
# x86_64
# Snapshot:
# - https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-imagebuilder-x86-64.Linux-x86_64.tar.xz