Skip to content

Instantly share code, notes, and snippets.

View boppy's full-sized avatar
🕯️

Henning Bopp boppy

🕯️
View GitHub Profile
@boppy
boppy / monit-and-gmail
Created June 9, 2019 15:37 — forked from jcdarwin/monit-and-gmail
How to allow monit to use gmail as a smtp relay to send out alert emails
# visit https://accounts.google.com/DisplayUnlockCaptcha and click to allow access
# edit /etc/monit/monitrc to include the following
set mailserver smtp.gmail.com port 587
username "whoever@gmail.com" password "whatever"
using tlsv1
with timeout 30 seconds
# run the following to validate access
@boppy
boppy / nxpasswd
Last active July 24, 2016 12:58 — forked from ckujau/htpasswd.sh
Generate an .htpasswd file without the Apache tools
#!/bin/bash
#
# Generate an SSHA password for .htpasswd files
#
# Output can be redirected (while asking for password on screen).
# Password has to be entered twice.
#
# * https://www.nginx.com/resources/wiki/community/faq/#how-do-i-generate-an-htpasswd-file-without-having-apache-tools-installed
# * https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic_user_file
#
@boppy
boppy / index.html
Last active June 12, 2016 12:23 — forked from ArunHub/alert-buttons.html
alert the buttons text //source https://jsbin.com/fawepetaha
<div class="btns">
<p>Write JavaScript (using jQuery is fine) so that clicking on any button will cause an alert to popup with the text of the button that was clicked.</p>
<p>Make sure your solution is as efficient as possible even if there are a lot more <code>button.btn</code>'s added on the page. Do not use unnecessary event listeners.</p>
<button class="btn">c</button>
<button class="btn">l</button>
<button class="btn">o</button>
<button class="btn">s</button>
<button class="btn">e</button>
@boppy
boppy / slick-has-n-children.js
Last active January 24, 2016 12:30 — forked from twiss/slick-has-n-children.js
Tries to define :has-n-children([<|>|<=|>=]n)
/* :has-n-children([<|>|<=|>=]n)
* requires Slick
* selects elements with (less/more than (or equal to)) n elements as children
* [2011-07-11] doesn't work yet (tested with 1.1.5)
* [2016-01-24] works now (testet with 1.6); https://jsfiddle.net/ugLaexhc/2/
*/
Slick.definePseudo('has-n-children', function(arg) {
var childrenLen = this.children.length;
var parsedArg = arg.match(/(<|>|<=|>=)?(\d+)/);