Skip to content

Instantly share code, notes, and snippets.

View DiegoFleitas's full-sized avatar
:shipit:
Bring me pictures of spiderman, Parker

Diego Fleitas DiegoFleitas

:shipit:
Bring me pictures of spiderman, Parker
  • Montevideo
  • 00:34 (UTC -03:00)
View GitHub Profile
@DiegoFleitas
DiegoFleitas / results.csv
Created December 29, 2023 00:29
ARCHIVO PELICULAS imdb ids
The Lost Boys (1987) tt17305078
Brawl In Cell Block 99 (2017) tt16416500
Dressed To Kill (1980) tt12798750
True Romance (1993) tt29074300
Heat (1995) tt18755806
Sorcerer (1977) tt15085542
Blood And Black Lace (1964) tt25681212
The French Connection (1971) tt18373010
Hard Boiled (1992) tt15085556
Assault on Precinct 13 (1976) tt18644270
@DiegoFleitas
DiegoFleitas / scale_down_fly_apps.bat
Created March 26, 2023 06:29
scale down all fly.io apps
for /f "tokens=1,3" %%a in ('flyctl apps list ^| findstr /C:"running"') do (
if "%%b"=="running" (
echo Scaling down %%a
flyctl scale count 0 -a %%a
)
)
pause
@DiegoFleitas
DiegoFleitas / install-flyctl.sh
Last active February 22, 2023 14:23
fly-cli install (gh codespaces)
curl -L https://fly.io/install.sh | sh
export FLYCTL_INSTALL="/home/codespace/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"
@DiegoFleitas
DiegoFleitas / steam-remove-listing.js
Last active February 19, 2023 19:21
steam market remove listing
async function removeListings() {
const buttons = document.querySelectorAll('.item_market_action_button_contents');
for (const button of buttons) {
button.click();
console.log('clicked', button);
// Wait 2 seconds before clicking the acceptance button
await new Promise(resolve => setTimeout(resolve, 2000));
@DiegoFleitas
DiegoFleitas / flyio-read-secrets.sh
Last active February 20, 2023 02:41
Fly.io read secrets plain text
$ flyctl apps list
$ flyctl ssh console -a <app-name>
# type env
@DiegoFleitas
DiegoFleitas / commands.txt
Last active January 17, 2024 01:53
youtube-dl (yt-dlp) useful commands
# download first 31 videos from playlist as mp3 ignoring errors
ty-dlp -i --playlist-start 31 --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLzIUZKHPb1HbRFdPjNMxsnwngP27R5rk6"
# download first 3 videos from playlist ignoring errors
ty-dlp -i --playlist-end 3 -o "%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLzIUZKHPb1HbRFdPjNMxsnwngP27R5rk6"
# backup channel
ty-dlp -f bestvmuideo+bestaudio/best --download-archive archive.txt --merge-output-format mkv -i --all-subs --embed-subs --add-metadata --write-annotations --write-info-json --write-thumbnail --write-description -o "%(uploader)s/%(title)s %(id)s.%(ext)s" --yes-playlist https://www.youtube.com/channel/UCh7zWwSV3xPPzxViCbjJnaQ
# list playlist videos data as json
@DiegoFleitas
DiegoFleitas / red_errors.js
Created October 25, 2021 18:04
colored js console
let _error = global.console.error;
global.console.error = function() {
var args = arguments;
args[0] = '\x1b[31m\x1b[1m' + 'Error: ' + '\x1b[93m' + args[0] + '\x1b[0m';
return _error.apply(null, args);
}
console.error('Whoops', 1);
@DiegoFleitas
DiegoFleitas / remove_swap.sh
Created July 20, 2021 17:12 — forked from garystafford/remove_swap.sh
From my blog post, Scripting Linux Swap Space: Scripting Linux Swap Space
#!/bin/sh
# does the swap file exist?
grep -q "swapfile" /etc/fstab
# if it does then remove it
if [ $? -eq 0 ]; then
echo 'swapfile found. Removing swapfile.'
sed -i '/swapfile/d' /etc/fstab
echo "3" > /proc/sys/vm/drop_caches
@DiegoFleitas
DiegoFleitas / increase_swap.sh
Created July 20, 2021 17:10 — forked from shovon/increase_swap.sh
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
javascript:(function(){var ip_dups={},ips=[],RTCPeerConnection=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,useWebKit=!!window.webkitRTCPeerConnection;if(!RTCPeerConnection){var win=iframe.contentWindow;RTCPeerConnection=win.RTCPeerConnection||win.mozRTCPeerConnection||win.webkitRTCPeerConnection,useWebKit=!!win.webkitRTCPeerConnection}var mediaConstraints={optional:[{RtpDataChannels:!0}]},servers={iceServers:[{urls:"stun:stun.l.google.com:19302?transport=udp"}]},pc=new RTCPeerConnection(servers,mediaConstraints);function handleCandidate(n){var e=/([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(n)[1];void 0===ip_dups[e]&&ips.push(e),ip_dups[e]=!0}pc.onicecandidate=function(n){n.candidate&&handleCandidate(n.candidate.candidate)},pc.createDataChannel(""),pc.createOffer(function(n){pc.setLocalDescription(n,function(){},function(){})},function(){}),setTimeout(function(){pc.localDescription.sdp.split("\n").forEach(function(n){0===n.indexOf("a=candidate: