Skip to content

Instantly share code, notes, and snippets.

Maciej Pasternacki mpasternacki

Block or report user

Report or block mpasternacki

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

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

set -e
# git-pass
# ========
# This script allows easy usage of with
# multiple, Git-managed stores. It works both as self-standing shell
# script (that can be committed to the repository itself), or as a Git
# subcommand (in which case it should reside somewhere in $PATH or in
mpasternacki /
Last active Jan 18, 2018
A Continuous Packaging Pipeline: The Materials

A Continuous Packaging Pipeline

A list of tools mentioned in my Ignite talk from Devopsdays Rome 2012 on a continuous packaging pipeline, with links and short description for each tool.

The talk slides are at; a longer blog post will be written soon.


Available at or with gem install vendorificator

Include third party modules in your git repo, using pristine branches to sanely maintain local changes, upgrades, and merges.

mpasternacki / data_bag_from_yaml.rb
Created Aug 19, 2011
Knife plugin to create data bags from YAML files
View data_bag_from_yaml.rb
# Author:: Maciej Pasternacki (<>)
# Copyright:: Copyright (c) 2010 Maciej Pasternacki
# License:: Apache License, Version 2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
mpasternacki /
Created Jun 8, 2012
Track down Python print statements that clutter your output.
# Trace 'print' statement calls cluttering your test suite output.
# It is not that simple to track 'print' statement in Python 2.x - it
# cannot be monkey-patched itself, because it's not a function. So we
# override sys.stdout and check the backtrace when stdout is written
# to.
# The overload happens only if TRACE_PRINT environment variable is
# set. By default, only the offending file name and line number is
# printed; if TRACE_PRINT environment variable is set to 'traceback',
mpasternacki /
Last active Jan 17, 2016
Perl script to build a Docker image from Dockerfile that creates the image in a single layer, without any intermediate images. Needs JSON CPAN module (available as `libjson-perl` Debian/Ubuntu package). Usage: run the script in the directory that contains a Dockerfile. More details in a blog post:
#!/usr/bin/env perl
use feature 'switch';
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use File::Copy;
use File::Path qw/make_path/;
#!/usr/bin/env python
import json
import sys
def pp(vv, prefix='$'):
if isinstance(vv, (list,tuple)):
for i, v in enumerate(vv):
pp(v, "{0}[{1}]".format(prefix, i))
elif isinstance(vv, dict):
mpasternacki /
Created May 28, 2013
Script to activate Ruby Gem Bundler environment in current shell session.
# This script activates a Gem Bundler environment in current shell
# session. This lets you type commands without `bundle exec` all the
# time, even if you leave the project's directory, and without complex
# magic that runs with every command.
# Usage: save this file somewhere. Use following command to activate
# current directory's bundle in current shell session:
mpasternacki /
Last active Dec 16, 2015
A runner script to run any command and save its stdout and stderr in a timestamped log file, ready to be harvested by Logstash. Adds JSON metadata, and optionally locks the command, ensuring it doesn't run in multiple copies at the same time.
#!/usr/bin/env perl -w
# Version 2, December 2004
# Copyright (C) 2013 Maciej Pasternacki <>
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
mpasternacki / soup_download.rb
Last active Dec 15, 2015
Download lolcats from your while it's up! Needs Ruby (used with MRI - "the regular ruby" - 1.9.3, should work with 1.9.2 or 2.0.0; 1.8.7 is a "maybe") and the Nokogiri gem (
View soup_download.rb
require 'fileutils'
require 'open-uri'
require 'yaml'
require 'rubygems'
require 'nokogiri'
FileUtils.mkdir_p 'items'
feed = Nokogiri::XML('3fc1319c496ea1aacde451cecbdc17e3.rss'))
You can’t perform that action at this time.