Skip to content

Instantly share code, notes, and snippets.

@wujku
wujku / traefik-auth.conf
Created March 6, 2021 12:56 — forked from acundari/traefik-auth.conf
Traefik fail2ban
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$
location /api {
rewrite ^/api/(.*) /rest/V1/custom_resource/$1 break;
proxy_pass $scheme://127.0.0.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@wujku
wujku / nginx_uri_map.conf
Created April 3, 2020 12:30
URI mapping with nginx
# example.local/blog?query=code -> example.local/news?query=code
# example.local/blog/?query=code -> example.local/news?query=code
map $uri $new_uri {
/blog /news;
/test /demo;
}
server {
listen 80;
@wujku
wujku / nginx_cookie_restriction.conf
Created April 2, 2020 07:47
nginx authorization with cookie (Staging servers)
@wujku
wujku / Description.md
Created February 4, 2020 12:29 — forked from blakethepatton/Description.md
Getting Mailhog running on a dev server (nginx, letsencrypt, ssl, ubuntu)

Get it running as a service

wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64

mv MailHog_linux_amd64 mailhog

chmod +x mailhog

sudo vi /etc/systemd/system/mailhog.service

LOAD DATA LOCAL INFILE '/tmp/example.csv'
-> INTO TABLE example
-> FIELDS TERMINATED BY ','
-> LINES TERMINATED BY '\n'
-> IGNORE 1 LINES
-> (id, Column3,Column4, @Column5)
-> set
-> Column5 = str_to_date(@Column5, '%m/%d/%Y');
@wujku
wujku / message-id.php
Created October 30, 2017 19:54 — forked from Robbert/message-id.php
Message-ID generator in PHP for mail headers.
<?php
/**
* @see http://www.jwz.org/doc/mid.html
*/
function generateMessageID()
{
return sprintf(
"<%s.%s@%s>",
base_convert(microtime(), 10, 36),

Keybase proof

I hereby claim:

  • I am wujku on github.
  • I am wujku (https://keybase.io/wujku) on keybase.
  • I have a public key ASDtMq74PLAxRor1Izi69Cdi4NscWpjybl6EgNE1LSn6qgo

To claim this, I am signing this object:

#!/usr/bin/env bash
# Usage: repository=repository_name.git worktree=/home/user/domains/domain.name gitlab_deployment_configuration.sh
if [ -z ${repository+x} ]; then repository=gitlab.git; fi
if [ -z ${worktree+x} ]; then worktree=/home/ubuntu/domains/domain.name; fi
# create git --bare repository
git init --bare ${repository}