Skip to content

Instantly share code, notes, and snippets.

View goncalomb's full-sized avatar
💾
flopping around

Gonçalo MB goncalomb

💾
flopping around
View GitHub Profile
@goncalomb
goncalomb / ytdl-max-dump.sh
Last active August 20, 2020 20:43
download all youtube channel videos with maximum information
#!/bin/bash
# Copyright (c) 2020 Gonçalo Baltazar <me@goncalomb.com>
# MIT License
# download all youtube channel videos with maximum information
# pip3 install --upgrade youtube-dl
# ffmpeg -y -loglevel repeat+info -i file:video.xyz -i file:audio.xyz -c copy -map 0:v:0 -map 1:a:0 file:out.mkv
@goncalomb
goncalomb / grafana-kiosk
Created May 12, 2019 15:40
Startup script to create Grafana based kiosks.
#!/bin/bash
# Copyright (c) 2019 Gonçalo Baltazar <me@goncalomb.com>
# MIT License
# Grafana Dashboard Kiosk using Google Chrome (or Chromium)
# opens an independent google chrome instance with a custom
# extension that injects Authorization headers for grafana
@goncalomb
goncalomb / k8s-protect
Last active February 5, 2019 23:07
Kubernetes context protector and utilities
# Kubernetes context protector and utilities
# Copyright (c) 2019 Gonçalo Baltazar <me@goncalomb.com>
# MIT License
# protects from accidental operations to the incorrect kubectl context
# alerts the user when calling `kubectl` and `helm` on a production context
# assumes that `kubectl` and `helm` are installed and available on PATH
@goncalomb
goncalomb / skyt.py
Created April 23, 2018 21:52
Extract and index the SkyTorrents dump.
#!/usr/bin/env python3
"""
--------------------------------------------------------------------------------
Copyright (c) 2018 Gonçalo Baltazar <me@goncalomb.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
#!/bin/bash
# Partial YouTube downloader (bash script for Windows).
# goncalomb (goncalomb.com), 2018
set -e
cd "$(dirname -- "$0")"
[ -f "youtube-dl.exe" ] || {
echo "Downloading youtube-dl..."
@goncalomb
goncalomb / oddshot-archive.php
Last active April 23, 2018 21:13
Oddshot archiver. It's dead now.
#!/usr/bin/env php
<?php
// oddshot archiver
// Gonçalo Baltazar <me@goncalomb.com>
// I place this code in the public domain.
// https://creativecommons.org/publicdomain/zero/1.0/
$channels_to_archive = [
@goncalomb
goncalomb / garlicoin-miner-run.sh
Last active January 22, 2018 19:21
Script to choose your garlicoin mining pool, with logging.
#!/bin/bash
# Script to choose your garlicoin mining pool, with logging.
# If you find it useful, I'm accepting some garlic at: GNHARsNxMKqXH8xNmSR9cc8RJqDNfKgMvj
# Thanks.
# On Linux:
# Put the spript anywhere.
# Run as any other spript (using the terminal).
# On Windows:
#!/bin/bash
# All GIFS and VIDEOS at:
# https://gist.github.com/goncalomb/0611db6ae883756c345a7802f2fdef85/f2f6e08b971884d4eca5d4ac9f5df13fb14fff1c
# Original Video:
# https://www.youtube.com/watch?v=BMYxImN6EBo
video="video_BMYxImN6EBo.mp4" # 720p
fontr="/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf"
fontb="/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf"
@goncalomb
goncalomb / base62.php
Last active February 19, 2016 21:20
Integer to/from Base62 in PHP
<?php
// Author: Gonçalo Baltazar <me@goncalomb.com>
// I place this code in the public domain.
/**
* Functions to encode/decode an integer to/from base62.
* It is limited to positive integers up to BASE62_MAX to make sure it works on
* 32-bit systems.
*/
@goncalomb
goncalomb / keybase.md
Last active February 8, 2016 16:34
keybase.md

Keybase proof

I hereby claim:

  • I am goncalomb on github.
  • I am goncalomb (https://keybase.io/goncalomb) on keybase.
  • I have a public key whose fingerprint is 371E 4E46 355E 1A01 26F3 2DFB 8332 4011 5C12 E219

To claim this, I am signing this object: