Zsh
mkdir -p ~/.zsh/completions
wget -q https://raw.githubusercontent.com/saltstack/salt/master/pkg/salt.zsh -O ~/.zsh/completions/_salt
sed -i'' -e 's/python2/python/' ~/.zsh/completions/_salt
# ~/.zshrc
#!/usr/bin/env python | |
import os | |
import asyncio | |
import ydb | |
JOB_DDL = """ | |
CREATE TABLE job ( | |
id String NOT NULL, | |
status String, |
#!/usr/bin/env python | |
""" | |
Test Yandex Cloud Functions written in Python and invoked as API Gateway integrations locally. | |
Heavily based on https://github.com/amancevice/python-lambda-gateway | |
MIT License | |
Copyright (c) 2020 Alexander Mancevice | |
Copyright (c) 2022 Max Arnold |
mkdir -p ~/.zsh/completions
wget -q https://raw.githubusercontent.com/saltstack/salt/master/pkg/salt.zsh -O ~/.zsh/completions/_salt
sed -i'' -e 's/python2/python/' ~/.zsh/completions/_salt
# ~/.zshrc
# https://twitter.com/SaltTips/status/1308079610555494403 | |
function sj() { | |
if [ $# -lt 2 ]; then echo "Usage: sj MINION 'Jinja string'"; return 1; fi | |
sudo salt "$1" slsutil.renderer default_renderer=jinja string="$2" | |
} |
# 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: |
# 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: |
#!/usr/bin/env python3 | |
import argparse | |
import json | |
import os | |
import re | |
import urllib.parse | |
import urllib.request | |
import xlsxwriter |
#!/usr/bin/env python3 | |
import argparse | |
import ast | |
import os | |
import sys | |
import xlsxwriter | |
-- 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() |
#!/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'] |