wget https://gist.githubusercontent.com/Himura2la/c2ef40ce86b1698e1a7db8b144657912/raw/toJson.sh
chmod +x toJson.sh
./toJson.sh < file
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 | |
echo "Usage: $0 deploy|extract (default: deploy)" | |
engine=podman | |
script_dir="$(readlink -f "$(dirname "$0")")" | |
set -x | |
action=${1-deploy} | |
cc=$($engine run --rm -dtv grafana-config:/g -v prometheus-config:/p busybox) |
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 urllib.request import urlopen, Request, HTTPError | |
def fetch(url, method=None, data=None, headers={}): | |
try: | |
with urlopen(Request( | |
url, | |
data=data.encode('ascii') if data else None, | |
headers=headers, | |
method=method | |
)) as resp: |
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
# CA | |
openssl ecparam -genkey -name prime256v1 -out ca.key | |
cat > ca.conf <<EOF | |
[req] | |
prompt = no | |
x509_extensions = ext | |
distinguished_name = dn | |
[ext] |
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
stat /dev/ttyUSB0 # Gid: ( 18/ dialout) | |
sudo usermod -aG dialout $USER | |
sudo reboot |
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
server { | |
listen 80; | |
server_name nya.nya; | |
default_type text/plain; | |
return 200 'nya nyaaaa~\n'; | |
} |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15E.LOCALDB\MSSQLServer\Parameters] | |
"SQLArg0"="-T1800" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16E.LOCALDB\MSSQLServer\Parameters] | |
"SQLArg0"="-T1800" |
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 json | |
import os | |
import csv | |
from urllib.request import urlopen, Request, HTTPError | |
csv_path = os.path.expanduser(r"~\Desktop\data.csv") | |
additional_cols = [] | |
def fetch_additional_data(row): | |
# TODO |
"([^"]+)"$
➡️ $1
This regex is used for the following CSV transformation:
... | requests |
---|---|
... | SY 167,DSW 167 |
... | DSJ 119 |
... | KA 330,INS 251,K 153 |
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 | |
set -xe | |
export domain='change.me' | |
certbot --config ./cli-certbot.ini certonly -d "*.$domain" | |
# Follow the instructions. | |
ansible-vault encrypt "./tmp/config/live/$domain/privkey.pem" --output "./${domain}_privkey.pem.vault" | |
cat "./tmp/config/live/$domain/fullchain.pem" > "./${domain}_fullchain.pem" |
NewerOlder