This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The chip info can be found via sensors-detect in lm_sensors | |
# Driver `to-be-written': | |
# * ISA bus, address 0xa40 | |
# Chip `ITE IT8686E Super IO Sensors' (confidence: 9) | |
# Driver `it87': | |
# * ISA bus, address 0xa60 | |
# Chip `ITE IT8792E Super IO Sensors' (confidence: 9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
K8S_VERSION_MINOR=1.29 | |
# Repos for cri-o | |
curl -fsSL https://pkgs.k8s.io/addons:/cri-o:/stable:/v${K8S_VERSION_MINOR}/deb/Release.key | | |
gpg --dearmor -o /etc/apt/keyrings/cri-o-apt-keyring.gpg | |
echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://pkgs.k8s.io/addons:/cri-o:/stable:/v${K8S_VERSION_MINOR}/deb/ /" | | |
tee /etc/apt/sources.list.d/cri-o.list | |
# Repo for Kubernetes tools/components | |
curl -fsSL https://pkgs.k8s.io/core:/stable:/v${K8S_VERSION_MINOR}/deb/Release.key | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime] | |
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost() | |
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type @' | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Security.Principal; | |
public class LsaUtility | |
{ | |
[DllImport("advapi32.dll")] | |
private static extern int LsaOpenPolicy( | |
ref LSA_UNICODE_STRING sysName, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Find colored lines | |
# 2. Strip out useless lines | |
# 3. Strip empty "colored" lines | |
grep --color=never $'\x1b''\[[0-9;]*' \ | |
| grep -vE 'Terraform has been|Initializing |use this backend unless the backend configuration changes|commands will detect it and remind you to do so if necessary|Refreshing state...|Read complete after |Reading...| copy_backend_before_init |Terraform has compared your real infrastructure|No changes.' \ | |
| sed -E '/^'$'\x1b''\[0m'$'\x1b''\[32m/d' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Don't require DUN APN type | |
settings put global tether_dun_required 0 | |
# use MagiskHide Props Config | |
# echo "net.tethering.noprovisioning=true" >> /system/build.prop | |
# iptables increment TTL for nat packets since carriers block these | |
# Requires kernel with CONFIG_IP_NF_TARGET_TTL enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnf install -y VirtualBox-server | |
# Make a vhd | |
qemu-img create -f vpc test.vhd 8G | |
virt-format -a test.vhd --partition=gpt --filesystem=ntfs | |
echo 'write /readme.txt "readme"' | guestfish -a test.vhd -m /dev/sda1 | |
mkdir test | |
vboximg-mount --image $(pwd)/test.vhd --rw --root test | |
mkdir testfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List targets | |
iscsiadm -m discovery --type sendtargets -p <portal host/socket> | |
# Login to a target | |
iscsiadm -m node -T <target IQN> -l | |
# List active/logged in targets | |
iscsiadm -m session | |
# Logout of a target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm --privileged --pid=host ubuntu:22.04 \ | |
nsenter -t 1 -m -u -n -i \ | |
sh -c "sed -i '/enable-admission-plugins/{/NamespaceAutoProvision/b; s/$/,NamespaceAutoProvision/}' /etc/kubernetes/manifests/kube-apiserver.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python3 -c ' | |
import json | |
import sys | |
from urllib.parse import urlparse, parse_qs | |
print(json.dumps(parse_qs(urlparse(sys.argv[1]).query))) | |
' |
NewerOlder