Skip to content

Instantly share code, notes, and snippets.

Avatar

Max Arnold max-arnold

  • Kemerovo
View GitHub Profile
@max-arnold
max-arnold / rename.sls
Last active Mar 23, 2020
Rename a Salt minion
View rename.sls
# Save into salt://rename.sls then run the following command:
# salt-run state.orch rename pillar='{"old": "OLD_NAME", "new": "NEW_NAME"}'
#
# For more tips like this, follow https://twitter.com/SaltTips
{% set old_name = pillar['old'] %}
{% set new_name = pillar['new'] %}
Rename minion id:
salt.function:
@max-arnold
max-arnold / system_boot.py
Created Feb 9, 2020
Salt minion system boot beacon
View system_boot.py
# Save into salt://_beacons/system_boot.py and then run
# saltutil.sync_beacons
from __future__ import absolute_import, unicode_literals
__virtualname__ = 'system_boot'
def beacon(config):
"""
beacons:
@max-arnold
max-arnold / export-salt-cloud-issues.py
Last active Sep 20, 2019
Export Salt Cloud issues to XLSX
View export-salt-cloud-issues.py
#!/usr/bin/env python3
import argparse
import json
import os
import re
import urllib.parse
import urllib.request
import xlsxwriter
@max-arnold
max-arnold / export-salt-cloud-driver-functions.py
Last active Sep 20, 2019
Export Salt Cloud driver functions to XLSX
View export-salt-cloud-driver-functions.py
#!/usr/bin/env python3
import argparse
import ast
import os
import sys
import xlsxwriter
@max-arnold
max-arnold / tt_safari_to_firefox.applescript
Last active Jun 25, 2019
Safari to Firefox tab transporter
View tt_safari_to_firefox.applescript
-- Transport tabs from one browser to another. This script moves tabs from Safari to Firefox
-- config
property sourceBrowser : "Safari"
property destinationBrowser : "Firefox"
on run
assertRunning()
assertHasOpenWindow()
set sourceWindow to assertFrontmost()
@max-arnold
max-arnold / safari-reading-list-export.py
Last active Jun 25, 2019
Export Safari Reading List to CSV
View safari-reading-list-export.py
#!/usr/bin/env python3
# A script to export (backup) Safari Reading List
import os
import plistlib
with open(os.path.expanduser('~/Library/Safari/Bookmarks.plist'), 'rb') as fp:
plist = plistlib.load(fp)
bookmarks = [
ch['Children'] for ch in plist['Children']
@max-arnold
max-arnold / wsgi.py
Created Jul 7, 2018 — forked from rbarrois/wsgi.py
Django uWSGI warmup
View wsgi.py
# -*- coding: utf-8 -*-
import io
import os
import sys
import time
import wsgiref.util
import uwsgidecorators
@max-arnold
max-arnold / multitail
Created Feb 7, 2014
Watch logs from multiple remote servers in single terminal window
View multitail
MULTITAIL() {
if [ "$#" = "0" ]; then
echo "MULTITAIL logdir host1 host2 ..."
exit 1
fi
logdir=$1
shift
if [ "$#" = "0" ]; then
@max-arnold
max-arnold / node-js-virtualenv-install.txt
Last active Dec 23, 2015
node.js installation into virtualenv
View node-js-virtualenv-install.txt
# workon myenv
# cdvirtualenv
#
## prefix is required both for compilation and for npm:
# export PREFIX=$(pwd)
# export NODEVER=0.10.18
#
# wget http://nodejs.org/dist/v${NODEVER}/node-v${NODEVER}.tar.gz
# tar -zxf node-v${NODEVER}.tar.gz
# cd node-v${NODEVER}
@max-arnold
max-arnold / python-static-site-generators.txt
Last active Jun 21, 2019
List of static blog/site generators written in Python
View python-static-site-generators.txt
http://blohg.org/
http://getnikola.com/
http://markdoc.org/
http://mulholland.xyz/docs/ivy/
http://mynt.mirroredwhite.com/
http://obraz.pirx.ru/
http://pelican.readthedocs.org/en/latest/
http://pyfolio.org/
http://pypi.python.org/pypi/jules
http://pythonhosted.org/swg/
You can’t perform that action at this time.