Skip to content

Instantly share code, notes, and snippets.

View TheGreyDiamond's full-sized avatar

TheGreyDiamond

View GitHub Profile
@cristianrasch
cristianrasch / rsyncrypto.sh
Last active February 9, 2023 19:37
rsyncrypto tutorial
# Generate your backup private key and certificate
openssl req -nodes -newkey rsa:1536 -x509 -keyout backup.key -out backup.crt
# Encrypt your data to a temporary folder
rsyncrypto --verbose --ne-nesting=2 --trim=2 --name-encrypt=/tmp/rsyncrypto-map --delete-keys --changed --recurse /home/cristian/Dropbox/ /tmp/Dropbox/ /tmp/rsyncrypto-keys ~/Dropbox/backups/laptop/crypto/rsyncrypto/backup.crt
# Send it over the network
rsync --verbose --archive --compress --delete /tmp/Dropbox/ pi:~/backups/laptop
# Decryption time!
@afeish
afeish / md-renderer.conf
Created September 12, 2018 10:49 — forked from max-lt/md-renderer.conf
Nginx config to render markdown files (client side)
location /__special {
internal;
allow all;
root /usr/share/nginx/html/__special;
}
location = /__md_file {
internal;
allow all;
@sindresorhus
sindresorhus / esm-package.md
Last active July 30, 2024 19:45
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.