Skip to content

Instantly share code, notes, and snippets.

View J-Rojas's full-sized avatar

J-Rojas

View GitHub Profile
@alexellis
alexellis / README.md
Last active February 8, 2021 20:50
Provision faasd 0.7.5 on DigitalOcean with Terraform 0.12.0
  1. Sign up to DigitalOcean
  2. Download Terraform
  3. Clone this gist using the URL from the address bar
  4. Run terraform init
  5. Run terraform apply -var="do_token=$(cat $HOME/digitalocean-access-token)"
  6. View the output for the login command and gateway URL i.e.
gateway_url = http://178.128.39.201:8080/
login_cmd = faas-cli login -g http://178.128.39.201:8080/ -p rvIU49CEcFcHmqxj
@jaxxzer
jaxxzer / pipelines.txt
Last active December 12, 2023 22:54
gstreamer pipelines
// rtsp receivers:
gst-launch-1.0 rtspsrc location="rtsp://192.168.0.102:8554/test" protocols=GST_RTSP_LOWER_TRANS_TCP latency=0 ! rtph264depay ! decodebin ! videoconvert ! autovideosink sync=false
gst-launch-1.0 rtspsrc location=rtsp://192.168.1.156:8554/test ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
// Stream video to window and record it to file
gst-launch-1.0 -e -v udpsrc port=5600 ! tee name=VIDEOWINDOW ! queue ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! h264parse ! mp4mux ! filesink location=myvideo.mp4 VIDEOWINDOW. ! queue ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@pgilad
pgilad / Instructions.md
Last active March 27, 2024 12:59
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@jedi4ever
jedi4ever / gist:d095656ae0f0eca4a83ebb2b331da367
Last active January 11, 2024 22:01
Chromium build with proprietary codecs
@cyberang3l
cyberang3l / How to setup VirtualGL and TurboVNC on Ubuntu.md
Last active March 23, 2024 05:52
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
@narate
narate / create-hotspot.md
Last active April 15, 2024 14:22
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@Hebali
Hebali / GlslSobel.frag
Created January 12, 2017 17:25
GLSL Fragment Shader: Sobel Edge Detection
// Sobel Edge Detection Filter
// GLSL Fragment Shader
// Implementation by Patrick Hebron
uniform sampler2D texture;
uniform float width;
uniform float height;
void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord)
{
@wonderbeyond
wonderbeyond / graceful_shutdown_tornado_web_server.py
Last active February 22, 2023 05:34 — forked from mywaiting/graceful_shutdown_tornado_web_server.py
The example to how to shutdown tornado web server gracefully...
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID`,
The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
"""
import time
@ahem
ahem / loadimage.js
Created October 18, 2016 12:59
Load and decode images with webworker
/* global createImageBitmap */
function loadImageWithImageTag(src) {
return new Promise((resolve, reject) => {
const img = new Image;
img.crossOrigin = '';
img.src = src;
img.onload = () => { resolve(img); };
img.onerror = () => { reject(img); };
});