Skip to content

Instantly share code, notes, and snippets.

Avatar

Diego Plentz plentz

View GitHub Profile
View canada_money.md

TFSA

dinheiro pos-tax mas com rendimento tax-free. tem limite anual de 6000 em deposito (desde que tu se mudou pro canada - no wealth simple tem um wizard que calcula pra ti). tu pode sacar o dinheiro e o limite volta de novo no ano seguinte. Se tu não usar, o limite continua aumentando. ex, se passar 3 anos sem colocar dinheiro, pode colocar 18k no 3o ano. se sacar 5k, no ano seguinte vai poder depositar 11k (6K do limite novo + 5k do saque) Quando saca não paga imposto at all bem no-brainer colocar dinheiro no TFSA e maximizar o quanto antes.

RRSP

pode colocar 18% do rendimento do ano anterior, até o limite de 27230 (em 2020, isso varia ano a ano). o dinheiro que é colocado lá é tax free, bem como o rendimento. o que quer dizer que o que tu colocar lá, recebe o imposto pago pelo dinheiro no imposto de renda do ano seguinte. Cenario: colocou 10k no RRSP, com renda de 100k / ano. no ano seguinte quando declarar imposto é como se tua renda tivesse side de 90k pra fims de imposto e o imposto pago nos 1

View podcasts.md
  • hipsters.tech
  • like a boss
  • gimlet startup podcasts (recomendação do pcalcado)
  • masters of scale (recomendação do pcalcado)
  • revisionist history (recomendação do bzanchet)
  • dtr (podcast do tinder)
  • we are netflix

parei de ouvir:

  • 99% invisible
@plentz
plentz / ladder.md
Created Oct 28, 2015 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
View recover_opsworks_sg.sh
#!/bin/sh
# creating security groups
ec2-create-group 'AWS-OpsWorks-Web-Server' -d 'AWS OpsWorks Web server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Default-Server' -d 'AWS OpsWorks Default server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Blank-Server' -d 'AWS OpsWorks blank server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-LB-Server' -d 'AWS OpsWorks load balancer - do not change or delete'
ec2-create-group 'AWS-OpsWorks-PHP-App-Server' -d 'AWS OpsWorks PHP-App server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-DB-Master-Server' -d 'AWS OpsWorks database master server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Memcached-Server' -d 'AWS OpsWorks Memcached server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Monitoring-Master-Server' -d 'AWS OpsWorks Monitoring Ganglia server - do not change or delete'
View default.rb
include_recipe "logrotate"
logrotate_app "tomcat" do
cookbook "logrotate"
path "/var/log/tomcat/catalina.out"
options ["copytruncate", "missingok", "notifempty"]
frequency "daily"
rotate 3
create "644 tomcat tomcat"
size "50M"
View elastic_beanstalk_external_sessions.md

Session Management in an Autoscaling Environment

Problem Statement

User sessions in J2EE and LAMP stacks have traditionally been handled in memory by the application server handling the user request. Because of that, load balancers have been configured to use sticky sessions. By sticky sessions we mean that once the user has visited the site, they will be assigned an app server and will return to that server for subsequent requests. The load balancers typically handle that by referencing the users session cookie.

Elastic cloud environments differ from traditional server configurations in that they have a variable number of servers based on traffic loads whereas traditional configurations had a fixed number of servers. When traffic volumes decline it is necessary to vaporize servers. In doing so, we would lose user sessions (essentially forcing a logout) unless we come up with a new strategy for session management.

A new approach

After much research, it is clear that the best

@plentz
plentz / nginx.conf
Last active Aug 11, 2020
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@plentz
plentz / gist:5630854
Created May 22, 2013
gdb output of segfault while running sidekiq @ ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
View gist:5630854
This file has been truncated, but you can view the full file.
...
[Thread 0x2aaad4201940 (LWP 11770) exited]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2aaac6464940 (LWP 11237)]
vm_exec_core (th=0x83ba000, initial=0) at vm_exec.c:35
35 {
(gdb) t a a bt
View 135.log
+ jruby -S -Xdebug.loadService.timing=true rake db:migrate db:test:prepare
2012-12-13T14:07:09.652-02:00: LoadService: -> jruby
2012-12-13T14:07:09.727-02:00: LoadService: -> java
2012-12-13T14:07:09.812-02:00: LoadService: -> jruby/java
2012-12-13T14:07:09.935-02:00: LoadService: -> jruby/java/java_module
2012-12-13T14:07:09.957-02:00: LoadService: <- jruby/java/java_module - 21ms
2012-12-13T14:07:09.957-02:00: LoadService: -> jruby/java/java_package_module_template
2012-12-13T14:07:09.970-02:00: LoadService: <- jruby/java/java_package_module_template - 13ms
2012-12-13T14:07:09.970-02:00: LoadService: -> jruby/java/java_utilities
2012-12-13T14:07:09.983-02:00: LoadService: <- jruby/java/java_utilities - 13ms
View Gemfile.rb
# this don't work (bundler don't support nested platform/grouping https://github.com/carlhuda/bundler/issues/1298)
group :development, :test do
gem 'pg', :platforms => :ruby
gem 'activerecord-jdbcpostgresql-adapter', :platforms => :jruby
end
# you should do something like this
group :development, :test do
gem 'pg' if RUBY_PLATFORM != 'java'
gem 'activerecord-jdbcpostgresql-adapter' if RUBY_PLATFORM == 'java'
You can’t perform that action at this time.