Skip to content

Instantly share code, notes, and snippets.

View mdesantis's full-sized avatar
🐧
Linux forever

Maurizio De Santis mdesantis

🐧
Linux forever
  • Treatwell
  • Taranto, Italy
View GitHub Profile
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active October 11, 2021 08:11 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
# Hack to change the Rails cookie serializer from Marshal to JSON and therefore allow the session
# to be shared between different languages but also avoid that someone knowing the
# cookie secret key could execute arbitrary code on the server by unmarshalling
# modified Ruby code added to the session/permanent cookie.
#
# Note that all users will beed to login again since both the remember me cookie and the session cookies
# won't be valid. Note also that the remember me cookie is tested multiple times per request even when it fails.
# for performance reasons you might want to delete it if these extra cycles are too costly for you.
#
# Rails 4 (not tested on Rails 3).
@mdesantis
mdesantis / unicorn_init_script.sh
Last active March 21, 2018 13:18 — forked from romaimperator/unicorn_init_script.sh
Unicorn init script; it uses start-stop-daemon and supports every Ruby version manager (RVM, rbenv, chruby...)
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn instances
# Description: starts the unicorn server instances using start-stop-daemon
#