Skip to content

Instantly share code, notes, and snippets.

View plentz's full-sized avatar

Diego Plentz plentz

View GitHub Profile
@plentz
plentz / nginx.conf
Last active May 10, 2024 03:20
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

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

@plentz
plentz / air_quality.md
Last active November 26, 2023 22:15
air quality

I’ve been obsessing interested in air quality for the last 2 months (pretty much because I saw that famous DHH talk and the Awair Element gamify it - but I highly recommend it to check if the changes you’re making are actually working). Here are a few things to consider:

  • I recommend getting a ultrasonic one just because the maintenance is just way easier. And your should REALLY think about maintenance (you don't want a filter you need to change filters every month and have a hard time cleaning it). The ones I recommend are:
    • Levoit ultrasonic 300S: huge 6L tank, good for bedrooms and smaller rooms, super easy to fill and clean. Works with Alexa and Google.
  • Levoit ultrasonic LV600S: huge 6L tank, generates a lot of umidity, ideal for bigger rooms, dece
@plentz
plentz / ladder.md
Created October 28, 2015 15:50 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@plentz
plentz / podcasts.md
Last active August 6, 2020 18:17
podcasts
  • 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
instalar counter strike source no mac (multiplayer working):
- baixar counter strike source cider port(eu baixei do demonoid http://www.demonoid.com/files/details/1897279/51062454/ 3.13gb)
- baixar http://css.setti.info/servers/masterserver/
- control+click no ícone do Counter Strike depois de montar o dmg >"Show Contents"
- entra em Contents>Resources>Transgaming>c_drive>program Files>css>platform>config
- renomear o MasterServers.vdf pra MasterServers.vdf_bkp (se quiser restaurar depois)
- copiar o arquivo de servers(MasterServers.vdf) que vc fez download para essa pasta
- command+i com o MasterServers.vdf selecionado e altera pra readonly o arquivo (se não o jogo altera para os servers da Valve)
- have fun :)

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 / gist:5630854
Created May 22, 2013 20:59
gdb output of segfault while running sidekiq @ ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
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
Thread 138 (Thread 0x2aaad4302940 (LWP 11624)):
+ 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
# 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'