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" | |
} |
#!/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-2023 Max Arnold |
#!/usr/bin/env python | |
import os | |
import asyncio | |
import ydb | |
JOB_DDL = """ | |
CREATE TABLE job ( | |
id String NOT NULL, | |
status String, |
#!/usr/bin/env python3 | |
import argparse | |
import ast | |
import os | |
import sys | |
def parse_module(mod): | |
with open(mod, "r") as source: |
ssh
and roster
arguments https://docs.saltproject.io/en/master/ref/states/all/salt.states.saltmod.html#salt.states.saltmod.statesalt \* state.apply
. This is quite important feature for those who are against running any management agents# Based on https://cloud.yandex.ru/ru/docs/speechkit/stt/api/microphone-streaming | |
import pyaudio | |
import wave | |
import argparse | |
import grpc | |
from datetime import datetime | |
import time | |
import queue | |
import sys |
Here is how I set up my extension development environment on Ubuntu 22.04:
git config --global user.name "Name"
git config --global user.email "[email protected]"
git clone [email protected]:USER/saltext-my.git
cd saltext-my
sudo apt install python3-venv python3-dev build-essential python3-wheel python3-wheel-whl
python3 -m venv .venv
source .venv/bin/activate
""" | |
1. Install the following dependencies into a virtualenv | |
pip install textual==0.57.0 textual-dev==1.5.1 requests==2.31.0 requests-aws4auth==1.2.3 yandexcloud==0.267.0 | |
2. Create a env.json file | |
{ | |
"YC_REGION": "ru-central1", | |
"YC_FOLDER_ID": "FFF", |