Python script to create snapshots for Samba shares using rsync.
The first snapshot will be a full copy(cp -a) the next ones will be hard link to the first.
run smb-snapshot -h for help.
Created a Repo: https://github.com/0x3333/smb-snapshots
Python script to create snapshots for Samba shares using rsync.
The first snapshot will be a full copy(cp -a) the next ones will be hard link to the first.
run smb-snapshot -h for help.
Created a Repo: https://github.com/0x3333/smb-snapshots
RAM
---
vm-1 = 1,024 MiB
vm-2 = 2,048 MiB
Total: 3,072 MiB
CPU(s)
------
| #!/usr/bin/zsh | |
| TRAPDEBUG() { | |
| read -q "?run \"$ZSH_DEBUG_CMD\"? " || setopt errexit | |
| echo > /dev/tty | |
| } | |
| echo "First command" | |
| echo "Second command" | |
| echo "Last command" |
This is an alias to shells to display mount output in formatted columns.
Add this alias to your rc shell(.bashrc, .zshrc, or whatever):
alias mountc='mount | column -t | sort -V'
Example output:
Para contas tipo SIP Trunk da DirectCall, não existe API(Existe mas é paga) para pegar o saldo atual da conta.
Criei este script para facilitar o acompanhamento do saldo, sem precisar entrar na interface web.
O script retorna 0 caso seja invocado sem argumentos ou caso o argumento seja maior que o saldo atual. Exemplo:
$ ./saldo.sh
312,64
$ echo $?
| #!/bin/sh | |
| #FreeDNS updater script | |
| UPDATEURL="https://freedns.afraid.org/dynamic/update.php?_YOUR_KEY_HERE_" | |
| DOMAIN="_YOUR_DOMAIN_HERE_" | |
| registered=$(nslookup $DOMAIN|tail -n2|grep A|sed s/[^0-9.]//g) | |
| current=$(dig +noall +answer @ns1.afraid.org $DOMAIN|sed 's/.*\t\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*$/\1/g') |
| server { | |
| listen 80; | |
| server_name docker.yourdomain.com; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| upstream registry { | |
| server 192.168.3.10:5000; |
This is a simple example on how to interface with a TLC5973 IC to dim LEDs in Raspberry Pi.
It uses SPI to generate a pulse train with precise timing.
In Raspberry Pi, the SPI may have some inter-byte delay, which makes this useless. More here: https://www.raspberrypi.org/forums/viewtopic.php?t=211152
I'm using go-rpio to manage the SPI device.
The idea to use SPI came from this repo: https://github.com/mik4el/cc1350-swim-thermo/blob/b2fdb54a940e18911959a5e1778ca7fc06915a11/software/tlc5973_spimaster_CC1350_SWIMTHERMO_tirtos_ccs/spimaster.c