Skip to content

Instantly share code, notes, and snippets.

Find all docker-compose files that are being used

By listing containers and their respective docker-compose file:

for container in $(docker ps | sed -e '1d' | egrep -o '[a-zA-Z0-9_-]+$'); do echo; echo "$container is spun up by..."; docker container inspect "$container" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'; done

By simply showing a list of used docker-compose files:

composefiles=$(for container in $(docker ps | sed -e '1d' | egrep -o '[a-zA-Z0-9_-]+$'); do docker container inspect "$container" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'; done); echo "$composefiles" | sort | uniq

Keybase proof

I hereby claim:

  • I am asperling on github.
  • I am knoerpeltaeng (https://keybase.io/knoerpeltaeng) on keybase.
  • I have a public key ASCsg__Z7QyplIhnhgpQVs07EDayY3UNObSdslaoIi4zago

To claim this, I am signing this object:

@asperling
asperling / dynamic_fields.js
Created October 25, 2013 17:07
Add/Remove Input Fields Dynamically with jQuery Try: http://jsfiddle.net/aaki/hMJEy/1/
$(function() {
$('.multi-field-wrapper').each(function () {
// Save context
var $wrapper = $('.multi-fields', this);
// Handle add button
$(".add-field", $(this)).click(function (e) {
$('.multi-field:first-child', $wrapper).clone(true).appendTo($wrapper).find('input').val('').focus();
});
@asperling
asperling / private.xml
Created June 10, 2013 20:01
Additional settings file for KeyRemap4MacBook (https://pqrs.org/macosx/keyremap4macbook/index.html.en) to fix a keyboard (by remapping the broken keys) where the following keys are broken: RIGHT CURSOR, UP CURSOR, VOLUME UP
<?xml version="1.0"?>
<root>
<item>
<name>My broken keyboard fixes</name>
<item>
<name>The workaround for my broken arrow keys</name>
<item>
<name>Change Shift+Cursor Left to Cursor Right</name>
<identifier>remap.aws_shiftleft2right</identifier>
<autogen>
#!/bin/bash
# Description of script
# Display usage if no parameters given
if [[ -z "$@" ]]; then
echo " ${0##*/} <input> - description"
exit
fi
# Required program(s)
#!/bin/bash
# Description of script
# Required program(s)
req_progs=(prog1 prog2)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@asperling
asperling / gist:4995328
Created February 20, 2013 12:51
Log file (output of Xelatex)
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012) (format=xelatex 2013.2.16) 20 FEB 2013 13:43
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**R2013051-DeviD-Client.tex
(./R2013051-DeviD-Client.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
@asperling
asperling / date.html
Created January 19, 2013 19:19
Workaround for octopress not supporting other languages than english.
{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %}
{% capture date_formatted %}{{ page.date_formatted }}{{ post.date_formatted }}{% endcapture %}
{% capture date_formatted %}{{ date_formatted | replace:'January','Januar' | replace:'February','Februar' | replace:'March','März' | replace:'May','Mai' | replace:'June','Juni' | replace:'July','Juli' | replace:'December','Dezember' }}{% endcapture %}
{% capture has_date %}{{ date | size }}{% endcapture %}
{% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %}
{% capture updated_formatted %}{{ page.updated_formatted }}{{ post.updated_formatted }}{% endcapture %}
{% capture was_updated %}{{ updated | size }}{% endcapture %}
{% if has_date != '0' %}