Skip to content

Instantly share code, notes, and snippets.

View ronicthomas's full-sized avatar

Roni Thomas ronicthomas

View GitHub Profile
# Add postgres deb sources
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
# Add GPG key
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
# Update packages & details
sudo apt-get update
# Install postgres
sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 postgresql-contrib-9.6 -y
@ronicthomas
ronicthomas / get_volume_instance_association_data.py
Created June 20, 2020 20:34
(AWS) Python script to list volume associations and name of the instance to which it is attached. Assumes a single attachment only
import boto3
client = boto3.client('ec2')
paginator = client.get_paginator('describe_volumes')
pages = paginator.paginate()
for page in pages:
for volume in page['Volumes']:
instanceName = ''
# Install pre-requisites
sudo apt-get install freetds-common freetds-dev libct4 libsybdb5
sudo service gitlab stop
# Install postgres and create relevant users
sudo apt-get install -y postgresql postgresql-client libpq-dev postgresql-contrib
# Install pgloader CCL version. This is important since the SBCL version will max out at 4 GB of memory and migration will not complete
curl -sL -o /tmp/pgloader-ccl.sh https://raw.githubusercontent.com/opf/pgloader-ccl/master/buildpack/compile
bash /tmp/pgloader-ccl.sh