Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
Linux forever

Maurizio De Santis mdesantis

🐧
Linux forever
  • Treatwell
  • Taranto, Italy
View GitHub Profile
@palkan
palkan / ac_streams_bench.rb
Created Nov 9, 2016
ActionCable Streaming Benchmark
View ac_streams_bench.rb
# 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 Sep 9, 2022 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04
View upgrade-postgres-9.5-to-9.6.md

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 Nov 27, 2022
Big list of http static server one-liners
View web-servers.md

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
#!/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 Jun 19, 2012
This file is an Ubuntu init script for Unicorn
View unicorn_init_script.sh
#!/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 Jan 9, 2021
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: 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 Sep 14, 2011
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")