Skip to content

Instantly share code, notes, and snippets.

@jmprusi
jmprusi / install-openresty-centos.sh
Last active June 10, 2020 07:43
Install openresty on centos.
cat <<'EOF' > /etc/yum.repos.d/OpenResty.repo
[openresty]
name=Official OpenResty Repository
baseurl=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/epel-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/pubkey.gpg
enabled=1
enabled_metadata=1
EOF
@jmprusi
jmprusi / keybase.md
Created April 11, 2016 21:25
keybase.md

Keybase proof

I hereby claim:

  • I am jmprusi on github.
  • I am jmprusi (https://keybase.io/jmprusi) on keybase.
  • I have a public key whose fingerprint is B379 0DFF 9A49 892B 985C 9404 9094 2DAD BED6 DBFE

To claim this, I am signing this object:

@jmprusi
jmprusi / main.go
Last active September 15, 2015 10:20
Simple pool worker example
package main
import (
"fmt"
"math"
)
func isPrime(n float64) bool {
max := int(math.Sqrt(n))
for i := 2; i < max; i++ {
@jmprusi
jmprusi / docker-log-gist.md
Last active September 14, 2015 13:44 — forked from afolarin/docker-log-gist.md
docker-logs
@jmprusi
jmprusi / README.md
Last active September 14, 2015 10:51 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@jmprusi
jmprusi / haproxy.conf
Last active August 29, 2015 14:21 — forked from nateware/haproxy.conf
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-487d4d55"
},
@jmprusi
jmprusi / keybase.md
Created May 16, 2014 11:46
keybase.md

Keybase proof

I hereby claim:

  • I am jmprusi on github.
  • I am jmprusi (https://keybase.io/jmprusi) on keybase.
  • I have a public key whose fingerprint is B386 7901 97FD 70F7 E3F7 F7BE BEE3 5769 104E BC89

To claim this, I am signing this object:

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

# HAProxy configuration - haproxy-db.cfg
##
## FRONTEND ##
##
# Load-balanced IPs for DB writes and reads
#
frontend db_write
bind 172.16.0.50:3306