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


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 /
Last active November 28, 2023 09:38
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
View gist:5383877
# <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 /
Created June 19, 2012 08:08
This file is an Ubuntu init script for Unicorn
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
# Modified by
# based on by
## A sample /etc/unicorn/my_app.conf
mdesantis / unicorn.rake
Last active January 9, 2021 20:03
Rails tasks for managing unicorn server instances
View unicorn.rake
# Tasks for managing Unicorn instances of a Rails application.
# Compatible with Ruby >= 1.9.2 and Rails >= 2 .
# Unicorn signals:
namespace :unicorn do
class UnicornPIDError < StandardError; end
def rails_env
mdesantis / gems_list_without_versions.rb
Created September 14, 2011 21:03
Displaying installed gems without version numbers - in one line =)
View gems_list_without_versions.rb
#!/usr/bin/env ruby
puts `gem list`.split("\n").map{ |gem_with_version| gem_with_version[/^.*?(?= )/] }.join("\n")