Skip to content

Instantly share code, notes, and snippets.

View aduzsardi's full-sized avatar
🛠️
d(0_0)b

Alexandru Duzsardi aduzsardi

🛠️
d(0_0)b
View GitHub Profile
@aduzsardi
aduzsardi / nginx.conf
Created April 1, 2020 12:51 — forked from amitsaha/nginx.conf
nginx conf + geoip2
# blog post: https://echorand.me/nginx-and-geoip2.html
worker_processes auto;
daemon off;
error_log /dev/stdout warn;
include /etc/nginx/modules/*.conf;
load_module modules/ngx_http_geoip2_module.so;
events {
}
@aduzsardi
aduzsardi / letsencrypt_2017.md
Created March 17, 2020 09:56 — forked from leeoniya/letsencrypt_2017.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@aduzsardi
aduzsardi / .gitlab-ci.yml
Created February 27, 2020 14:52 — forked from prog/.gitlab-ci.yml
How to use composer (php) including cache with gitlab-ci
build:install-vendor:
stage: build
image: <any-image-with-composer>
before_script:
- composer config -g cache-dir "$(pwd)/.composer-cache"
script:
- composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
cache:
paths:
- .composer-cache/
@aduzsardi
aduzsardi / drupal-nginx-virtualhost.conf
Last active February 24, 2020 16:28 — forked from Mulkave/drupal-nginx-virtualhost.conf
drupal virtual host configuration for Nginx
# https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
server {
server_name example.com;
root /var/www/drupal8; ## <-- Your only path reference.
location = /favicon.ico {
log_not_found off;
access_log off;
}
@aduzsardi
aduzsardi / inlets-configuration.md
Last active February 19, 2020 09:39
Hosting an inlets http(s) tunnel

Requirements

  • A server with a public IP
  • A domain that can be used for proxying - best if you have a separate domain just for inlets
  • A wildcard SSL/TLS certificate
  • A webserver - i'm using nginx but other servers would work as well (caddy,apache,etc)

The steps should be similar with any hosting services, adapt it to your own

1. Domain configuration

Start with this step since we'll need it for every other step

@aduzsardi
aduzsardi / Readme.md
Created January 24, 2020 13:38 — forked from CampinCarl/Readme.md
OpenVPN-GUI Replace Windows System Tray Icons

OpenVPN-GUI Replace Windows System Tray Icons

As of this writing, the OpenVPN-GUI system tray icon is very similar to the Windows 10 wired network icon, making it difficult to distinguish the two at a glance. This gist provides color swapped versions of the default OpenVPN icon to match the three (3) connection states, i.e., disconnected, connecting, and connected.

![Icons]

Using a resource editor, the user can modify their copy of the

@aduzsardi
aduzsardi / slack_slash_cmd.py
Created December 3, 2019 12:29 — forked from devStepsize/slack_slash_cmd.py
Server-side logic to handle a Slack slash command using Python and Flask
'''
This is an example of the server-side logic to handle slash commands in
Python with Flask.
Detailed documentation of Slack slash commands:
https://api.slack.com/slash-commands
Slash commands style guide:
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c
'''
@aduzsardi
aduzsardi / mailhog-install.md
Created October 10, 2019 08:40 — forked from viktorpetryk/mailhog-install.md
MailHog installation on Ubuntu

Install & Configure MailHog

  1. Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
  1. Make MailHog as a service
@aduzsardi
aduzsardi / access.lua
Created September 30, 2019 09:33 — forked from crisidev/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@aduzsardi
aduzsardi / apt.conf
Created September 27, 2019 09:47 — forked from zedtux/apt.conf
Nginx configuration for reprepro
server {
listen *:80;
server_name repository.votre-serveur.com;
server_tokens off;
root /srv/reprepro;
autoindex on; # Permet de voir les fichiers. Commentez la ligne pour l'interdire.
access_log /var/log/nginx/repository.votre-serveur.com_access.log;
error_log /var/log/nginx/repository.votre-serveur.com_error.log;
}