Skip to content

Instantly share code, notes, and snippets.

@freyacodes
freyacodes / Dockerfile
Created October 19, 2018 23:57
Teamcity Java 11 agent
FROM jetbrains/teamcity-agent
RUN apt update && apt install wget && \
wget -c https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz && \
tar -xvf openjdk-11_linux-x64_bin.tar.gz && \
rm openjdk-11_linux-x64_bin.tar.gz && \
mkdir -p /usr/lib/jvm/jdk-11 && \
mv jdk-11*/* /usr/lib/jvm/jdk-11/ && \
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-11/bin/java" 1020 && \
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-11/bin/javac" 1020 && \
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && \
@ivanvanderbyl
ivanvanderbyl / gist:4222308
Created December 6, 2012 06:55
Postgres 9.1 to 9.2 upgrade guide for Ubuntu 12.04
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
@zealot128
zealot128 / README.md
Created August 13, 2012 21:15
Debian startup file for Rails thin instances

Rails startup with bundler, rvm and specific user

e.g. for user stefan, starting two different applications, located under /apps/APPLICATION/prod/current.

This script is very useful, because it is run at startup of server, so no 503 anymore.

Put this script under /etc/init.d/ and make it executable chmod +x /etc/init.d/rails_apps

@mikhailov
mikhailov / 0. nginx_setup.sh
Last active December 26, 2022 19:30
Nginx + secure pseudo-streaming
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz