Skip to content

Instantly share code, notes, and snippets.

@karolba
karolba / alpine-on-stardust-no-rescue.md
Last active November 12, 2023 16:47
Install Alpine Linux on Scaleway Stardust without the rescue image using https://netboot.xyz

A way to install Alpine Linux on a Scaleway Stardust instance without the use of a rescue image, but by booting into the install image over the network using https://netboot.xyz.

  1. Connect to the serial console, using scw instance server console {uuid} zone={zone}

  2. Reboot the VM into UEFI settings

    • either by executing systemctl reboot --firmware on the machine
    • or by using scw instance server reboot {uuid} zone={zone} locally and repeatedly mashing the escape key on the serial console image
  3. Go to Device Manager -> Network Device List -> the only network device -> HTTP Boot Configuration -> Boot URI

#!/usr/bin/env python3
import os
import bencode
import re
import sys
# Inspired by https://github.com/ctminime/QB_Migrate_to_Linux
# Need `pip3 install bencode.py`.
# Run in folder like "/home/user/.local/share/data/qBittorrent/BT_backup/" (configured in qBitTorrent).
# Takes 2 parameters:
@cheadrian
cheadrian / Youtube_Livestream_Parts_download.py
Last active January 18, 2022 21:08
Download Youtube Live streamed video from the start or selected time
#With the help of this script you can download parts from the Youtube Video that is live streamed, from start of the stream till the end
import urllib.request
import os
#E.G: "https://r4---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603041842& ..... 2.20201016.02.00&sq="
#The sound link should contain: &mime=audio in it.
#Here's an example from NASA LIVE:
#VIDEO: https://r5---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603165657&ei=eQmOX8TeFtS07gO1xLWwDA&ip=79.115.11.159&id=DDU-rZs-Ic4.1&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160&source=yt_live_broadcast&requiressl=yes&mh=PU&mm=44%2C29&mn=sn-gqn-p5ns%2Csn-c0q7lnsl&ms=lva%2Crdu&mv=m&mvi=5&pl=20&initcwndbps=1350000&vprv=1&live=1&hang=1&noclen=1&mime=video%2Fmp4&gir=yes&mt=1603143920&fvip=5&keepalive=yes&fexp=23915654&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Clive%2Chang%2Cnoclen%2Cmime%2Cgir&sig=AOq0QJ8wRQIgQMnxy1Yk3HLTpqbOGmjZYH1CXCTNx6u6PgngAVGi4EQCIQDWyaye-u_KGyVQ0HRUsyKVaAzyXbmzDqOGVGpIyP7VtA%3D%3D&lspa
@jakejarvis
jakejarvis / cloudflare-ufw.sh
Created December 6, 2019 04:35
UFW rule updater to only allow HTTP and HTTPS traffic from Cloudflare IP address ranges
#!/bin/sh
#
# UFW rule updater to only allow HTTP and HTTPS traffic from Cloudflare IP addresses.
# Inspired by https://github.com/Paul-Reed/cloudflare-ufw/blob/master/cloudflare-ufw.sh
#
# To run as a daily cron job:
# 1. sudo crontab -e
# 2. Add this line to the end:
# @daily /this/file/location/cloudflare-ufw.sh &> /dev/null
#!/usr/bin/env bash
CIPHERS='ALL:eNULL'
DELAY=${2:-0.1}
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]}
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}')
echo Using $(openssl version).
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites )
@ZeppLu
ZeppLu / serve_http.py
Last active August 23, 2023 09:47
Simple Python HTTP Server with multi-threading, partial-content, basic authentication and IPv6 support
#!/usr/bin/env python3
# Standard library imports.
from socketserver import ThreadingMixIn
from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, splitext,
isdir, basename, expanduser, split, splitdrive)
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active May 4, 2024 15:47
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@4ft35t
4ft35t / xdown.sh
Last active August 4, 2017 04:35
Download file use ISP's cache server for more speed.
#!/bin/bash
[ $# -eq 0 ] && echo "see aria2c -h" && exit
url=""
cdn='
120.52.73.2
120.52.73.4
120.52.73.6
120.52.73.7
120.52.73.10
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq