Link su Gist del documento stesso
- Origine del software libero e definizione
- Progetto GNU
#image: atlassian/default-image:2 | |
image: python:3.7.3 | |
pipelines: | |
tags: | |
'v*': # the tag is "vSomthing" like "v-0.4.2" | |
- step: | |
name: Build docker image and push to AWS ECR | |
services: | |
- docker |
image: python:3.7.3 | |
options: | |
docker: true | |
pipelines: | |
tags: | |
'v*': # the tag is "vSomething" like "v0.4.3" | |
- step: | |
name: Build docker image and push to AWS ECR |
""" | |
A python example regarding how to send CPU, disk and memory usage percentages to InfluxDB, using callbacks and psutil | |
(using psutil for operating system data) | |
There is also a basic query to plot the data on an Influx dashboard. | |
pip3 install influxdb-client psutil | |
On Influx, then you can query "memory", for example, with |
Link su Gist del documento stesso
require "bunny" | |
# vhost create | |
# curl -u guest:guest -X PUT http://localhost:15672/api/vhosts/ckvh1 | |
# | |
# push message in a vhost queue | |
# curl -i -u guest:guest -H "content-type:application/json" -X POST \ | |
# http://localhost:15672/api/exchanges/ckvh1/amq.default/publish \ | |
# -d '{"properties": {}, "routing_key": "aaa", "payload": "bbb", "payload_encoding": "string"}' |
from binance.client import Client | |
api_key = 'your_api_key' | |
api_secret = 'your_api_secret' | |
asset = 'USDT' | |
amount = '1000' # example value as string | |
client = Client(api_key, api_secret) | |
transaction = client.repay_margin_loan(asset=asset, amount=amount) |
#!/usr/bin/env python | |
"""Extract the public key from the private key and write to a file. | |
""" | |
from Crypto.Hash import SHA256 | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.PublicKey import RSA | |
with open("private_key.pem", "r") as src: | |
private_key = RSA.importKey(src.read()) |
# choose one or the other | |
# 1 | |
# oneliner: all JPGs in a single folder (don't use it when you are going to have thousands of images) | |
for i in $(ls 2022_07_*.MP4 | awk -F "." '{print $1}'); do ffmpeg -i $i.MP4 -qscale:v 1 -s 1920x1080 $(printf '%s' $i)_%8d.jpg; done | |
# 2 | |
# each mp4 generates its own jpg folder | |
for i in $(ls 2022_07_13_*.MP4 | awk -F "." '{print $1}') | |
do |
# grabbed from S.O. and then tuned it (sort of) | |
# SSH agent | |
ssh_pid_file="$HOME/.config/ssh-agent.pid" | |
SSH_AUTH_SOCK="$HOME/.config/ssh-agent.sock" | |
if [ -z "$SSH_AGENT_PID" ] | |
then | |
# no PID exported, try to get it from pidfile | |
SSH_AGENT_PID=$(cat "$ssh_pid_file") | |
fi |