Skip to content

Instantly share code, notes, and snippets.

View brandonb927's full-sized avatar

Brandon Brown brandonb927

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,

@soxrok2212
soxrok2212 / Reolink RLC-810A Homebridge 4K Configuration.md
Last active June 19, 2024 16:34
Reolink RLC-810A Homebridge 4K Configuration
@mikkipastel
mikkipastel / app.js
Last active March 14, 2024 03:46
sample for cronjob in Discord.js for alert with standup meeting
const cron = require('node-cron');
const Discord = require("discord.js");
const client = new Discord.Client();
client.once('ready', async () => {
common.log('Ready!');
try {
const webhook = new Discord.WebhookClient(process.env.WEBHOOK_ID, process.env.WEBOOK_TOKEN);
@taniarascia
taniarascia / auth.md
Last active July 5, 2024 05:43
JavaScript Authentication & Authorization Book/Course

Authentication in Real-World Web Apps with JavaScript

Outline of ideas, concepts to cover, potential projects to write.

Setup Idea

  • Book with a video for each chapter.

Prerequisites/Overview

@mmaday
mmaday / s3-get.sh
Last active April 2, 2024 06:46 — forked from jpillora/s3get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@loranmutafov
loranmutafov / iframe.commands.js
Last active January 9, 2024 19:18
Cypress command to wait for iframes to load
/**
* Will check if an iframe is ready for DOM manipulation. Just listening for the
* load event will only work if the iframe is not already loaded. If so, it is
* necessary to observe the readyState. The issue here is that Chrome initialises
* iframes with "about:blank" and sets their readyState to complete. So it is
* also necessary to check if it's the readyState of the correct target document.
*
* Some hints taken and adapted from:
* https://stackoverflow.com/questions/17158932/how-to-detect-when-an-iframe-has-already-been-loaded/36155560
*
@tpiros
tpiros / robbyrussell.zsh-theme
Created November 1, 2019 10:39
Adding emojis to ZSH theme
# On a Mac: /Users/<username>/.oh-my-zsh/custom/themes
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local emojis=("👋" "🤡" "🦄" "🤙" "🐼" "😊" "🔥" "⚡" "😎" "🌎")
local selectedEmoji=${emojis[$[1+($RANDOM%${#emojis[@]})]]}
local today=$(date +%m.%d)
# local ipCountry=`curl -s ip-api.com/json | python -c "import sys, json; print json.load(sys.stdin)['country']"`
# local country=$emoji_flags[${ipCountry}]
# }
case $today in
"01.01")
@webpro
webpro / 1_runner.js
Last active May 26, 2019 19:00
Minimal test runner that covers most of your needs
const util = require('util');
const result = title => err => {
if (err instanceof Error) {
console.log(`✖ ${title}`);
console.error(err.actual || err);
} else {
console.log(`✔ ${title}`);
}
};