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 / youtube-playlist-to-url.ps
Last active November 20, 2024 03:31
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)
}
#!/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 / 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..."