Skip to content

Instantly share code, notes, and snippets.

View mrladeia's full-sized avatar
🎯
Focusing

Marcos Rodrigo Ladeia mrladeia

🎯
Focusing
View GitHub Profile
@mrladeia
mrladeia / rsync-loop.sh
Created June 24, 2016 02:37
Rsync reconnect automatically. Require sshpass (or no)
#!/bin/bash
while [ 1 ]
do
sshpass -p "PASSWORD" rsync --ignore-existing -r USER@HOST:/path/from/host /path/to/local -v --progress --stats
if [ "$?" = "0" ] ; then
echo "RSYNC FINISH"
exit
else
echo "RSYNC FAIL. WAIT, RECONNECTING..."
#!/bin/bash
#755 folders
#644 files
rsync -a --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r --files-from=/path/rsync-files.txt --ignore-existing -r /path/from user@host:/path/to -v --progress --stats
@mrladeia
mrladeia / youtube-playlist-to-url.ps
Last active November 2, 2019 23:17
get links youtube by playlist
$Playlist = ((Invoke-WebRequest "https://www.youtube.com/watch?v=XXXXXXX&list=XXXXXXXXXXXXXXXXXX&index=1").Links | Where {$_.class -match "playlist-video"}).href
ForEach ($Video in $Playlist) {
Write-Output ("https://www.youtube.com" + $Video)
}
@mrladeia
mrladeia / iptables.sh
Created September 16, 2018 18:12
Lista de excessão Iptables
iptables -A INPUT -p TCP --dport (port) -s A,B -j ACCEPT
iptables -A INPUT -p TCP --dport (port) -j DROP
After any days....... I add IP C
iptables -I INPUT -p tcp --dport (port) -s C -j ACCEPT
Or add in line 1
iptables -I 1 INPUT -p tcp --dport (port) -s C -j ACCEPT
CentOS
service iptables save
if ($("input#mobileNumber").length) {
var input = document.querySelector("input#mobileNumber");
window.intlTelInput(input, {
//initialCountry: "br",
autoPlaceHolder: "agressive",
utilsScript: "/vendors/js/tel-input/js/utils.js",
initialCountry: "auto",
preferredCountries: ["br", "pt", "us"],
@mrladeia
mrladeia / readme.md
Last active October 29, 2024 14:09
Iptables to Oracle Cloud port 80 and 443 open

IPTABLES to Oracle Cloud port 80 and 443 open

If you need to open up ports 80 and 443, on file /etc/iptables/rules.v4 just add

-A INPUT -p tcp -m state --state NEW -m multiport --dports 80,443 -j ACCEPT

directly below

@mrladeia
mrladeia / upload-image.py
Created February 28, 2020 04:15
Upload python script example - Chevereto - Imagem.app
import requests
url = "https://imagem.app/api/1/upload"
payload = {'key': 'YOUR_KEY','format': 'json'}
files = [
('source', open('imagem.png','rb'))
]
@mrladeia
mrladeia / Alternador.ahk
Last active January 12, 2021 04:21
Alternador de Janelas - Script para alternar janelas utilizando AutoHotKey. Switch windows using AutoHotKey
;Alternador de Janelas - Script para alternar janelas utilizando AutoHotKey
;Switch windows using AutoHotKey
GroupAdd, AllWindows
GroupActivate, Allwindows, R
;Arquivo Config.ini de exemplo:
;[Config]
;MostrarAvisoSegundos=5
;Segundos=30
@mrladeia
mrladeia / youtube-dl
Last active July 21, 2021 15:37
youtube-dl
sem merge
youtube-dl.exe -f best <url>
merge com ffmpeg
youtube-dl -f bestvideo+bestaudio <url>
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 <url>
youtube-dl.exe -f bestvideo+bestaudio --merge-output-format mp4 -a list.txt
@mrladeia
mrladeia / AutoClick_Coordenada.ahk
Last active June 13, 2022 14:22
Auto Click - Script para clicar em uma coordenada X,Y utilizando AutoHotKey. Script for clicking an X,Y coordinate using AutoHotKey
;Auto Click - Script para clicar em uma coordenada X,Y utilizando AutoHotKey
;Arquivo Config.ini de exemplo:
;[Params]
;SleepTime=250
;QtdLoop=1
;[XY]
;XY1=1631, 486
;XY2=1631, 568
;XY3=1631, 650