Skip to content

Instantly share code, notes, and snippets.

View notes.txt
The command to run tests: `python3 -m unittest stream_tests.py`
Notes:
1. It took ~1 hour for task implementing and writing notes.
2. The project was completed with TDD technology, tests first.
3. I didn't implement any limiters, like input string size or stream maximum size limiters. I assumed that these limiters were outside of the task scope.
4. I spent some time deciding what better to use for string parsing, regex, or simple cycle iteration. In the end, the cycle was preferred because of better readability.
5. It wasn't clear from requirements what exactly filter by date should be implemented, so I implemented `get_latest_events_created_after_date()` method.
@Nihisil
Nihisil / benchmark+go+nginx.md
Created Jan 19, 2016 — forked from hgfischer/benchmark+go+nginx.md
Benchmarking Nginx with Go
View benchmark+go+nginx.md

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
@Nihisil
Nihisil / jail.local
Last active Apr 21, 2020
Send notifications to the Slack from fail2ban
View jail.local
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
You can’t perform that action at this time.