Convert a directory of PNGs to JPEGs:
for file in `ls *.png`
do
extension="${file##*.}"
base="${file%.*}"
convert "$file" -quality 60 "${base}.jpg"
doneConvert a directory of PNGs to JPEGs:
for file in `ls *.png`
do
extension="${file##*.}"
base="${file%.*}"
convert "$file" -quality 60 "${base}.jpg"
doneUse the --server flag with certbot to direct the client to a specific ACME server.
The Let's Encrypt status site lists their active servers (along with their status, obviously). Prepend the server fqdn with https:// and append /directory to the end for use with the certbot command.
E.g., for ACME v02 (which supports wildcard certs),
certbot certonly --dns-route53 --server https://acme-v02.api.letsencrypt.org/directory --domain "example.com" --domain "*.example.com"
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n <certificate nickname> \
-i <certificate filename>
E.g.,
From this Reddit post.
Replace <username> with your GitHub username and be prepared to enter your GitHub password on the command line.
If you have more than 100 repositories, you'll need to run this command several times, editing the page=? parameter each time.
Replace ssh_url in the jq query with git_url for git:// scheme, and with clone_url for https:// scheme.
LISTFILE=repos.txt
curl -u "<username>" "https://api.github.com/user/repos?page=1&per_page=100" | jq '.[].ssh_url' | while read repo
do
For some reason, font foundries still do not routinely include web font files, even when the font face is specifically licensed for use on the web, and will only provide the fonts in TrueType (TTF) format.
There is no need to use a sketchy online converter that might illegally save a copy of your expensively-licensed font.
Google maintains free software (MIT) command-line utilities to compress and decompress WOFF2 files.
"Converting" (really, just encoding and compressing) TTF to WOFF is as simple as:
$ woff2_compress myfont.ttf
If a font size should scale linearly with the viewport width (or height), e.g. from 12px at 375w to 24px at 1280w, the interpolated font size can be calculated using the slope-intercept line equation (y = mx + b) with x set to 100vw (or vh) and using px units for b.
Make your life easier by using Wolfram Alpha to compute the equation of the line passing through two points (x1, y1) and (x2, y2), where x1 and x2 are the size of the viewport dimension (width or height) and y1 and y2 are the target font sizes at those viewport dimensions.
Continuing the example above, for 12px at 375w to 24px at 1280w, the points are (375,12) and (1280,24).
For the line between those two points, Wolfram Alpha returns the equation:
y = (12/905)x + (1272/181)
| #!/usr/bin/env node | |
| console.log('gist'); |