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 / README.md
Created April 11, 2019 08:35 — forked from dnozay/README.md
Enable memberOf attribute on an openldap server.
@aduzsardi
aduzsardi / pem-split
Created July 26, 2019 08:22 — forked from jinnko/pem-split
Take a PEM format file as input and split out certs and keys into separate files.
#!/usr/bin/awk -f
#
# Take a PEM format file as input and split out certs and keys into separate files
#
BEGIN { n=0; cert=0; key=0; if ( ARGC < 2 ) { print "Usage: pem-split FILENAME"; exit 1 } }
/-----BEGIN PRIVATE KEY-----/ { key=1; cert=0 }
/-----BEGIN CERTIFICATE-----/ { cert=1; key=0 }
split_after == 1 { n++; split_after=0 }
/-----END CERTIFICATE-----/ { split_after=1 }
@aduzsardi
aduzsardi / modrewrite-htaccess
Created September 17, 2019 20:11 — forked from tsertkov/modrewrite-htaccess
Print mod_rewrite server variables using special mod_rewrite rules exporting internal variables via environment variables and PHP script printing there vars.
RewriteEngine On
# special mod_rewrite variables
RewriteRule .* - [E=MR_SPECIALS_API_VERSION:%{API_VERSION},NE]
RewriteRule .* - [E=MR_SPECIALS_THE_REQUEST:%{THE_REQUEST},NE]
RewriteRule .* - [E=MR_SPECIALS_REQUEST_URI:%{REQUEST_URI},NE]
RewriteRule .* - [E=MR_SPECIALS_REQUEST_FILENAME:%{REQUEST_FILENAME},NE]
RewriteRule .* - [E=MR_SPECIALS_IS_SUBREQ:%{IS_SUBREQ},NE]
RewriteRule .* - [E=MR_SPECIALS_HTTPS:%{HTTPS},NE]
@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;
}
@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 / 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 / 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 / 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 / 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 / .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/