Skip to content

Instantly share code, notes, and snippets.

@zbal
zbal / gist:5226450
Created March 23, 2013 04:28
netsted with_items
main playbook:
tasks:
- include: $item/tasks/main.yml
when_string: "'$item' in $group_names"
with_items:
- apache
- php
included file ex. apache/tasks/main.yml:
@zbal
zbal / gist:5675401
Created May 30, 2013 02:28
Network mapbox from Shanghai

From office (professional connection) - MacOSX

Traceroute

Run 1

Vincents-MacBook-Pro:demo balou$ traceroute a.tiles.mapbox.com
traceroute: Warning: a.tiles.mapbox.com has multiple addresses; using 216.137.55.37
traceroute to dnv9my2eseobd.cloudfront.net (216.137.55.37), 64 hops max, 52 byte packets
 1  server-216-137-55-37.hkg1.r.cloudfront.net (216.137.55.37)  0.999 ms  1.068 ms  0.653 ms
@zbal
zbal / gist:6172020
Last active October 4, 2019 01:46
rename - delete - create -- git ...
Vincents-MacBook-Pro:sandbox balou$ git init
Initialized empty Git repository in /Users/balou/workspace/sandbox/.git/
Vincents-MacBook-Pro:sandbox balou$ vim a
Vincents-MacBook-Pro:sandbox balou$ cat a
aaaaa
Vincents-MacBook-Pro:sandbox balou$ git add a
Vincents-MacBook-Pro:sandbox balou$ git status
# On branch master
#
@zbal
zbal / gist:6724907
Created September 27, 2013 06:42
base Dockerfile
FROM ubuntu:precise
MAINTAINER me@example.com
# Prepare chinese apt mirror - upgrade to latest
RUN printf "deb http://mirrors.163.com/ubuntu precise main\ndeb http://mirrors.163.com/ubuntu/ precise universe\n" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Cheat upstart
RUN dpkg-divert --local --rename --add /sbin/initctl
@zbal
zbal / gist:6724926
Last active November 7, 2016 12:56
new Dockerfile based on the previous base image
FROM id_from_prev_build_image
MAINTAINER me@example.com
RUN apt-get update
RUN apt-get upgrade -y
RUN echo 'toto' > /test
Option 1 - using a class:
def run(env, command, args):
plugin = Plugin(env)
# Check if the command is defined in the plugin
if 'do_'+ command not in dir(plugin):
return False
# Call function
getattr(plugin, 'do_'+ command)(args)
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
---
some:
thing: is
awesome:
- that
- is
- an
- array
#!/bin/bash
#####
# Builds a custom nginx
#
RELEASE_TAGS="+lua+$(lsb_release -s -c)"
RELEASE_MAINTAINER=
RELEASE_MAINTAINER_EMAIL=
RELEASE_MESSAGE="Add LUA support to nginx"
#
# Prepare the app
- run: devops nodejs app add
options:
name: "{{ app_name }}"
root: /opt/{{ app_name }}/bundle
script: main.js
node_env: prod
user: devops
extra_env: >
"PORT=3000