Skip to content

Instantly share code, notes, and snippets.

Avatar
💾
flopping around

Gonçalo Baltazar goncalomb

💾
flopping around
View GitHub Profile
@goncalomb
goncalomb / install-snapraid.sh
Created Oct 4, 2020
Compile and Install SnapRAID on Linux (tested on Mint and Raspberry Pi OS). Requires make, gcc and friends...
View install-snapraid.sh
#!/bin/bash
set -ex
mkdir -p snapraid
cd snapraid
REL_JSON=$(curl -sS "https://api.github.com/repos/amadvance/snapraid/releases/latest" | grep browser_download_url)
if [[ ! "$REL_JSON" =~ \"browser_download_url\":\ \"https:\/\/github.com\/[^\"]+\/releases\/download\/v([^\"]+)\/(snapraid-[^\"]+.tar.gz)\" ]]; then
@goncalomb
goncalomb / ytdl-max-dump.sh
Last active Aug 20, 2020
download all youtube channel videos with maximum information
View ytdl-max-dump.sh
#!/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 / k8s-node-gate.sh
Last active Jun 30, 2020
Open a root shell on a Kubernetes cluster Node (no ssh).
View k8s-node-gate.sh
#!/bin/sh
# Copyright (c) 2019 Gonçalo Baltazar <me@goncalomb.com>
# MIT License
# Open a root shell on a Kubernetes cluster Node (no ssh).
# It uses a privileged container to unlock Linux capabilities and chroot to
# change into the root filesystem of the Node for full access.
@goncalomb
goncalomb / grafana-kiosk
Created May 12, 2019
Startup script to create Grafana based kiosks.
View grafana-kiosk
#!/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 Feb 5, 2019
Kubernetes context protector and utilities
View k8s-protect
# 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
View yt-part.sh
#!/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 / skyt.py
Created Apr 23, 2018
Extract and index the SkyTorrents dump.
View skyt.py
#!/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
@goncalomb
goncalomb / oddshot-archive.php
Last active Apr 23, 2018
Oddshot archiver. It's dead now.
View oddshot-archive.php
#!/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 Jan 22, 2018
Script to choose your garlicoin mining pool, with logging.
View garlicoin-miner-run.sh
#!/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:
View 000-yogscast-comments-mkgifs.sh
#!/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"
You can’t perform that action at this time.