Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Sergej Müller sergejmueller

View GitHub Profile
@sergejmueller
sergejmueller / ttf2woff2.md
Last active Apr 1, 2019
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
View ttf2woff2.md
@sergejmueller
sergejmueller / BucketPolicy.json
Last active Feb 23, 2019
AWS S3 Bucket Policy to protect a bucket web access by IP (Range)
View BucketPolicy.json
{
"Version": "2012-10-17",
"Id": "Policy1550216993456",
"Statement": [
{
"Sid": "Stmt1550216977234",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-site/*",
@sergejmueller
sergejmueller / Cloudinary.php
Created Feb 16, 2019
Picture upload to Cloudinary without bloated Cloudinary PHP-SDK.
View Cloudinary.php
<?php
// Cloudinary API
define('CLOUDINARY_API_KEY', 'XXXXXXXX');
define('CLOUDINARY_SECRET_KEY', 'XXXXXXXX');
define('CLOUDINARY_API_URL', 'https://api.cloudinary.com/v1_1/XXXXXXXX/image/upload');
// Image handling
$path = 'picture.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
@sergejmueller
sergejmueller / gist:088dce028b6dd120a16e
Last active Jan 28, 2019
mozjpeg vs. libjpeg-turbo – Output File Size and Execution Time
View gist:088dce028b6dd120a16e

Lossless and progressive optimization of multiple (random picked, less than 1 MB) JPEG images with mozjpeg 2.0 and libjpeg-turbo.

Original Size mozjpeg Size libjpeg-turbo Size mozjpeg Speed libjpeg-turbo Speed
621 KB 612 KB 615 KB 0.658 s 0.297 s
505 KB 475 KB 477 KB 0.481 s 0.204 s
391 KB 376 KB 385 KB 0.846 s 0.441 s
888 KB 780 KB 794 KB 0.786 s 0.346 s
700 KB 668 KB 670 KB 0.765 s 0.320 s
@sergejmueller
sergejmueller / comodo.pem
Created Feb 13, 2015
OCSP stapling PEM file for Comodo certificates used on Nginx.
View comodo.pem
-----BEGIN CERTIFICATE-----
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEy
MDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
Q09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZh
bGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9AdDTScBkxwtiBUUWOqigwAwCfx3M28Sh
@sergejmueller
sergejmueller / functions.php
Last active Dec 6, 2018
WordPress: Disable Post-by-Email configuration and functionality
View functions.php
<?php
add_filter('enable_post_by_email_configuration', '__return_false');
@sergejmueller
sergejmueller / .htaccess
Created Aug 10, 2012
Auszug aus einer .htaccess mit Caching-Mechanismen
View .htaccess
# CHARSET
AddDefaultCharset utf-8
# DEFLATE
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
AddOutputFilterByType DEFLATE application/javascript application/json
AddOutputFilterByType DEFLATE text/xml application/xml
AddOutputFilterByType DEFLATE application/rss+xml application/atom+xml
@sergejmueller
sergejmueller / mime.types
Created Nov 27, 2013
Nginx: Detecting WebP support with Header Vary Accept. Filename format: image.jpeg / image.webp
View mime.types
...
image/webp webp;
...
@sergejmueller
sergejmueller / nginx.conf
Last active Oct 8, 2018
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
View nginx.conf
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@sergejmueller
sergejmueller / ip-blacklist.conf
Last active Sep 28, 2018
Fail2Ban-Konfiguration für die manuelle Sperrung bestimmter IP-Adressen. Weitere Informationen unter https://github.com/sergejmueller/sergejmueller.github.io/wiki/Fail2Ban:-IP-Firewall
View ip-blacklist.conf
# Fail2Ban configuration file
#
# List of blocked ip addresses
#
# Server: Nginx
# Author: Sergej Müller
#
# File path: /etc/fail2ban/filter.d/ip-blacklist.conf
You can’t perform that action at this time.