Skip to content

Instantly share code, notes, and snippets.

@turgs
turgs / linux-setup.sh
Last active April 2, 2024 08:17 — forked from dhh/linux-setup.sh
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils

Keybase proof

I hereby claim:

  • I am turgs on github.
  • I am timburgan (https://keybase.io/timburgan) on keybase.
  • I have a public key ASC50q_kl6ohdUvZfuNCLGKq2N6JLYFXLs14LUg9T6kfXgo

To claim this, I am signing this object:

@turgs
turgs / BotBuster.md
Created April 25, 2017 09:53 — forked from hsiboy/BotBuster.md
Bot-Buster™ - Tracks nefarious activity on website, and manages accordingly.

#Bot-Buster™

Tracks nefarious activity on website, and manages accordingly.

##It's probably a bot.

If the requesting entity:

  • declares its user-agent as being wget, curl, webcopier etc - it's probably a bot.
  • requests details -> details -> details -> details ad nauseum - it's probably a bot.
  • requests the html, but not .css, .js or site furniture - it's probably a bot.
@turgs
turgs / Contract Killer 3.md
Created January 24, 2017 12:17
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@turgs
turgs / postgres
Created February 8, 2016 21:38 — forked from mmrwoods/postgres
Postgres maintenance crontab file
# dump all databases once every 24 hours
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night)
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze"
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet"
# re-index all databases once a week
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"'