Skip to content

Instantly share code, notes, and snippets.

@cahna
cahna / broadcast-obs-to-dev-video2.md
Last active July 10, 2022 01:20
Linux: Fake webcam device to broadcast custom content

HOWTO: Setup "fake" webcam video device for custom content

  • Once configured, select the new video device (/dev/video2 in this example) as input device for client program.
  • Example use: Broadcast custom video/images to group video chat (ex: Zoom/Skype/etc)
  • Tested working on: Manjaro Linux 5.4
  1. Install OBS and prerequisites for building plugin and kernel module:
pacman -S base-devel cmake obs-studio
@cahna
cahna / mergeCidrRanges.js
Last active April 12, 2020 03:59
JavaScript: Merge overlapping CIDR ranges and return as start/end IP ranges
const { Address4 } = require('ip-address');
function ipToInt(ipString) {
return ipString.split('.')
.map(str => parseInt(str, 10))
.map((octet, i) => (octet ? octet * 256 ** (3 - i) : 0))
.reduce((a, b) => (a + b));
}
function mergeCidrRanges(cidrStrings) {