Skip to content

Instantly share code, notes, and snippets.

Robert Kreuzer rkrzr

Block or report user

Report or block rkrzr

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
@rkrzr
rkrzr / auto_tags.py
Last active Oct 15, 2019
Automatically generate ansible tags of the same name for each role in a playbook
View auto_tags.py
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
View keybase.md

Keybase proof

I hereby claim:

  • I am rkrzr on github.
  • I am rkrzr (https://keybase.io/rkrzr) on keybase.
  • I have a public key ASDyfgTXDRLIuf01btMy3HxQeEQC5ejGFQWMkHY1G25vsAo

To claim this, I am signing this object:

View gzipRequestTest.js
var request = require('request'),
zlib = require('zlib');
var headers = {
"accept-charset" : "ISO-8859-1,utf-8;q=0.7,*;q=0.3",
"accept-language" : "en-US,en;q=0.8",
"accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"user-agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
"accept-encoding" : "gzip,deflate",
};
@rkrzr
rkrzr / UpperStream.js
Last active Dec 20, 2015
An example of how to use streams in Node.js. It gets a page via http, transforms the data to uppercase and prints it to stdout.
View UpperStream.js
var request = require('request');
var url = 'http://www.site2mobile.com';
// Set both readable and writable in constructor.
var UpperStream = function () {
this.readable = true;
this.writable = true;
};
// Inherit from base stream class.
You can’t perform that action at this time.