Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / setenv.sh
Created May 23, 2011 00:07
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@rye
rye / vomit.ru
Last active January 30, 2017 11:38
A Ruby web server to act like Python's SimpleHTTPServer module.
#!/usr/bin/env rackup
#\ -E deployment
use Rack::ContentLength
app = Rack::Directory.new Dir.pwd
run app
@rabbitt
rabbitt / schema_clone.py
Last active October 8, 2020 12:56
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT
@diniremix
diniremix / dockersetup.MD
Last active September 22, 2016 14:16
setup docker on elementary OS freya

instalar docker

instalar una imagen (ubuntu 14.04 en este caso)

  • sudo docker run ubuntu:14.04

revisar las imagenes instaladas

  • sudo docker images

entrar en la imagen recien creada

Crystal vs Node.js Websocket Benchmark

Crystal 0.9.1 with Kemal

require "kemal"

ws "/" do |socket|
  socket.on_message do |message|
 end
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@enricostano
enricostano / shift_register.rs
Last active May 13, 2016 14:01
Playing with shift registers with Rust + ARMv7 + GPIO
extern crate sysfs_gpio;
use sysfs_gpio::{Direction,Pin};
use std::time::Duration;
use std::thread::sleep;
fn main() {
let data_pin = Pin::new(18); // SER #14
let latch_pin = Pin::new(23); // RCLK #12
let clock_pin = Pin::new(24); // SRCLK #11
@strzibny
strzibny / unused_routes.rb
Created May 5, 2016 15:21
Find unused routes in Rails
#!/usr/bin/env ruby
# Extracted from traceroute gem + checking the presence of views as well
require_relative './config/environment.rb'
class Traceroute
def initialize(app)
@app = app
end
@funzoneq
funzoneq / simplehttp.service
Created May 25, 2016 13:24
A systemd file for a python SimpleHTTPServer
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
[Service]
Type=simple
WorkingDirectory=/tmp/letsencrypt
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`
@thaJeztah
thaJeztah / index.md
Last active January 8, 2024 12:06
Ubuntu or Alpine? A quick comparison

Ubuntu ... or Alpine? A quick comparison

Let's see how they compare with a minimal example: run an image that installs curl and pulls the Holberton homepage

Ubuntu

Pull the ubuntu:16.04 image