Skip to content

Instantly share code, notes, and snippets.

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

Thiago Dantas tdantas

🏠
Working from home
View GitHub Profile
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';
@tdantas
tdantas / chef-install.sh
Last active December 16, 2015 12:39
Chef Installer curl - Ubuntu
#!/usr/bin/env bash
apt-get -y update
apt-get -y install libreadline6-dev build-essential libyaml-dev zlib1g-dev libssl-dev
apt-get -y install ruby1.9.3
apt-get -y install ruby1.9.1-dev
gem install chef --no-ri --no-rdoc
@tdantas
tdantas / backup
Last active December 17, 2015 06:09
mysql backup instructions debian squeeze
$ sudo innobackupex --user=USER --password=PASSWORD PATH_TO_BACKUP_DIR
@tdantas
tdantas / ccs.md
Last active April 15, 2020 22:18
capybara cheat sheet

Copy from capybara's github page

Navigating

visit('/projects')  

Clicking links and buttons

click_link('id-of-link')  
click_link('Link Text')  
click_button('Save')  

click('Link Text') # Click either a link or a button

@tdantas
tdantas / HOWTO.md
Last active July 5, 2023 20:43
Too Many Connections Postgresql ( HomeBrew Installation)

HOWTO avoid 'too many connections'


Ask postgresql where is the configuration file

$ psql postgres
 psql (9.2.2)
   Type "help" for help.
@tdantas
tdantas / virtual.conf
Created July 24, 2013 19:37
apache ssl recipe configuration for our rails configuration
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
#ServerAlias *.domain.com
RailsBaseURI /join
<Directory /join>
Options -MultiViews
@tdantas
tdantas / recipe.md
Created July 26, 2013 17:07
Openssl recipes pkcs7 to x509

#HTTPS SSL Apache

We received 2 files.

  • PKCS7
  • Intermediate.crt

###How to extract X.509 from PKCS7 ?

@tdantas
tdantas / output
Last active May 6, 2019 01:46
Fiber Ruby
$ ruby poc_fiber.rb
"hello"
"world"
@tdantas
tdantas / yaml_json_superset.rb
Last active December 22, 2015 01:38
YAML Ruby
#!/usr/bin/env ruby
%w(yaml ap).each { |dep| require dep }
obj = YAML::load(DATA)
puts "-" * 30
ap obj['firstName']
puts "-" * 30