Corso pratico di software libero e cloud di livello base - FOIT 2020-06
Lezione 1
Link su Gist del documento stesso
- Origine del software libero e definizione
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"}' |
Link su Gist del documento stesso
""" | |
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 |
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 |
#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 |
// clean up based on | |
// https://medium.com/@rafaeloliveira1337/javascript-find-an-object-in-array-based-on-objects-property-8adb4fe421ce | |
// fiddle => https://jsfiddle.net/carlok/d5j4t67h/ | |
const objArray = [ | |
{ id: 0, name: 'Object 0', otherProp: '321' }, | |
{ id: 1, name: 'foo', otherProp: '648' }, | |
{ id: 2, name: 'Another Object', otherProp: '850' }, | |
{ id: 3, name: 'Almost There', otherProp: '046' }, | |
{ id: 4, name: 'foo2', otherProp: '984' } |
Il “mondo di prima” l'abbiamo lasciato di sicuro e non sappiamo come sarà quell dopo: qualcosa potrebbe cambiare per sempre, di grande e di piccolo.
Ho provato ad elencare alcune di queste variazioni.
find A_LIST_OF_FOLDERS_AND_FILES -type f -exec grep -Iq . {} \; -print | wc -l | |
# A_LIST_OF_FOLDERS_AND_FILES => use the previous command as: find a b.txt c where a and c are directories or files | |
for a in $(find src -type f -exec grep -Iq . {} \; -print); do wc -l $a; done | awk '{split($0,a," "); sum += a[1]} END {print sum}' |
assembly | |
awk | |
bash | |
basic | |
c | |
c# | |
c++ | |
coffeescript | |
java | |
javascript |
#!/usr/bin/env python | |
import pika | |
# At the moment (2019-04-07) the official examples provided by CloudAMQP are not working anymore | |
# because pika 1.0.0 has changed | |
# moreover, the official examples are in Python 2 | |
# these examples have a few benefits: | |
# they work with python3 | |
# they work with pika 1.0.0 | |
# they were tested with amqps |