Keeping in mind the "Latency Numbers Every Programmer Should Know", i.e. network access is expensive.
existing
/not existing
have the same high cost- network access takes a long time
- leak every hash to hashlookup service
#!/bin/zsh | |
# ================================================================================ | |
# A macOS shell script to create an .icns icon file from an image input file | |
# | |
# NOTE: make this file executable first using: | |
# chmod +x /path/to/icon_maker.sh | |
# | |
# -------------------------------------------------------------------------------- | |
# Source: https://gist.github.com/Swiss-Mac-User/7a1a55e499db618c59718cbffe23318c |
#!/bin/bash | |
# Inspired from: https://x.com/SwissMacUser/status/1349065380514426883 | |
# Personally used to add event reminders to the downloadabl iCalendar files | |
# of the yearly Stadt Zürich digital Entsorgungskalender at | |
# https://www.stadt-zuerich.ch/ted/de/index/entsorgung_recycling/entsorgen/persoenlicher_entsorgungskalender.html | |
# Check if the minimum number of arguments is provided | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: $0 <path-to-ics-file> <hours-to-alert-before> [backup]" |
find /path/to/dir -maxdepth 2 -type f -exec sh -c 'iconv -f utf-8 -t utf-8 "{}" >/dev/null 2>&1 || echo "{}: Not UTF-8"' \; |
Keeping in mind the "Latency Numbers Every Programmer Should Know", i.e. network access is expensive.
existing
/ not existing
have the same high cost<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>UnifiedBar</key> | |
<dict> | |
<key>DisclosureRequired</key> | |
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string> | |
<key>Enabled</key> | |
<false/> |
/** --- | |
* To set an existing column in MySQL 5.7 from 0000-00-00 00:00:00 to NULL as default | |
* the following iterative 3 steps will get the job done. | |
* (Without just using the NO_ZERO_DATE compatibility mode-workaround) | |
--- */ | |
/* Step 1) Set all 0000-00-00... to a valid but nonsense value: */ | |
UPDATE my_table SET my_datetime_col = '1001-01-01 00:00:00' WHERE CAST(my_datetime_col AS CHAR(20)) = '0000-00-00 00:00:00'; | |
/* Step 2) Modify the column to DEFAULT: NULL */ |
#for an image ("not running container") use save: | |
docker save <dockernameortag> | gzip > mycontainer.tgz | |
#for running or paused docker, use export: | |
docker export <dockernameortag> | gzip > mycontainer.tgz | |
#load | |
gunzip -c mycontainer.tgz | docker load |