Skip to content

Instantly share code, notes, and snippets.

@andris9
andris9 / README.md
Last active December 29, 2022 02:38
Extremely simple HTTP proxy for changing Host: header Useful when proxying requests to virtual hosts that require Host: header to be set.

Setup reverse tunnel

Run the following in your client machine

ssh -R EXPOSED_PORT:localhost:SERVICE_PORT USER@HOST

Where

  • EXPOSED_PORT is the port exposed to the internet in the proxy server
  • SERVICE_PORT is the port your application is listening in your machine
@zxdcm
zxdcm / gist:069deadf53ed04990d9f34e73a49c276
Last active November 23, 2020 21:35
Networks, HTTP, DNS, and so on
Proxy may return info from cache!!
Forward proxy (for client)
Reverse proxy (for server, service)
(можно на отдельный сервер вынести отправку статического контента,
как раз reverse proxy)
CDN - Content Delivery Network
Proxy may return info from cache
GUIDs hurt performance of inserts.
Relational databases use B+ tree structure to store data.
If data coming in is not ordered, then a lot of IO work is required to rearrange the leafs.
GUIDs are random, so they may lead to heavy performance drawbacks, especially with large tables.
Database generated integers may hurt performance of inserts as well but for another reason.
When a database generates a new auto-incremented value for a primary key, it takes a lock to avoid race conditions.
It causes a performance issue that shows up in scenarios with multithread or bulk inserts.
IF EXISTS (SELECT * FROM dbo.Ids WHERE EntityId = @EntityId)