Skip to content

Instantly share code, notes, and snippets.

View jivanpal's full-sized avatar

Jivan Pal jivanpal

View GitHub Profile
#!/bin/bash
IFS=$'\n'
for d in $(cat dir-list.txt); do (
cd "$d"
echo
echo "$d/"
# Version 2 required in order to impose resource limits in Docker Compose (non-Swarm) environment
version: '2.2'
services:
synapse:
image: matrixdotorg/synapse:latest
container_name: synapse
# Since synapse does not retry to connect to the database, restart upon failure
restart: unless-stopped
@jivanpal
jivanpal / google-photos-reorganise-2020.sh
Last active February 13, 2024 19:10
Bash scripts to reorganise Google Photos exports from Google Takeout
#!/bin/bash
## Works with the Google Takeout format from 2020 and earlier, in which
## items are already within directories of the form "YYYY-MM-DD", and you
## want a directory hierarchy of the form "YYYY/MM/DD".
##
## You must run this script from the directory which contains all the
## directories of the form "YYYY-MM-DD". The resulting directories of the
## form "YYYY/MM/DD" will be created in this same location.
@jivanpal
jivanpal / compile-nginx-brotli-modules.sh
Last active March 4, 2024 17:52
Compile Brotli modules for Nginx 1.18.0 on Ubuntu 20.04
#!/bin/bash -e
sudo apt install \
curl \
build-essential \
libpcre3-dev \
libssl-dev \
zlib1g-dev \
libxml2-dev \
libxslt1-dev \
@jivanpal
jivanpal / migrate.sh
Last active May 24, 2022 14:50
s3backer scripts for Nextcloud
#!/bin/bash
mkdir -p /mnt/nextcloud-bucket/{s3backer,filesystem}
s3backer \
--listBlocks \
\
--blockSize=1M \
--size=500G \
\
@jivanpal
jivanpal / kill-adobe-daemons.sh
Last active August 6, 2023 17:23
Stop Adobe Creative Cloud daemons (background processes) in their tracks
#!/bin/bash
if [ "$1" = "-s" ] || [ "$1" = "--show" ]; then
show=true
else
show=false
fi
if $show || [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
verbose=true

Keybase proof

I hereby claim:

  • I am jivanpal on github.
  • I am jivan (https://keybase.io/jivan) on keybase.
  • I have a public key whose fingerprint is 493E 793B CD32 46B0 C952 D040 2A90 C01D C3E6 146E

To claim this, I am signing this object:

#!/bin/bash
debug=0
# Echo usage of this script to STDERR
usage() {
>&2 echo "Usage: $0 <file to compile> <output file>"
}
# Get a random MD5 hash with 128 bits of entropy
+------------------------------------------+-----------+------------+
| name | expansion | elo_rating |
+------------------------------------------+-----------+------------+
| Oko, Thief of Crowns | ELD | 1709 |
| Once Upon a Time | ELD | 1708 |
| Emry, Lurker of the Loch | ELD | 1707 |
| Questing Beast | ELD | 1699 |
| Gilded Goose | ELD | 1695 |
| Murderous Rider // Swift End | ELD | 1692 |
| Faeburrow Elder | ELD | 1678 |