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/bash | |
export PGSSLMODE=prefer | |
DATABASE=postgres | |
USER=postgres | |
SOURCE_PASSWORD=postgres | |
SOURCE_HOST=$(docker inspect postgres-5433 | jq -r '.[0].NetworkSettings.IPAddress') | |
SOURCE_PORT=5432 |
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/bash | |
LOOPS=3 # How many times to run each test | |
SIZE=10240 # Size of each test, multiples of 32 recommended for Q32 tests to give the most accurate results. | |
WRITEZERO=0 # Set whether to write zeroes or randoms to testfile (random is the default for both fio and crystaldiskmark); dd benchmarks typically only write zeroes which is why there can be a speed difference. | |
QSIZE=$(($SIZE / 32)) #Size of Q32Seq tests | |
SIZE+=m | |
QSIZE+=m |
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
#!/usr/bin/env bash | |
pod_name=nick-ssh | |
# the first node | |
k8s_node=$(kubectl get nodes -o jsonpath='{.items[0].metadata.name}') | |
cat <<EOF | kubectl create -f - | |
apiVersion: v1 | |
kind: Pod |
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
SELECT | |
key, COALESCE(ti.SortName, mi.sortname) SortName, COALESCE(ti.Path, mi.Path) Path | |
FROM UserDatas u | |
LEFT JOIN TypedBaseItems ti | |
ON | |
u.key = ti.UserDataKey | |
OR REPLACE(u.key, '-', '') = ti.PresentationUniqueKey | |
LEFT JOIN MediaItems mi | |
ON | |
REPLACE(u.key, '-', '') = mi.PresentationUniqueKey |
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
resolvectl dns tap0 172.16.3.254 | |
resolvectl domain tap0 ~. |
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 | |
Get-WmiObject win32_nteventlogfile | |
Remove-EventLog -LogName "Some Log Name" |
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
# see https://findwork.dev/blog/advanced-usage-python-requests-timeouts-retries-hooks/ | |
import requests | |
from requests.adapters import HTTPAdapter, Retry | |
class TimeoutHTTPAdapter(HTTPAdapter): | |
DEFAULT_TIMEOUT = 30 | |
def __init__(self, *args, **kwargs): |
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
import boto3 | |
import json | |
# assumes ASG has tag Name="ECS Cluster - cluster_name" | |
cluster_name = "some-clsuter" | |
asgs = [ | |
{ | |
"name": asg["AutoScalingGroupName"], | |
"instance_type": asg["Instances"][0]["InstanceType"], |