Skip to content

Instantly share code, notes, and snippets.

View leetrout's full-sized avatar
🎸

Lee Trout leetrout

🎸
View GitHub Profile
@leetrout
leetrout / cloud-provider-migration.md
Created April 7, 2022 21:24
vidarh's cloud migration strategy

Originally from https://news.ycombinator.com/item?id=30945448 and I wanted a copy somewhere else:

Unfortunately not, but it's surprisingly straight-forward, apart from the database bit, but here's a bit more detail from memory. There are many ways of doing this and some will depend strongly on which tools you're comfortable with (e.g. nginx vs. haproxy vs. some other reverse proxy is largely down to which one you know best and/or already have in the mix) [Today I might have considered K8s, but this was before that was even a realistic option, but frankly even with K8s I'm not sure -- the setup in question was very simple to maintain]:

  • Set up haproxy, nginx or similar as reverse proxy and carefully decide if you can handle retries on failed queries. If you want true zero-downtime migration there's a challenge here in making sure you have a setup that lets you add and remove backends transparently. There are many ways of doing this of various complexity. I've tended to favour using dynamic dns updates for t
@leetrout
leetrout / since2010.md
Created March 3, 2022 16:18 — forked from shawwn/since2010.md
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?

@leetrout
leetrout / example.md
Created August 5, 2020 20:26
Markdown Diffs

The current code looks like this:

type Demo struct {
  Field        int
  AnotherField string
}

We actually need to track the Thing

@leetrout
leetrout / main-profile.go
Created July 9, 2020 01:14
Quick drop in profiler snippet for Go
// Rename your main func to _main and drop this in
func main() {
f, err := os.Create("trace_" + time.Now().Format("20060102150405"))
if err != nil {
panic(err)
}
trace.Start(f)
_main()
trace.Stop()
f.Close()
@leetrout
leetrout / custom_game_engines_small_study.md
Created April 25, 2020 01:51 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus

@leetrout
leetrout / .inputrc
Created March 20, 2020 00:52
arrow key partial completion in shells, irb, etc
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
@leetrout
leetrout / pitch.md
Created February 29, 2020 15:41
GoCon Canada

Elevator Pitch (300 chars)

How many requests per second does your application serve? Are you sure? This talk covers the basics of load testing Go applications with off the shelf tools. You will leave with practical knowledge to test your own applications. Stop lying about performance.

Description

Stop lying about the performance of your application! Learn about load testing. When working at a prior startup a customer asked if we could handle 10,000 to 20,000 requests per second. Could we? Sure. Maybe. Well, probably.

It turns out we could handle about 180 requests per second. The customer was OK with caching results to reach their goal but our Go application bottlenecked our progress. Before we made any changes we measured. And once we identified potential solutions we could benchmark as we made changes. We could confirm what did and did not work.

@leetrout
leetrout / docker-compose.yml
Created February 6, 2020 03:25
Reddit Syncthing
version: "3"
services:
nginx:
image: nginx:latest
container_name: nginx-0
networks:
- web
ports:
- "8000:80"
@leetrout
leetrout / example.sh
Created December 27, 2019 22:37
bash script directory
# https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"