Skip to content

Instantly share code, notes, and snippets.

@max-arnold
max-arnold / python-static-site-generators.txt
Last active January 27, 2023 11:09
List of static blog/site generators written in Python
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/
@max-arnold
max-arnold / node-js-virtualenv-install.txt
Last active December 23, 2015 10:39
node.js installation into virtualenv
# 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 / multitail
Created February 7, 2014 13:28
Watch logs from multiple remote servers in single terminal window
MULTITAIL() {
if [ "$#" = "0" ]; then
echo "MULTITAIL logdir host1 host2 ..."
exit 1
fi
logdir=$1
shift
if [ "$#" = "0" ]; then
@max-arnold
max-arnold / wsgi.py
Created July 7, 2018 04:47 — forked from rbarrois/wsgi.py
Django uWSGI warmup
# -*- coding: utf-8 -*-
import io
import os
import sys
import time
import wsgiref.util
import uwsgidecorators
@max-arnold
max-arnold / safari-reading-list-export.py
Last active June 25, 2019 07:29
Export Safari Reading List to CSV
#!/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 / tt_safari_to_firefox.applescript
Last active June 25, 2019 08:24
Safari to Firefox tab transporter
-- 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 / export-salt-cloud-driver-functions.py
Last active September 20, 2019 06:54
Export Salt Cloud driver functions to XLSX
#!/usr/bin/env python3
import argparse
import ast
import os
import sys
import xlsxwriter
@max-arnold
max-arnold / export-salt-cloud-issues.py
Last active September 20, 2019 06:54
Export Salt Cloud issues to XLSX
#!/usr/bin/env python3
import argparse
import json
import os
import re
import urllib.parse
import urllib.request
import xlsxwriter
@max-arnold
max-arnold / system_boot.py
Created February 9, 2020 14:42
Salt minion system boot beacon
# 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 / rename.sls
Last active March 23, 2020 08:11
Rename a Salt minion
# 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: