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 = { "admin@example.com" }
privileged_entities = {
["admin@example.com"] = {
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 / nginx-block-dir-listing-snippet.conf
Created September 18, 2018 15:35
Nginx snippet for blocking directory listings for clients from a private WiFi subnet
server {
listen 8080;
server_name software.example.com;
root /mnt/data/software/packages;
autoindex on;
# Only allow "trusted" networks
include trusted_acl.inc.conf;
@deoren
deoren / git-remote-repos.md
Created August 3, 2018 23:27
Git - Setting up push to multiple remote repos
@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 "your_email@youremail.com"
@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