Skip to content

Instantly share code, notes, and snippets.

:octocat:

Sergej Müller sergejmueller

:octocat:
  • Hamburg, Germany
Block or report user

Report or block sergejmueller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / index.html
Created Mar 5, 2018
Detect mobile device
View index.html
<script>
"use strict";
class inputCapture {
constructor(id, style) {
this.id = id
this.style = style
this.element = null
}
@sergejmueller
sergejmueller / selfpv_energy.ino
Created May 3, 2017
ESP8266 + SSD1306 ♥ FRITZ!Box API
View selfpv_energy.ino
/*
* ESP8266 + SSD1306 ♥ FRITZ!Box API
*
* Ausgabe der aktuell über die FRITZ!DECT 200 Steckdose
* entnommenen Leistung als Prozentwert auf einem SSD1306 OLED Display.
* Praxisbeispiel: Durch die Solaranlage eingespeiste Leistung abrufen
* und auf dem OLED Display in Form eines Prozentwertes einblenden.
*
* Referenzen:
* http://www.instructables.com/id/Wemos-D1-Mini-096-SSD1306-OLED-Display-Using-SPI/
@sergejmueller
sergejmueller / Preferences.sublime-settings
Last active Dec 5, 2016
Preferences.sublime-settings
View Preferences.sublime-settings
{
"caret_extra_width": 1,
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Ocean.tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
@sergejmueller
sergejmueller / wpcheck.md
Last active Mar 8, 2018
wpcheck – Sicherheitsscanner für WordPress
View wpcheck.md

wpcheck – Sicherheitsscanner für WordPress

Einige von euch haben es bereits mitbekommen: Seit einigen Monaten arbeite ich an einem Sicherheitsscanner für WordPress. Jetzt zu WordCamp Frankfurt 2016 möchte ich die Öffentlichkeit auf die stabile, jedoch keineswegs finale Version des Tools hinweisen:

Nicht final aus dem Grund, weil der Scanner um unendlich viele Funktionen vervollständigt werden kann. Das muss aber nicht unbedingt im Kern der Anwendung geschehen. Dank der modularen Bauweise kann der Funktionsausbau durch Drittentwickler erfolgen.

Ideologie

@sergejmueller
sergejmueller / parse.php
Last active Nov 6, 2016
Parse User-Agents from a text file and extract Browser/Platform data
View parse.php
<?php
# Enable errors
error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
# Push up memory
ini_set( 'memory_limit', '128M' );
ini_set( 'max_execution_time', 300 );
@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 / index.html
Last active May 19, 2018
Embedded Google Analytics: Fix “Leverage Browser Caching” Warning on Nginx
View index.html
<html>
<!-- ... -->
<!-- Embed analytics.js as local file -->
<script src="/analytics.js"></script>
</html>
@sergejmueller
sergejmueller / .htaccess
Created Jun 14, 2016
WordPress Security: Prevent browser and search engines to request LOG (WP debug) and TXT (plugins readme) files in Apache
View .htaccess
# To be placed in
# /wp-content/.htaccess
<FilesMatch "\.(log|txt)$">
Order Allow,Deny
Deny from all
</FilesMatch>
You can’t perform that action at this time.