Navigation Menu

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
@palkan
palkan / ac_streams_bench.rb
Created November 9, 2016 11:39
ActionCable Streaming Benchmark
# rubocop disable:all
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
@delameko
delameko / upgrade-postgres-9.5-to-9.6.md
Last active August 22, 2023 08:22 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@willurd
willurd / web-servers.md
Last active April 23, 2024 04:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/bin/bash
# <UDF name="HOSTNAME" Label="server hostname" default="linode"/>
# Update system
apt-get update
apt-get -y install aptitude
aptitude -y full-upgrade
# Setup needed packages for building Ruby
apt-get -y install gcc make git zlib1g-dev build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
@romaimperator
romaimperator / unicorn_init_script.sh
Created June 19, 2012 08:08
This file is an Ubuntu init script for Unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@mdesantis
mdesantis / unicorn.rake
Last active January 9, 2021 20:03
Rails tasks for managing unicorn server instances
# Tasks for managing Unicorn instances of a Rails application.
# Compatible with Ruby >= 1.9.2 and Rails >= 2 .
# Unicorn signals: http://unicorn.bogomips.org/SIGNALS.html
namespace :unicorn do
class UnicornPIDError < StandardError; end
def rails_env
Rails.env
@mdesantis
mdesantis / gems_list_without_versions.rb
Created September 14, 2011 21:03
Displaying installed gems without version numbers - in one line =)
#!/usr/bin/env ruby
puts `gem list`.split("\n").map{ |gem_with_version| gem_with_version[/^.*?(?= )/] }.join("\n")