Skip to content

Instantly share code, notes, and snippets.

View michaelhaessig's full-sized avatar

Michael Haessig michaelhaessig

  • Zurich , Switzerland
View GitHub Profile
@bom-d-van
bom-d-van / ddos.txt
Created February 12, 2017 11:46
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@chrisjhoughton
chrisjhoughton / fb-open-graph.liquid
Last active September 9, 2023 07:52
Facebook Open Graph meta tags for Shopify. Add this as a snippet called "fb-open-graph.liquid" in your theme, and then add {% include 'fb-open-graph' %} to your theme.liquid file.
{% if template contains 'product' %}
<meta property="og:type" content="product">
<meta property="og:title" content="{{ product.title | strip_html | escape }}">
<meta property="og:category" content="{{ product.type }}" />
{% for image in product.images limit:3 %}
<meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}">
<meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}">
{% endfor %}
<meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}">
<meta property="og:price:currency" content="{{ shop.currency }}">
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@cookrn
cookrn / _readme.md
Created June 27, 2012 04:19
Compile *.ejs Templates

EJS Compiler

This is used to generate a templates.js file where the keys are template identifiers and the values are the raw, escaped EJS templates.

Templates are semi-compiled server side. Results of compilation are memoized on the client side using Underscore.

This is useful for maintaining multiple template files server-side and compiling them into a client-side script.

This requires the use of the ejs client side library. Requires ejs to be available on window. See: https://github.com/visionmedia/ejs#client-side-support

@timothyklim
timothyklim / Application.scala
Created June 12, 2012 17:22
After I talked with co-author of play with topic subdomains, I was a little bit confused. My current framework doesn't support my thoughts and I was started write some code!
// app/controllers/Application.scala
trait SubdomainController extends Controller {
def WithSubdomain(f: => String => Request[AnyContent] => Result) = Action { implicit request =>
val splitDomain = request.domain.split("\\.")
if (splitDomain.length < 2) {
BadRequest("Domain not found!")
} else {
f(splitDomain.head)(request)
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');