Skip to content

Instantly share code, notes, and snippets.

@moeiscool
moeiscool / ffmpegToWeb.js
Last active May 1, 2024 12:39
Streaming H.264 (RTSP Camera Stream Data from FFMPEG) over HTTP
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test
// How to Use
// 1. Start with `node ffmpegToWeb.js`
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1
// 3. Open VLC and "Open Network Stream".
// 4. Input the following without quotes : `http://127.0.0.1:8001` and start.
var child = require('child_process');
var events = require('events');
var spawn = child.spawn;
@moeiscool
moeiscool / ffmpegToWeb.js
Last active May 1, 2024 12:39
FFMPEG to Web Browser with Express, Socket.IO and JSMPEG
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test
// How to Use raw H.264 (Simulated RTSP)
// 1. Start with `node ffmpegToWeb.js`
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1
// 3. Open VLC and "Open Network Stream".
// 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start.
var child = require('child_process');
var io = require('socket.io');
var events = require('events');
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active May 1, 2024 12:39
Partition, format, and mount a drive on Ubuntu
@moeiscool
moeiscool / drive-format-ubuntu.md
Created September 21, 2018 15:51 — forked from keithmorris/drive-format-ubuntu.md
Partition, format, and mount a drive on Ubuntu
@PaulMougel
PaulMougel / client.js
Last active May 1, 2024 12:38
File upload in Node.js to an Express server, using streams
// node: v0.10.21
// request: 2.27.0
var request = require('request');
var fs = require('fs');
var r = request.post("http://server.com:3000/");
// See http://nodejs.org/api/stream.html#stream_new_stream_readable_options
// for more information about the highWaterMark
// Basically, this will make the stream emit smaller chunks of data (ie. more precise upload state)
var upload = fs.createReadStream('f.jpg', { highWaterMark: 500 });
@moeiscool
moeiscool / client.js
Created October 18, 2018 23:29 — forked from PaulMougel/client.js
File upload in Node.js to an Express server, using streams
// node: v0.10.21
// request: 2.27.0
var request = require('request');
var fs = require('fs');
var r = request.post("http://server.com:3000/");
// See http://nodejs.org/api/stream.html#stream_new_stream_readable_options
// for more information about the highWaterMark
// Basically, this will make the stream emit smaller chunks of data (ie. more precise upload state)
var upload = fs.createReadStream('f.jpg', { highWaterMark: 500 });
@memoryleak
memoryleak / create-monterey-iso.sh
Last active May 1, 2024 12:38
Create a Mac OS Monterey ISO file from the official installation DMG file
#!/usr/bin/env bash
sudo hdiutil create -o /tmp/Monterey -size 16g -volname Monterey -layout SPUD -fs HFS+J
sudo hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction
hdiutil eject -force /Volumes/Install\ macOS\ Monterey
hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Downloads/Monterey
mv -v ~/Downloads/Monterey.cdr ~/Downloads/Monterey.iso
sudo rm -fv /tmp/Monterey.dmg
@whatsmate
whatsmate / send-whatsapp.js
Last active May 1, 2024 12:38
Sending a WhatsApp message in Node.js
#!/usr/bin/env node
var http = require('http');
var instanceId = "YOUR_INSTANCE_ID_HERE"; // TODO: Replace it with your gateway instance ID here
var clientId = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Forever Green client ID here
var clientSecret = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Forever Green client secret here
var jsonPayload = JSON.stringify({
number: "12025550108", // TODO: Specify the recipient's number here. NOT the gateway number
@yonisetiawan
yonisetiawan / send-whatsapp.js
Created March 29, 2018 00:58 — forked from whatsmate/send-whatsapp.js
Sending a WhatsApp message in Node.js
#!/usr/bin/env node
var http = require('http');
var instanceId = "YOUR_INSTANCE_ID_HERE"; // TODO: Replace it with your gateway instance ID here
var clientId = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Forever Green client ID here
var clientSecret = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Forever Green client secret here
var jsonPayload = JSON.stringify({
number: "12025550108", // TODO: Specify the recipient's number here. NOT the gateway number
@moeiscool
moeiscool / send-whatsapp.js
Created November 7, 2018 21:01 — forked from yonisetiawan/send-whatsapp.js
Sending a WhatsApp message in Node.js
#!/usr/bin/env node
var http = require('http');
var instanceId = "YOUR_INSTANCE_ID_HERE"; // TODO: Replace it with your gateway instance ID here
var clientId = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Forever Green client ID here
var clientSecret = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Forever Green client secret here
var jsonPayload = JSON.stringify({
number: "12025550108", // TODO: Specify the recipient's number here. NOT the gateway number