Skip to content

Instantly share code, notes, and snippets.

View esdras's full-sized avatar

Esdras Mayrink esdras

View GitHub Profile
@esdras
esdras / Sentry-Install-Ubuntu-16-04
Created November 30, 2018 18:54 — forked from RabbitMC/Sentry-Install-Ubuntu-16-04
Setup sentry on Ubuntu 16.04 server
# Project: https://github.com/getsentry/sentry
# Doc: https://docs.getsentry.com/on-premise/server/installation/python/
udo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install libxslt1-dev
sudo apt-get install gcc
@esdras
esdras / install_sentry.sh
Created November 30, 2018 18:54 — forked from bjmc/install_sentry.sh
Basic setup script for installing Sentry (http://getsentry.com) + Redis on new Ubuntu 14.04 Amazon EC2 instance
#! /bin/bash
export RUN_AS='ubuntu';
export INSTALL_DIR='/var/www/sentry';
HOSTNAME='http://mysentry.example.com'; # No trailing slash
DB_HOST='something.rds.amazonaws.com';
DB_PORT='5432';
DB_USER='sentry';
DB_NAME='sentry';
DB_PASSWORD='DB_PASSWORD';
@esdras
esdras / network-tweak.md
Created April 27, 2018 20:35 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@esdras
esdras / run phoenix on amazon linux.sh
Last active November 14, 2016 23:05 — forked from eikes/run phoenix on amazon linux.sh
run phoenix on amazon linux
# app deps
sudo yum update -y
# utf8 all the things
echo '
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
' >> ~/.bashrc
@esdras
esdras / config.ex
Created September 10, 2016 18:36 — forked from bitwalker/config.ex
Useful config wrapper for Elixir
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@doc """
Fetches a value from the config, or from the environment if {:system, "VAR"}
is provided.
An optional default value can be provided if desired.
@esdras
esdras / Main.elm
Created March 24, 2016 23:06 — forked from robinheghan/Main.elm
AWS Lambda Elm
module Main where
import Signal
type alias Message =
{ operation : String
, message : String
}
@esdras
esdras / install-redis.sh
Last active August 29, 2015 14:26 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/esdras/5d1f13fa37073ce23f3f/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@esdras
esdras / bin-cc.md
Last active August 29, 2015 14:21 — forked from erikhenrique/bin-cc.md

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING
module SingleRecipientSmtp
def self.included(clazz)
clazz.class_eval do
cattr_accessor :single_recipient_smtp_settings
end
end
def perform_delivery_single_recipient_smtp(mail)
mail.to = single_recipient_smtp_settings[:to]
mail.cc = nil