Skip to content

Instantly share code, notes, and snippets.

View da2x's full-sized avatar

Daniel Aleksandersen da2x

View GitHub Profile
@da2x
da2x / rhythmbox-to-tauon-playcount-migration.py
Created April 8, 2022 02:45
Migrate your music play counts from Rythmbox 3.4.4. to Tauon 7.1.3
#!/usr/bin/python3
# SPDX-License-Identifier: CC0-1.0
#
# One-time Rhythmbox to Tauon playcount migration tool
import os
import pickle
import shutil
import urllib.parse as urlparser
import xml.etree.ElementTree as ET
@da2x
da2x / Delivery Optimization tweaks.reg
Created July 26, 2021 00:25
Encurrage Windows Updates to use Delivery Optimization P2P in more situations
Windows Registry Editor Version 5.00
; This file is documented at:
; https://www.ctrl.blog/entry/windows-delivery-optimization.html
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization]
"DODelayBackgroundDownloadFromHttp"=dword:e10
"DODelayForegroundDownloadFromHttp"=dword:12C
"DOMinFileSizeToCache"=dword:2
"DOMinDiskSizeAllowedToPeer"=dword:10
0 1 2: 0 0 0 0;
0: 1 9 0 0;
2: 1 63 0 0 ;
1: 1 63 0 0 ;
0: 10 63 0 0;
@da2x
da2x / fedora-askbot-redirects.conf
Created May 17, 2019 15:40
HTTPD redirects from ask.fedoraproject.org to the old askbot posts on the Internet Archive.
This file has been truncated, but you can view the full file.
Redirect 301 /en/question/9369/network-manager-not-detecting-3g-modem-after-installing-mobilepartner-app/ https://web.archive.org/web/20190517/https://askbot.fedoraproject.org/en/question/9369/network-manager-not-detecting-3g-modem-after-installing-mobilepartner-app/
Redirect 301 /en/question/10303/no-option-for-gnome-desktop-at-start-up-newbie/ https://web.archive.org/web/20190517/https://askbot.fedoraproject.org/en/question/10303/no-option-for-gnome-desktop-at-start-up-newbie/
Redirect 301 /en/question/54800/how-to-remove-a-font-installed-on-fedora-20/ https://web.archive.org/web/20190517/https://askbot.fedoraproject.org/en/question/54800/how-to-remove-a-font-installed-on-fedora-20/
Redirect 301 /en/question/104551/is-there-a-source-of-older-gcc-packages-for-fedora-25/ https://web.archive.org/web/20190517/https://askbot.fedoraproject.org/en/question/104551/is-there-a-source-of-older-gcc-packages-for-fedora-25/
Redirect 301 /en/question/10923/how-to-force-all-gnome-applications-to-use-the-dark-adwaita-theme/
@da2x
da2x / dweb_researcher.py3
Last active December 18, 2022 08:20
Python 3 program for parsing Tranco ranking lists to discover Dat and IPFS websites.
from os.path import isfile
from urllib.request import urlopen
import concurrent.futures
import socket
import dns.resolver
import time
from urllib.request import urlopen, Request
import multiprocessing as mp
import os
import sys
@da2x
da2x / tranco-dat-research.csv
Last active February 11, 2019 17:36
Top 10 websites with http://$domain.well-known/dat from crawling the top 2,4 million most popular websites and domains in January 2019
Tranco RNXW List Rank Dat archive domain name availability
0149929 dat://d82084b53fce5f07696c2acf98a363601ec9410d06c633513269979786464eb3 ar.al available
0406174 dat://4bc5d5651d95e89348663fa71dd62de9bb2cdb247c7c02414e7d0ba917d95c2c evertpot.com unavailable
0417810 dat://ba81c9746d6183f3d5c05d51279ff3e0fed06369d0e17a3bbd4ac76e7303b418 ind.ie available
0505161 dat://47a6d1ac8084cdbeba2def34eb3528fe7c23add67442c516314acaa47937db26 staltz.com unavailable
0742962 dat://8bb99a0ac0d56131e61bd4bfea74ced9bc2c603e78e4eb72e8dd2fd6f33743cd beakerbrowser.com available
0848744 dat://54cb4accdabc258240d76df28ee66c0900aeaadddb822e2b99e0cef113ae128b bernsteinbear.com unavailable
0874829 dat://8dd20f73e70b5a467eabefd2c3ef6e0d39668afea90190e498e7cc396a1bea07 inkdroid.org available
0887990 dat://cff13e4cc797f46d453d4b2d7472dd481d7fd2f0a1c6e4eab425327f48c396fd macwright.org unavailable
1167327 dat://676db9db2e04a604ea6dbc798bb0d327a335c19b4856ac496ae4bb34e367633a freedombone.net unavailable
@da2x
da2x / google-my-activity-deletion.js
Created May 27, 2018 14:48
Delete My Activity from your Google Account older than 9 moonths.
Date.prototype.getUnixTime = function() {
return this.getTime()/1000|0;
};
Date.prototype.getUnixMicroUnixTime = function() {
return this.getUnixTime()*1000000;
};
var date = new Date();
date.setMonth(date.getMonth() - 9);
@da2x
da2x / track-hashes.js
Created March 10, 2018 23:44
Hash-based tracking links
/*
Tracking links that use hashes rather than query parameters.
Improves privacy by not including campaign data in referral-out links.
Improves CDN/proxy privacy by not sharing campaign data with them. Also improves caching!
Tracking links can (optionally) be removed from URLbar/history without a redirect.
Example links:
/document#s:feed
/document#s:email
*/
@da2x
da2x / brave_publisher_dns_crawler.py
Created December 6, 2017 19:40
Detects websites with brave-leder-verifications in their DNS records. Note that such a ledger is no guarantee that the website is infact a verified Brave publisher.
# Download and unzip Alexa Top 1 Million websites
# http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
# Run this script.
from os.path import isfile
from urllib.request import urlopen
import concurrent.futures
import socket
import dns.resolver
import time
@da2x
da2x / amp2html.js
Created September 28, 2017 13:47
Redirect AMP pages to the canonical HTML equivalent.
if (document.querySelector("html[amp],html[⚡]")) {
var amp = document.head.querySelector("link[rel='amphtml'][href]"),
canon = document.head.querySelector("link[rel='canonical'][href^='https://'],\
link[rel='canonical'][href^='http://']");
if (null != canon && amp != canon) {
document.location = canon.href;
} }