Skip to content

Instantly share code, notes, and snippets.

View Locke23rus's full-sized avatar
🏠
Working from home

Kirill Nikitin Locke23rus

🏠
Working from home
View GitHub Profile
@mikhailov
mikhailov / gist:9639593
Last active September 24, 2024 11:28
Nginx S3 Proxy with caching
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 11, 2026 13:51
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@dkubb
dkubb / ssl.nginxconf
Last active April 11, 2019 03:56
Nginx SSL configuration (PFS, HSTS, SPDY, BREACH mitigation, FIPS compliant)
ssl_certificate cert.pem;
ssl_certificate_key cert.key.pem;
ssl_trusted_certificate cert.ca.pem;
ssl_dhparam cert.dh.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers FIPS@STRENGTH:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@Locke23rus
Locke23rus / output.txt
Created November 8, 2012 21:25
Profile booting of a big rails app
$ rbx -Xprofile -S rake environment
Thread 1: total running time: 274.836778401s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
------------------------------------------------------------
3.94 272.01 19.40 609565 0.03 0.45 Array#each
2.01 15.80 9.91 875396 0.01 0.02 Rubinius::IdentityMap#insert
1.68 8.28 8.28 1075 7.70 7.70 GC.collect_young
@shaliko
shaliko / h2russia.txt
Created September 12, 2012 11:05
Poetry
Пять самых клевых чуваков,
Которых нет милей и краше,
Пять гениальнейших умов,
Творят на Благо Эйч2Раша.
Вот Шалико - надежный друг,
В беде поможет всем вокруг,
Ему усталость не почем,
Он лидер и знаток во всем.
@torgeir
torgeir / install_redis_on_ubuntu.md
Last active August 30, 2024 08:37 — forked from lucasmazza/script.md
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@samaaron
samaaron / core.clj
Created December 11, 2011 00:04 — forked from deltam/core.clj
Overtone jingle bells
(ns overtone-chrismas.core
(:use [overtone.live]))
(definst beep [freq 440]
(let [env (env-gen (perc 0.1 0.2) :action FREE)]
(* env (sin-osc freq))))
; ドレミの周波数を定義
(def doremi {:none 0
:do :c3
@brianmario
brianmario / config.ru.rb
Created April 21, 2011 06:11
minimal rails3 app
# minimal rails3 app
require 'action_controller'
Router = ActionDispatch::Routing::RouteSet.new
Router.draw do
root :to => 'site#index'
end
class SiteController < ActionController::Metal
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@gus
gus / index.txt
Created November 30, 2009 21:55 — forked from toothrot/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from https://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation: