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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library. | |
# Retrieves the root path (/) from host:port specified on command line. | |
if [ -z "$1" ] ; then | |
echo "Usage: $0 host:port|path/to/socket" >&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# git-pass | |
# ======== | |
# This script allows easy usage of http://www.passwordstore.org/ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!./bin/knife exec | |
# A knife exec script to change chef node's name, preserving all the attributes. | |
# | |
# Usage: knife exec rename-node.rb old-name new-name | |
# | |
# Script retrieves the Node object, changes its 'name' attribute, | |
# creates new Node object with updated name and rest of attributes | |
# untouched. Then it deletes old Node and Client objects from | |
# database, and logs into the server to update it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data bag items in 'projects' can declare 'include_recipes' property | |
# (list or string); these recipes will be included in the | |
# projects::default recipe, but - if they're not already loaded - need | |
# to be declared in 'depends'. This code loads the data bag JSON from | |
# files, and declares all needed dependencies. | |
require 'json' | |
soft_deps = [] | |
Dir[File.join( File.dirname(__FILE__), | |
'../../data_bags/projects/*.json' )].each do |p| | |
soft_deps |= File::open(p) { |f| JSON::load(f) }["include_recipes"].to_a. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Author:: Maciej Pasternacki (<maciej@pasternacki.net>) | |
# 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 | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[task(resources=[i2c])] | |
fn init_display(cx: init_display::Context) { | |
let lcd = cx.resources.i2c.lcd_mut(); | |
lcd.init(2, 16).unwrap(); | |
lcd.backlight(true).unwrap(); | |
lcd.home().unwrap(); | |
uwrite!(lcd, "Hello?").ok(); | |
} |
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 https://speakerdeck.com/mpasternacki/a-continuous-packaging-pipeline; a longer blog post will be written soon.
Available at https://github.com/3ofcoins/vendorificator/ or with gem install vendorificator
Include third party modules in your git repo, using pristine branches to sanely maintain local changes, upgrades, and merges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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', |
NewerOlder