This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
#!/usr/bin/env python3 | |
from xml.dom import minidom | |
import requests | |
# some consts | |
HTTP_MULTI_STATUS = 207 | |
PROPFIND_REQUEST = '''<?xml version="1.0" encoding="utf-8" ?> | |
<d:propfind xmlns:d="DAV:"> | |
<d:prop xmlns:oc="http://owncloud.org/ns"> | |
<d:getlastmodified/> |
# Maintainer: Alex S. <shantanna_at_hotmail_dot_com> | |
# Contributor: Jonathon Fernyhough <jonathon_at_manjaro_dot_org> | |
# Contributor: Andrew Shark <ashark#linuxcomp.ru> | |
# Hardware support is limited. | |
# See https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=56878&p=456990#p456924 | |
pkgname=davinci-resolve | |
_pkgname=resolve | |
pkgver=15.2.3 |
#!/usr/bin/env ansible-playbook -c local | |
# | |
# AWS STS token update playbook. | |
# | |
# Updating AWS session tokens with STS can be a pain. But MFA is good. So let's | |
# automate the management of the .aws/credentials file to make it not painful! | |
# | |
# Usage: | |
# | |
# 1. Save this to a file like /usr/local/bin/aws-sts-token |
listen_addresses = '*' | |
# Tuning at: https://pgtune.leopard.in.ua/ | |
# DB Version: 9.6 | |
# OS Type: linux | |
# DB Type: dw | |
# Total Memory (RAM): 16 GB | |
# CPUs num: 20 | |
# Connections num: 100 | |
# Hard drive type: ssd |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
import sys | |
def j(lineno): | |
frame = sys._getframe().f_back | |
called_from = frame | |
def hook(frame, event, arg): | |
if event == 'line' and frame == called_from: | |
try: | |
frame.f_lineno = lineno |
#!/bin/bash | |
set -eu | |
umask 0022 | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: $0 role_name [AWS ACCOUNT NUMBER]" >&2 | |
exit 1 | |
fi |
This Gist shows how you can encrypt/decrypt variables with KMS during your Ansible playbook execution. While google searching I couldn't find anything useful on the subject.
Let's say your project has a folder of playbooks called plays
.
In that folder, create a folder called filter_plugins
and insert kms_filters.py
(included in this gist)