This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
DEFAULT_PERMISSION = ["read", "write", "share"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "hello" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |