Skip to content

Instantly share code, notes, and snippets.

View KostyaEsmukov's full-sized avatar
🔥
Maybe we just wanna watch the world burn

Kostya Esmukov KostyaEsmukov

🔥
Maybe we just wanna watch the world burn
View GitHub Profile
@KostyaEsmukov
KostyaEsmukov / _ express-redirect-platform-location.md
Last active October 20, 2023 20:55
HTTP redirects with Angular SSR

HTTP redirects with Angular Server Side Rendering

This service assumes that you followed the SSR receipt at ng-cli (i.e. you use the '@nguniversal/express-engine' package).

@KostyaEsmukov
KostyaEsmukov / Readme.md
Created February 9, 2017 19:02
Fix for angular-universal 2.1.0-rc.1 [hidden] issue

Fix for the angular-universal 2.1.0-rc.1 [hidden] issue

Issue: angular/universal#612
Fix: angular/universal#629

How to use this patch:

Create the __patch.node.hidden.ts file and import it right after the polyfills.

Squid3 in docker as caching proxy

Handy to speedup your CI builds.

Configuration

# create a directory for files cache
mkdir -p /var/yourproject/squid/spool

mkdir -p /etc/yourproject/squid/

Create a swapfile on Linux

dd if=/dev/zero of=/var/swapfile bs=1M count=2048
chmod 0600 /var/swapfile
mkswap /var/swapfile

swapon /var/swapfile

echo >> /etc/fstab

echo "/var/swapfile none swap sw 0 0" >> /etc/fstab

@KostyaEsmukov
KostyaEsmukov / _ zabbix_telegram_notifications.md
Last active November 26, 2021 09:02
Zabbix alerts via Telegram

Zabbix alerts via Telegram

⚠️ Deprecated: Zabbix now includes official support for Telegram media, see https://www.zabbix.com/integrations/telegram.

Replace my_zabbix_bot and My Zabbix Bot below with your own names.

Create and test telegram bot

Add @BotFather contact in Telegram and press 'start',
then type:

#! /bin/sh
#
# Modified script from https://www.zabbix.org/wiki/Docs/howto/ssl_certificate_check
# which is able to check multiple hosts at once.
#
# Define a host macros like {$SNI} => 'domain1.com,domain2.com'
#
# Kostya Esmukov <[email protected]>
#
@KostyaEsmukov
KostyaEsmukov / _ letsencrypt_in_docker_with_nginx.md
Last active December 10, 2017 07:29
A recipe to get letsencrypt running in docker in couple with nginx

Let's Encrypt in docker with nginx

Replace myproject and domain.com in the commands below to your needs.

# This folder will contain actual certificates and account data
mkdir -p /etc/myproject/letsencrypt/

# This folder will contain authentication files created by webroot plugin of the certbot

mkdir -p /var/myproject/letsencrypt/

@KostyaEsmukov
KostyaEsmukov / _nginx_docker_config.md
Last active July 14, 2024 04:52
Nginx configuration sample for docker

Nginx production configuration sample

This config assumes that nginx is run from docker image _/nginx.

docker commands

docker network create nginx

mkdir -p /etc/myproject/nginx

cd /etc/myproject/nginx

@KostyaEsmukov
KostyaEsmukov / _ nginx_proxy_gzipped_response.md
Created August 20, 2016 09:40
Setup of two nginx servers, where traffic between upstream and balancer is gzipped.

Nginx proxy gzipped response

+-------+ +---------> +-----+ +---------> +--------+
|browser|             |proxy|             |upstream|
+-------+ <---------+ +-----+ <---------+ +--------+
            gzipped            !gzipped!