"([^"]+)"$
➡️ $1
This regex is used for the following CSV transformation:
... | requests |
---|---|
... | SY 167,DSW 167 |
... | DSJ 119 |
... | KA 330,INS 251,K 153 |
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 |
#!/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" |
#!/bin/bash | |
hash curl || exit 1 | |
hash jq || exit 2 | |
usage_msg=" | |
Usage: | |
$0 <leader|followers> <consul|nomad|vault> <host_address> [<query_string>] | |
Examples: | |
$0 leader vault my-vault.example.com |
Grow the disk in your hypervisor (Hyper-V: Edit Disk in Actions panel)
Apply the disk size change (you can do echo 1 | sudo tee /sys/class/block/sda/device/rescan
instead of partprobe
)
$ sudo partprobe /dev/sda
$ sudo dmesg | tail
...
[4688278.217348] sd 2:0:0:0: Capacity data has changed
[4688278.217583] sd 2:0:0:0: [sda] 83886080 512-byte logical blocks: (42.9 GB/40.0 GiB)
const int batchSize = 50; | |
async Task Paginate<TEntity>(DbSet<TEntity> dbSet, | |
Func<int, CancellationToken, Task> action, | |
CancellationToken cancellationToken = default) where TEntity : class { | |
var count = await dbSet.CountAsync(cancellationToken); | |
var remain = count; | |
while(remain > 0) { | |
logger.LogInformation($"Processing {batchSize} of {remain} items..."); | |
await action(skip: count - remain, cancellationToken); |
cat <<'EOF' | sudo tee /usr/local/sbin/addswap.sh | |
#!/bin/sh | |
if [ ! -f /mnt/swapfile ] | |
then | |
/usr/bin/fallocate -l 30G /mnt/swapfile | |
/usr/bin/chmod 600 /mnt/swapfile | |
/usr/sbin/mkswap /mnt/swapfile | |
/usr/sbin/swapon /mnt/swapfile | |
fi |
<body><style>textarea{width:99%;height:49%;}body{margin:0;}textarea{width:99%;font-size:18px;padding:0.5em}</style><textarea placeholder="Decoded" id="d"></textarea><textarea placeholder="Encoded" id="e"></textarea><script>document.querySelectorAll("textarea").forEach(t=>t.addEventListener("keyup",function(e){switch(e.target.id){case"d":document.getElementById("e").value=encodeURIComponent(e.target.value);break;case"e":document.getElementById("d").value=decodeURIComponent(e.target.value);break;}}))</script></body> |
#!/bin/bash | |
groupA0=( | |
"group-A0 item-0" | |
"group-A0 item-1" | |
) | |
groupB0=( | |
"group-B0 item-0" | |
"group-B0 item-1" | |
"group-B0 item-2" | |
) |
#!/bin/sh | |
url='https://httpstat.us/500' | |
attempts=3 | |
delay_sec=3 | |
curl_return_code=1 | |
while [ $curl_return_code -ne 0 ] && [ $attempts -gt 0 ] | |
do | |
echo "--- requesting..." |