Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
admins = { "[email protected]" }
privileged_entities = {
["[email protected]"] = {
roster = "both";
message = "outgoing";
presence = "roster";
},
}
plugin_paths = { "/etc/prosody/prosody-modules" }
modules_enabled = {
@deoren
deoren / ansible_ad_hoc_inventories.md
Created February 10, 2019 22:02 — forked from alces/ansible_ad_hoc_inventories.md
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

@deoren
deoren / LXD-cheat-sheet.md
Created December 2, 2018 21:04 — forked from berndbausch/LXD-cheat-sheet.md
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@deoren
deoren / LXD_SSH_KEY.md
Created December 2, 2018 21:00 — forked from jeanlouisferey/LXD_SSH_KEY.md
How to create a LXD Container with your ssh key in it (and with ssh server in the container)
@deoren
deoren / multiple_ssh_setting.md
Created July 22, 2018 02:28 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@deoren
deoren / git-reset-author.sh
Created June 25, 2018 07:25 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@deoren
deoren / go-shebang-story.md
Created June 4, 2018 04:14 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@deoren
deoren / gist:6282552db527eb6ac08ebcb473481729
Created March 26, 2018 04:06 — forked from marvin/gist:1017480
syslog calculate facility and severity from PRI(priority)
example:
PRI = 191
To get the Facility
Divide the PRI number by 8.
191/8 = 23.875
The whole number part is the facility.
To get the Severity
@deoren
deoren / rsyslogque.md
Created March 9, 2018 04:31 — forked from esfand/rsyslogque.md
Rsyslog queues

Main Queue

This object is available since 7.5.3. It permits to specify parameters for the main message queue. Note that only queue-parameters are permitted for this config object. This permits to set the same options like in ruleset and action queues. A special statement is needed for the main queue, because it is a different object and cannot be configured via any other object.

Note that when the main_queue() object is configured, the legacy $MainMsgQ... statements are ignored.

A Simple Example

main_queue(    
    queue.size="100000"      # how many messages (messages, not bytes!) to hold in memory

queue.type="LinkedList" # allocate memory dynamically for the queue. Better for handling spikes

@deoren
deoren / redact.py
Created February 26, 2018 14:33 — forked from alq666/redact.py
Redact certain patterns in rsyslog
#!/usr/bin/env python
"""A message modification plugin to remove credentials
Copyright (C) 2014 by Adiscon GmbH and Peter Slavov
Copyright (C) 2016 by Datadog
This file is part of rsyslog.
Licensed under the Apache License, Version 2.0 (the "License");