Skip to content

Instantly share code, notes, and snippets.

View rafaelbiriba's full-sized avatar
🏠
Working from home

Rafael Biriba rafaelbiriba

🏠
Working from home
View GitHub Profile
@rafaelbiriba
rafaelbiriba / storj_healthcheck.sh
Created January 24, 2025 00:09
Storj Bash Script for Docker Healthcheck + Report via Whatsapp (callmebot api)
#!/bin/bash
# Configuration
CALLMEBOT_API="https://api.callmebot.com/whatsapp.php"
PHONE_NUMBER="4917632323232"
API_KEY="12345678"
DOCKER_CONTAINERS=("storagenode1" "storagenode2")
STORAGE_PATHS=("/mnt/user/Storj/" "/mnt/user/Storj2/")
IDENTITY_PATHS=("/mnt/user/appdata/storj/Identity/storagenode/" "/mnt/user/appdata/storj/Identity/storagenode2/")
NODE_API_URLS=("http://192.168.0.2:14002/api/sno/" "http://192.168.0.2:14003/api/sno/")
@rafaelbiriba
rafaelbiriba / docker-compose.yml
Last active December 13, 2024 01:43
Torrent Box - my docker-compose
# To download this file, use the following command:
# curl -o docker-compose.yml https://gist.githubusercontent.com/rafaelbiriba/2771772f130dd0b6bbfef98b5a9001db/raw/docker-compose.yml
version: "3.8"
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:

layout: post title: Curso gratuito de programação em ruby para iniciantes excerpt: "Nunca é tarde para começar a programar! Eu criei um curso gratuito, fácil e didático voltado para iniciantes. Confira mais informações aqui nessa publicação." category: [br, programacao] lang: br tags: [programação, tecnologia, curso, ruby, iniciantes] comments: true share: true ads: true

@rafaelbiriba
rafaelbiriba / tree-report.sh
Last active September 22, 2024 20:20
Generate tree report file on NAS and send it by email (optional)
#!/bin/bash
# Creates DISK0.tree, DISK1.tree, DISKx.tree inside each disk, with the output of tree command.
# After generating the report, it send via email using mail.
# To add more disks, just add DISK[x]=/full/path to the disk. Just make sure that the array index are sequencial.
# Why this?
# With the reports from tree, in case of disk failure, you will know which file got lost and you can recover them, downloading or via backups.
# GIST: https://gist.github.com/rafaelbiriba/0ee7ca2baec1ef80a878c825295f09e1
EMAIL_ADDRESS="" # EMAIL_ADDRESS="[email protected]" or leave it blank "" to disable email
DISKS[0]="/srv/dev-disk-by-id-ata-WDC_WD80EMAZ-00WJTA0_ABC123-part1"
@rafaelbiriba
rafaelbiriba / selenium-playground.rb
Last active May 27, 2020 12:56
selenium ruby playground
require 'rubygems'
require 'bundler/setup'
require "selenium-webdriver"
require "faker"
def generate_email
domains = ["example.com", "example2.com"]
Faker::Internet.unique.email(domain: domains.sample, separators: ".")
end
class User < ActiveRecord::Base
DEFAULT_PERMISSION = ["read", "write", "share"]
end
class Hash
def difference(subtrahend)
# create a hash which contains all normalized keys
all_pairs = (self.keys.map{|x| x.downcase} + subtrahend.keys.map{|x| x.downcase}).uniq.inject({}) do |pairs, key|
pairs[key] = []
pairs
end
#=> {"mouse"=>[], "cat"=>[], "snake"=>[], "bird"=>[], "dog"=>[]}
# push original key value pairs into array which is the value of just created hash
puts "hello"
@rafaelbiriba
rafaelbiriba / install_ffmpeg_libfdkaac.sh
Last active July 25, 2024 03:04
Install FFmpeg with libfdk_aac support (For Ubuntu)
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git