Skip to content

Instantly share code, notes, and snippets.

Jan Ivar Beddari beddari

Block or report user

Report or block beddari

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
View vscode_literal_tab.json
"key": "ctrl+v tab",
"command": "type",
"args": { "text": "\t" },
"when": "editorTextFocus"
beddari / ansible_when_truthy_test.yml
Created Mar 1, 2019 — forked from kcd83/ansible_when_truthy_test.yml
Test what vars evalute to true or false in Ansible 2.5
View ansible_when_truthy_test.yml
#!/usr/bin/env ansible-playbook
- name: Test truthiness
hosts: localhost
gather_facts: False
- True
- 1
#!/usr/bin/env python
# convert unicode filenames to pure ascii
import os
import sys
import glob
import unicodedata
EXT = u'*.*'
beddari / recovery.txt
Created May 29, 2018 — forked from Millnert/recovery.txt
ceph recovery when FUBAR (mem / cpu looping crashing OSDs with OOM)
View recovery.txt
## Stop all OSDs
## Set OSD nodown
ceph osd set nodown
##Set OSD nobackfill
ceph osd set nobackfill
beddari /
Created Dec 2, 2017
Ansible list formatting filter_plugin
def format_list(list_, pattern):
return [pattern % s for s in list_]
class FilterModule(object):
def filters(self):
return {
'format_list': format_list,
View learning.yaml
- name: test
hosts: localhost
connection: local
gather_facts: False
# Test each key in a hash for existence, works fine ... I'll accept doing this!
- name: do something based on the existence of nested dict key nested.config.hash.key
debug: msg="{{ nested.config.hash.key }}"
beddari /
Created Oct 17, 2017 — forked from angstwad/
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
View gist:6df04cb532a77e6cfd0a1bc70970575e
osadmin ()
source <(tpass show "openstack/$1/admin")
osuser ()
source <(tpass show "$(whoami)/openstack/$1")

For the timer:

Description=Do something daily


You can’t perform that action at this time.