Skip to content

Instantly share code, notes, and snippets.

View j1elo's full-sized avatar

Juan Navarro j1elo

View GitHub Profile
@j1elo
j1elo / kurento-monorepo.sh
Created January 13, 2023 02:20
Monorepo merger for the Kurento project
#!/usr/bin/env bash
# Checked with ShellCheck (https://www.shellcheck.net/)
# Shell setup
# ===========
# Bash options for strict error checking.
set -o errexit -o errtrace -o pipefail -o nounset
shopt -s inherit_errexit 2>/dev/null || true
@j1elo
j1elo / kurento-openh264-packaging.txt
Created October 12, 2022 20:20
How to build Kurento packages with openh264 and openh264-gst-plugin
# Run as root or add `sudo` where needed.
# General tools.
apt-get update
apt-get install --no-install-recommends git ca-certificates build-essential devscripts dpkg-dev
# openh264
{
git clone --branch 7.0.0 https://github.com/Kurento/openh264.git
cd openh264
// Replacer function meant for `JSON.stringify()`.
function getCircularReplacer() {
const seen = new WeakSet();
return (_key, value) => {
// Non-null "object" properties: return a deep copy without circular references.
if (typeof value === "object" && value !== null) {
// Remove circular references.
if (seen.has(value)) {
// Option 1: Replace circular references with a string.
return "(circular)";
@j1elo
j1elo / findValues.js
Last active October 10, 2022 15:37
Prints the path to all values whose names match the given regular expression.
/**
* Prints the path to all values whose names match the given regular expression.
*
* @param {Object} input - An object that contains the parent from where to
* start searching recursively for all key names.
*
* The input object can be passed with just an standalone value, which then
* will be used itself as the prefix for the result.
*
* For example, for a parent object `root` which contains a hierarchy of
@j1elo
j1elo / 00-README.md
Created February 9, 2021 10:03 — forked from tdryer/00-README.md
How Linux approximates memory metrics

How Linux approximates memory metrics

Example

The program threads-memory.c (included below) starts 100 threads, allocates 1 MB of memory in each, and then pauses. How much memory is it using?

Let's find out by running it:

$ gcc -pthread threads-memory.c -o threads-memory

@j1elo
j1elo / cit0day-breach-check.sh
Created November 19, 2020 12:58
Cit0Day Breach Check
#!/bin/bash
# Step 1: Obtain a list of our personal hosts.
# Export from Bitwarden, LastPass, 1Password, or similar:
my_passwords.txt
# Next commands will assume the LastPass export format, which is CSV with the URL in the first field:
# url,username,password,[... more fields]
@j1elo
j1elo / HttpPostServer.py
Last active November 3, 2020 19:01
Sample HTTP POST server written with Python
# Run command:
#
# $ python3 HttpPostServer.py
#
# Test POST with a complete file:
#
# $ curl --data-binary "@small_file.bin" "http://127.0.0.1:8080/small.bin"
#
# Test POSTing a file progressively (chunked mode):
#
@j1elo
j1elo / github-merge.md
Created September 14, 2020 22:47
GitHub merge branch or PR
@j1elo
j1elo / sdp-offer-safari-13.1.txt
Last active August 27, 2020 18:03
SDP Offer (Safari 13.1)
v=0
o=- 4920969914039852086 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS 90c21009-8d9f-4b31-8091-d98deb8361c8
m=audio 61842 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 110 113 126
c=IN IP4 192.168.1.105
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2222700650 1 udp 2113937151 192.168.1.105 61842 typ host generation 0 network-cost 999
@j1elo
j1elo / sdp-offer-firefox-79.txt
Created August 27, 2020 17:59
SDP Offer (Firefox 79)
v=0
o=mozilla...THIS_IS_SDPARTA-79.0 1574413241511582424 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 43:63:A0:1A:D4:F3:6A:0B:B9:DC:AD:8B:A4:20:22:17:B9:BD:FC:81:9F:EC:E9:46:E0:61:3B:8B:2A:05:9A:D9
a=group:BUNDLE 0 1
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101