Skip to content

Instantly share code, notes, and snippets.

View lordcirth's full-sized avatar
🏠
Working from home

Nathan Fish lordcirth

🏠
Working from home
  • University of Waterloo, CSCF
View GitHub Profile
@lordcirth
lordcirth / salt 'minion' state.apply
Created September 21, 2017 17:02
Python traceback on state.apply
minion.domain:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1468, in _thread_return
return_data = executor.execute()
File "/usr/lib/python2.7/dist-packages/salt/executors/direct_call.py", line 28, in execute
return self.func(*self.args, **self.kwargs)
File "/usr/lib/python2.7/dist-packages/salt/modules/state.py", line 593, in apply_
return highstate(**kwargs)
File "/usr/lib/python2.7/dist-packages/salt/modules/state.py", line 892, in highstate
orchestration_jid=orchestration_jid)
# Configure vim to treat .sls as YAML
salt_editing_vim:
file.managed:
- name: '/usr/share/vim/vimfiles/ftdetect/salt.vim'
# ftdetect/ doesn't exist by default
- makedirs: True
# SLS files are YAML files
- contents: 'autocmd BufRead,BufNewFile *.sls setfiletype yaml | set expandtab tabstop=2 shiftwidth=2'
@lordcirth
lordcirth / output
Created February 13, 2018 19:50
difflib problem
root@salt-dev:~/salt/salt/modules# salt-call file.get_diff /root/sshd_config /root/sshd_config_2 hide_comments="{multiline_begin: '/*', multiline_end: '*/'}"
local:
--- /root/sshd_config
+++ /root/sshd_config_2
@@ -327,6 +327,40 @@
t _ r+s+a+_+k+e+y+
+H+o+s+t+K+e+y+ +/+e+t+c+/+s+s+h+/+s+s+h+_+h+o+s+t+_+d s a _
# Manage /root/.forward to forward emails
# Configure local postfix to forward root's email to a logging address
# Pillar var 'common:root_forward_to' must be set if this is used
common_root_forward_pkgs:
pkg.installed:
- pkgs:
- postfix
- mailutils
@lordcirth
lordcirth / error
Created February 15, 2018 18:35
suppress_comments
[ERROR ] Failed to import module file, this is due most likely to a syntax error:
Traceback (most recent call last):
File "/root/salt/salt/loader.py", line 1458, in _load_module
mod = imp.load_module(mod_namespace, fn_, fpath, desc)
File "/root/salt/salt/modules/file.py", line 4697
hide_comments=None):
^
; Tuning recommended by:
; https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
@lordcirth
lordcirth / 131-kerbalism-4x.ckan
Last active March 24, 2018 16:04
131-kerbalism-4x modlist
{
"kind": "metapackage",
"abstract": "A list of modules installed on the KSP-131-kerbalismC-4x KSP instance",
"name": "installed-KSP-131-kerbalismC-4x",
"license": "unknown",
"version": "2018.03.21.12.19.34",
"identifier": "installed-KSP-131-kerbalismC-4x",
"spec_version": "v1.6",
"recommends": [
{
@lordcirth
lordcirth / on-add-add-rt
Last active July 4, 2018 15:38
Taskwarrior RT hook
#!/usr/bin/env python
# Autodetect RT numbers and add the RT link as an annotation
import sys
import json
import re
added_task = json.loads(sys.stdin.readline())
rt_regex = re.compile(".*RT#?(\d+).*")
rt_baseurl = "https://rt.uwaterloo.ca/Ticket/Display.html?id="
@lordcirth
lordcirth / ubuntu-iso.json
Created November 16, 2018 19:56
Packer Ubuntu
{
"builders": [
{
"type": "virtualbox-iso",
"name": "acm-packer-1",
"guest_os_type": "Ubuntu_64",
"iso_url": "./ubuntu-18.04.1-server-amd64.iso",
"iso_checksum": "a5b0ea5918f850124f3d72ef4b85bda82f0fcd02ec721be19c1a6952791c8ee8",
"iso_checksum_type": "sha256",
/
/data - your blog, as a tar.gz encrypted with an AES key, k
/keys/
/keys/0 - key k encrypted to friend 0
/keys/1 - key k encrypted to friend 1
...