This file contains hidden or 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 | |
| # It seems it's very hard to set resample output quality with Ghostscript. | |
| # So instead rely on `prepress` preset parameter to select a good /QFactor | |
| # and override the options we don't want from there. | |
| gs \ | |
| -o resampled.pdf \ | |
| -sDEVICE=pdfwrite \ | |
| -dPDFSETTINGS=/prepress \ |
This file contains hidden or 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
| IdentitiesOnly=yes | |
| ConnectTimeout=10 | |
| ConnectionAttempts=1 | |
| Host * | |
| UseKeychain yes | |
| GSSAPIAuthentication no | |
| Host 10.245.* | |
| User ec2-user | |
| IdentityFile ~/.ssh/aws.pem |
This file contains hidden or 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 | |
| # Manually free up local copies of files backed up to iCloud. | |
| path=${1:-*} | |
| pushd "~/Library/Mobile Documents/com~apple~CloudDocs" \ | |
| && brctl evict $path |
This file contains hidden or 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
| /* | |
| * Quick demonstration of `id = LAST_INSERT_ID(id)` being the key to returning | |
| * the existing id when doing `ON DUPLICATE KEY UPDATE`. The unfortunate side | |
| * effect of this approach is that the sequence number for `id` increments on | |
| * every update, even though the value for the updated row does not change. On | |
| * update-heavy systems with 32-bit id`s, the sequence could be exhausted in a | |
| * fairly short amount of time. | |
| * | |
| * Just switch to MariaDB and use `RETURNING id` instead. PostgreSQL got this | |
| * keyword in 2006. Oracle was doing this in procedural code no later than 1997. |
This file contains hidden or 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
| version: "3.8" | |
| services: | |
| unifi-controller: | |
| image: lscr.io/linuxserver/unifi-network-application:7.5.187 | |
| restart: unless-stopped | |
| depends_on: | |
| - ferretdb | |
| environment: | |
| PUID: 1000 | |
| PGID: 1000 |
This file contains hidden or 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 sh | |
| # stuff to do when setting up a fresh install of MacOS | |
| set -o errexit -o nounset -o noclobber | |
| [ -e /etc/pam.d/sudo_local ] || \ | |
| echo 'auth sufficient pam_tid.so' \ | |
| | sudo tee /etc/pam.d/sudo_local | |
| softwareupdate --install-rosetta --agree-to-license |
This file contains hidden or 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
| -- I needed a way to safely pull a bunch of sequence values to my client in order to bulk | |
| -- insert many thousands of rows. I'm doing this because I don't want to use 128-bit keys. | |
| -- I found this: | |
| -- https://www.depesz.com/2008/03/20/getting-multiple-values-from-sequences/ | |
| select pg_advisory_lock(123); | |
| alter sequence seq increment by 1000; | |
| select nextval('seq'); | |
| alter sequence seq increment by 1; | |
| select pg_advisory_unlock(123); |
OlderNewer