Skip to content

Instantly share code, notes, and snippets.

View u1-liquid's full-sized avatar
👋
手を振る

あわわわとーにゅ u1-liquid

👋
手を振る
View GitHub Profile
@u1-liquid
u1-liquid / Set-DNS-DoH.ps1
Last active December 22, 2023 01:16
Set DNS servers
#Requires -RunAsAdministrator
Write-Output "Update DoH settings ..."
$baseRegistryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\InterfaceSpecificParameters"
if (Test-Path $baseRegistryPath) {
Remove-Item -Path $baseRegistryPath -Recurse -Force 2>&1 | Out-Null
}
$adapters = Get-NetAdapter -IncludeHidden | Where-Object {$_.Status -ne 'Not Present'}
@u1-liquid
u1-liquid / gist:d0e420cf8c8684ed95f6406d4683172f
Created December 25, 2023 21:06
Find IPv4 from Filesystem
#!/bin/sh
# https://unix.stackexchange.com/a/522127
cat /proc/net/fib_trie | awk '/32 host/ { print f } {f=$2}' | sort | uniq | grep -v 127.0.0.1
CREATE OR REPLACE FUNCTION base36_decode(IN base36 varchar)
RETURNS bigint AS $$
DECLARE
a char[];
ret bigint;
i int;
val int;
chars varchar;
BEGIN
chars := '0123456789abcdefghijklmnopqrstuvwxyz';