Skip to content

Instantly share code, notes, and snippets.

$ pdnsutil create-zone ds9a.nl ns1.powerdns.com
Creating empty zone 'ds9a.nl.'
Also adding one NS record

$ pdnsutil add-record ds9a.nl @ A 1.2.3.4
$ pdnsutil add-record ds9a.nl "*" CNAME ds9a.nl
$ pdnsutil list-zone ds9a.nl
*.ds9a.nl.      3600    IN      CNAME   ds9a.nl.
ds9a.nl.        3600    IN      A       1.2.3.4 
@netoisc
netoisc / python.jinja2.alternating_rows.html
Created December 15, 2015 22:22
How to alternate row style in jinja2
<ul>
{% for row in rows %}
<li class="{{ loop.cycle('odd', 'even') }}">{{ row }}</li>
{% endfor %}
</ul>
@gcanales75
gcanales75 / crea-VM-ansible-apache-slack.yml
Last active February 24, 2023 14:48
Playbook de Ansible para crear VM en vSphere, instala Apache y envia notificación a Slack
---
- name: Nueva VM, instala Apache y envia notificacion a Slack
hosts: localhost
user: root
sudo: true
## Prompt que nos pregunta como queremos llamar a la nueva maquina virtual
vars_prompt:
- name: "guest"
prompt: "Nombre VM?"
@bsmithgall
bsmithgall / titlecase.py
Created August 3, 2015 18:19
python titlecase filter for jinja
# modified from https://gist.github.com/bsmithgall/372de43205804a2279c9
SMALL_WORDS = re.compile(r'^(a|an|and|as|at|but|by|en|etc|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$', re.I)
SPACE_SPLIT = re.compile(r'[\t ]')
# taken from http://stackoverflow.com/a/267405
CAP_WORDS = re.compile(r'^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$')
PUNC_REGEX = re.compile(r'[{}]'.format(re.escape(string.punctuation)))
# taken from python-titlecase: https://github.com/ppannuto/python-titlecase/blob/master/titlecase/__init__.py#L27
UC_INITIALS = re.compile(r'^(?:[A-Z]{1}\.{1}|[A-Z]{1}\.{1}[A-Z]{1})+$', re.I)
def better_title(string):
@halberom
halberom / 00_description
Last active April 14, 2022 19:23
ansible - example of using filters to change each item in a list
The problem:
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple
example, adding '.conf' to each item.
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately,
it uses 'value' as the pattern. When called inside map 'value' is the current item in
the list, or in other words *args as far as format is concerned. So it's the wrong way
around.
@zachfi
zachfi / gist:e0dee773b657b41f3fe9
Created November 25, 2014 05:34
Gandi DNS Update Script
#! /usr/local/bin/python
import xmlrpclib
import ConfigParser
import os
from sys import exit
class GandiDomain():
def __init__(self, apikey, domain):
@cortesben
cortesben / hg-commands.md
Last active March 6, 2025 14:58
Mercurial command cheat sheet

Mercurial Commands

Commands Description
hg pull get latest changes like git pull use flags like -u IDK why yet
hg add only for new files
hg commit add changes to commit with -m for message just like git
hg addremove adds new files and removes file not in your file system
hg incoming see changes commited by others
hg outgoing see local commits
@michaelcoyote
michaelcoyote / avamar_commands.txt
Created August 15, 2014 18:07
Useful Avamar cli commands for managing backups, clients, groups, policies, etc.
- Notes on avamar client configuration using command line
Generally scheduling of clients, setting retentions and datasets are done via groups (best practice).
It is recommended to work with the backup team to set up an agreed upon set of schedules, retentions and datasets
and assign these to group policies as needed.
With this in mind it is likely that you will only really need the command to list the group policies, add a client to a group and start a backup.
@jaburns
jaburns / gfm-render.sh
Last active August 27, 2023 16:02
Bash script to render github flavoured markdown to HTML
#!/usr/bin/env bash
data="$(
cat "$1" \
| sed 's/"/\\"/g' \
| sed ':a;N;$!ba;s/\n/\\n/g' \
)"
if [[ -z "$2" ]]; then
context=''
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#