Skip to content

Instantly share code, notes, and snippets.

View restureese's full-sized avatar
😊

Ariska Restu Ginanjar restureese

😊
  • Yogyakarta - Banjarnegara
View GitHub Profile
{
"clientId": "urn:federation:MicrosoftOnline",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"https://login.microsoftonline.com/login.srf"
],
"webOrigins": [
@restureese
restureese / picam-stream.sh
Created October 4, 2021 09:38 — forked from russfeld/picam-stream.sh
Stream Raspberry Pi Camera to Twitch
#!/bin/bash
# =================================================================
# Stream configuration file for Raspberry Pi Camera
#
# @author Russell Feldhausen (russfeldh@gmail.com)
# @version 2019-06-05
#
# This set of commands should allow you to stream video from your
# Raspberry Pi Camera to Twitch and Youtube (and possibly other
@restureese
restureese / gs.sh
Created July 27, 2021 02:48 — forked from esrever10/gs.sh
gstreamer send and receive h264 rtp stream
# linux send h264 rtp stream:
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# Macos send h264 rtp stream:
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# receive h264 rtp stream:
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
@restureese
restureese / Nginx RTMP module on Ubuntu 18.04.md
Created July 21, 2021 09:21 — forked from amitkhare/Nginx RTMP module on Ubuntu 18.04.md
Nginx RTMP module on Ubuntu 18.04 with RTMPS support for Facebook live streaming Hardware and Software live-streaming encoders have typically used the RTMP streaming protocol. With the Facebook enforcement of the RTMPS encrypted live-stream some older hardware and software encoders can no longer work. By using the method below we can convert RTM…

update

sudo apt-get update
sudo apt-get upgrade

install nginx

sudo apt-get install nginx -y
sudo apt-get install libnginx-mod-rtmp -y
@restureese
restureese / search.js
Created June 24, 2021 09:28
Get object by value in array
var result = jsObjects.filter(obj => {
return obj.b === 6
})
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition,showError);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
localStorage.setItem("lat", position.coords.latitude);
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A PREROUTING -p tcp --dport 5000 -j DNAT --to-destination 192.168.100.101:5000
iptables -t nat -A POSTROUTING -j MASQUERADE
@restureese
restureese / index.html
Created January 22, 2021 03:17
Create Polygon with fabric js
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script src="https://unpkg.com/fabric@4.0.0-beta.12/dist/fabric.js"></script>
@restureese
restureese / gist:e06dae6f528c710f9b6ffd37c5f906f5
Created November 23, 2020 08:25
Convert MySql to postgress
pgloader mysql://localhost/db postgresql://localhost:5432/db
@restureese
restureese / longPolling.js
Created October 8, 2020 14:32 — forked from jasdeepkhalsa/longPolling.js
Simple Long Polling Example with JavaScript and jQuery by Tian Davis (@tiandavis) from Techoctave.com (http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery)
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();