Skip to content

Instantly share code, notes, and snippets.

@nguyen127001
nguyen127001 / root-password-MariaDB-docker-compose.md
Created April 8, 2021 17:54 — forked from rordi/root-password-MariaDB-docker-compose.md
Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack:

$> docker-compose up -d

Then login to the Docker container:

@nguyen127001
nguyen127001 / example.com
Created October 9, 2020 12:47 — forked from 1hakr/example.com
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active June 3, 2025 21:33
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@kekru
kekru / 01nginx-tls-sni.md
Last active June 2, 2025 07:15
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@mikepfeiffer
mikepfeiffer / stress.sh
Created January 27, 2019 21:05
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
@hossambarakat
hossambarakat / cross-namespace-ingress.md
Created January 25, 2019 12:25
Kubernestes Cross Namespace Ingress

Example

This is simple example showing:

  • Service service-alpha in service-alpha namespace
  • Service service-beta in service-beta namespace
  • Nginx Ingress controller in kube-ingress namespace
  • Ingress called ingress-demo inside service-alpha namespace
  • Ingress called ingress-demo inside service-beta namespace

Steps:

  • Install ingress on AKS. my demo cluster does not have rbac enabled that's why there is => --set rbac.create=false
@eliashussary
eliashussary / metabase-postgres.docker-compose.yml
Created December 11, 2018 16:45
A docker-compose file for metabase with postgres.
version: "3"
services:
postgres-db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: postgres
@hvnsweeting
hvnsweeting / inode_hardlink_softlink.md
Last active November 6, 2019 02:10
inode và hardlink vs symlink
@1hakr
1hakr / example.com
Last active November 29, 2024 20:48
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@bzamecnik
bzamecnik / wordpress_com_nginx_proxy_to_subpath.md
Created June 21, 2018 12:48
Nginx proxy for Wordpress.com on custom domain with subpath.