Skip to content

Instantly share code, notes, and snippets.

@DessertArbiter
DessertArbiter / README.md
Created July 8, 2023 19:13 — forked from krcm0209/README.md
Using AdGuard DNS over HTTPS (DoH) on Windows 11

Why

You may want to use AdGuard's DNS over HTTPS[^2] service if you

  1. Want to make it harder for your ISP to know what websites you are requesting
  2. Want to block most traditional ads from your web browsing experience across your entire PC

Setup instructions

  1. Open PowerShell
@DessertArbiter
DessertArbiter / Get-WslDistroGuids.ps1
Created April 16, 2022 19:40
PowerShell script to list the names of installed WSL distros and their corresponding GUIDs
Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Get-ItemProperty -Name DistributionName | Select-Object @{Name='Distro';Expression={$PSItem.DistributionName}},@{Name='GUID';Expression={$PSItem.PSChildName}}
@DessertArbiter
DessertArbiter / Start-MkvmergeCurrentFolder.ps1
Last active December 5, 2021 05:55
PowerShell script to run mkvmerge on all mkv and mp4 files in a directory, supports all mkvmerge parameters. Creates new mkv files in "mkvmerge" subdirectory of current folder without overwriting or deleting the originals.
$parameters = Read-Host "Enter parameters, leave blank for defaults"
$parameterArray = $parameters.Split(" ")
Write-Host "For single subtitle, base name must match video file name (without extension).`nIf files have multiple external subtitles, they must be named like so: videoFileName_Track[0 - 99].[ext]"
$numSubs = Read-Host "Number of external subtitles to merge? (0 for none)"
if ($numSubs -gt 0) {
Write-Host "External subtitles:`n`tass,pgs,vobsub,srt,etc."
$subsExt = Read-Host "Subtitle file type?"
}
$subsName = @()
@DessertArbiter
DessertArbiter / bookmarklet.js
Last active June 19, 2021 00:49
Get YouTube video file from Internet Archive Wayback Machine
javascript:var video_id = prompt('YouTube video ID');void(location.href='https://web.archive.org/web/2oe_/http://wayback-fakeurl.archive.org/yt/' + video_id);
@DessertArbiter
DessertArbiter / gitlab-clone-subgroups-http.sh
Last active May 29, 2020 03:24
clone all gitlab projects under group over http, requires curl, jq, git, and trim
#!/bin/bash
# curl, jq, git, and trim are required
echo "This script clones all repos under the specified subgroups in any gitlab instance"
echo "for even more nested subgroups, you must use %2F instead of / because gitlab is weird"
echo "ex.: subgroup%2Fsubsubgroup%2Fsubsubsubgroup"
read -p "Enter gitlab instance url (include http(s)://): " gitlabInstance
read -p "Enter the group id: " groupId
@DessertArbiter
DessertArbiter / clone_gitlab_projects.rb
Last active May 28, 2020 20:14 — forked from thegauraw/clone_gitlab_projects.rb
How to clone all the repositories or projects from gitlab?
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
# TWO WAYS TO RUN THIS SCRIPT:
# ----------------------------
# --->>> THE FIRST WAY> Run this script as executable: `./clone_gitlab_projects.rb`
# You need to make the script executable: `chmod +x gitlab_clone_all_repos.rb`
# ---- ANYTHING ABOVE THIS LINE IS ONLY REQUIRED IF YOU WANT TO RUN THE SCRIPT WITH SINGLE COMMAND `./clone_gitlab_projects.rb` ---- #
@DessertArbiter
DessertArbiter / google-services-whitelist.txt
Last active May 14, 2020 19:51
AdGuard whitelist for Google services
! Title: AdGuard Google whitelist
! Homepage: https://gist.github.com/DessertArbiter/ba13c026c0d3058fd122e082898c2c84
! Expires: 4 days (update frequency)
! Version: 0.2.1
! Google
@@||0.client-channel.google.com^$important,document,~extension
@@||2.android.pool.ntp.org^$important,document,~extension
@@||android.clients.google.com^$important,document,~extension
@@||appsbackup-pa.clients6.google.com^$important,document,~extension
@@||appsbackup-pa.googleapis.com^$important,document,~extension
@DessertArbiter
DessertArbiter / twitter_list_members.rb
Last active August 22, 2019 00:30 — forked from jpmckinney/twitter_list_members.rb
Download all Twitter list members to CSV
require 'csv'
require 'twitter'
@client = Twitter::REST::Client.new do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
@DessertArbiter
DessertArbiter / 0-openwrt-auto-mount-readme.md
Last active July 9, 2019 18:18 — forked from lanceliao/0-openwrt-auto-mount-readme.md
Auto mount USB storage device by uuid on OpenWrt
  1. Install USB device support;
opkg install kmod-fs-ntfs ntfs-3g kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage e2fsprogs fdisk usbutils mount-utils block-mount kmod-fs-ext4 kmod-fs-vfat kmod-nls-utf-8 kmod-nls-cp437 kmod-nls-iso8859-1

reboot
  1. Install blkid, run opkg update && opkg install blkid;
  2. Copy block.sh to directory /lib/functions;
  3. Copy 10-mount and 20-swap to directory /etc/hotplug.d/block;
  4. That's it! run logread -f command then plug in a USB stick to test.
@DessertArbiter
DessertArbiter / yt-unsub.js
Last active November 22, 2017 20:50
Unsubscribe from all YouTube channels on current page
var button = document.getElementsByClassName("subscribed-label");
for(var i=0;i<button.length;i++)
{
button[i].click();
var unsub = document.getElementsByClassName("overlay-confirmation-unsubscribe-button");
//console.log(unsub.length)
for(var j=0;j<unsub.length;j++)
unsub[j].click();
}