Skip to content

Instantly share code, notes, and snippets.

@remino
remino / .gitignore
Last active September 1, 2024 21:33
*
!.gitignore
!make-macos-folder-icns.sh
@OrionReed
OrionReed / dom3d.js
Last active December 9, 2024 07:36
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@jmconway
jmconway / Set-Win10Baseline21H2.ps1
Created May 29, 2022 21:51
PowerShell module/helper script with custom functions for imaging Windows 10 build 21H2 with MDT/WDS.
# For the purposes of this script, assume DWORD values
function Set-RegistryItem {
param (
[CmdletBinding()]
[string]$Path
)
param (
[CmdletBinding()]
[string]$Name
)
@realAzazello
realAzazello / Personal_GHHbD_block-list.txt
Last active April 1, 2024 00:16
Personal block list used for GHHbD ('Google Hit Hider by Domain'), a userscript <http://www.jeffersonscher.com/gm/google-hit-hider/> created by Jefferson Scher
[Personal "Google Hit Hider by Domain" list]
['Bad' TLDs]
[https://greasyfork.org/en/forum/discussion/comment/55821/#Comment_55821]
[The Top 10 Worst TLDs - https://www.spamhaus.org/statistics/tlds/]
[https://github.com/hagezi/dns-blocklists#tlds]
[https://github.com/yokoffing/filterlists/blob/main/enhanced_site_protection.txt]
[https://github.com/ShadowWhisperer/BlockLists/blob/master/Lists/Top_Level]
[https://hblock.molinero.dev/most_abused_tlds.txt]
@ishad0w
ishad0w / microsoft_edge_uninstaller_21h1_ltsc.bat
Last active November 14, 2024 15:23
Microsoft Edge Uninstaller [Windows 10 LTSC 2021/21H1 Edition]
@echo off
@title Microsoft Edge Uninstaller [Windows 10 LTSC 2021/21H1 Edition]
ver
echo+
goto check_admin_permissions
:check_admin_permissions
echo Script must Run as Administrator! Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
@ByronScottJones
ByronScottJones / profile.ps1
Last active May 30, 2021 00:27
Powershell Profile
#Requires -Version 7
# Version 1.2.9
$Secrets = get-content -raw -path ~/.secrets/secrets.json | cnvertfrom-json
# check if newer version
#$gistUrl = "https://api.github.com/gists/......."
gistUrl = $Secrets.PowershellProfile.gistUrl
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
@crutkas
crutkas / InstallWinGet.ps1
Last active June 30, 2024 07:15
InstallWinGet PowerShell
function InstallWinGet()
{
$hasPackageManager = Get-AppPackage -name "Microsoft.DesktopAppInstaller"
if(!$hasPackageManager)
{
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$releases = Invoke-RestMethod -uri "$($releases_url)"
@filhocodes
filhocodes / .gitignore
Created February 14, 2021 13:30
Ansible Setup
inventory.local.yml
@snizovtsev
snizovtsev / cdm_fio.sh
Last active November 19, 2024 15:09 — forked from i3v/cdm_fio.sh
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics