Skip to content

Instantly share code, notes, and snippets.

View rocel's full-sized avatar

Damien Chaillou rocel

  • WHM
  • Niteroi, Brazil / Nantes, France
  • X @dragda
View GitHub Profile
@milesrichardson
milesrichardson / open-vlc-m3u8-url-with-http.md
Created July 10, 2024 21:50
How to use VLC to watch m3u8 playlist at URL with custom HTTP referrer and user agent

Imagine this: it's Sunday afternoon at 1pm, and you want to watch some live content. But you don't have a TV subscription. So you do a little Googling, and eventually you find yourself on a sketchy website where you can watch the content you're looking for. But while the website has a video player, it's surrounded by advertisements, and probably a cryptominer too. You don't want this website eating your CPU for 2 hours while you're watching your favorite Sunday afternoon content.

Wouldn't it be nice if you could watch that video in VLC instead? Then you can close the sketchy website and still watch your content. It's like having your cake and taking a bite of it too!

Here's how you do it:

  1. Capture the m3u8 request in dev tools. Open the site (or just the iframe, if possible) in DevTools and click "play." Search the network tab for m3u8 and grab the first request.

  2. Run VLC with command line flags to set the User Agent and Referrer. From the request body, you need to copy the requested URL,

@fulmicoton
fulmicoton / leader_election_scuttlebutt.txt
Last active September 29, 2022 00:44
Leader election on top of scuttlebutt.
Leader election on top of Scuttlebutt.
-----------------------------------------------
The following makes it possible to cheaply get a leader election
on top of a Cassandra-like membership using scuttlebutt + phi accrual detection.
# TDLR about Scuttlebutt and phi accrual detection
Scuttlebutt is a anti-entropy gossip algorithm.
It makes it possible for every node in a cluster to
@kaaquist
kaaquist / podman_macos.md
Last active April 19, 2025 13:43
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@Lowess
Lowess / DatabricksPushgatewayExporter.py
Last active December 13, 2024 07:21
Databricks Prometheus Integration
import os
import threading
import urllib.request
import logging
from time import sleep
__author__ = "Florian Dambrine <[email protected]>"
class DatabricksPushgatewayExporter:
"""
@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
@dacr
dacr / index.md
Last active April 5, 2025 07:36
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/3d5c87884060c3d7f6d0a83ab732c819503365eb

David's programming examples knowledge base

akka-pekko

I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

graph = JanusGraphFactory.open('conf/janusgraph-cassandra-es.properties')
g = graph.traversal()
entityToId = [:]
new File('data/nodes.csv').eachLine { line, count ->
// Skip header
if (count > 1){
columns = line.split(',', -1)
@borgstrom
borgstrom / human_time_duration.py
Created May 9, 2018 04:00
Python: Convert seconds (duration) to human readable string
TIME_DURATION_UNITS = (
('week', 60*60*24*7),
('day', 60*60*24),
('hour', 60*60),
('min', 60),
('sec', 1)
)
def human_time_duration(seconds):
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created