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 python3 | |
""" | |
Use inotify to monitor the file count and size of a given directory. | |
There may be small race conditions that lead to count/size errors | |
so output should be considered a close estimate. | |
* Requires only Python 3 stdlib & Linux | |
""" |
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
from bs4 import BeautifulSoup | |
import pandas as pd | |
import requests | |
import re | |
import json | |
search_url = "https://leekduck.com/boxsales/" | |
headers = { | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0", |
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 requests | |
search_url = "https://leekduck.com/boxsales/" | |
headers = { | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0", | |
"Referer": "https://web.archive.org/web/*" | |
} | |
sparklines = requests.get( |
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" |