Skip to content

Instantly share code, notes, and snippets.

View akbaryahya's full-sized avatar

Akbar Yahya akbaryahya

View GitHub Profile

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features
@mattia-beta
mattia-beta / ddos.conf
Last active May 28, 2024 23:29
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
@dodiku
dodiku / device_orientation.js
Last active July 23, 2019 16:08
This code gets the device movement and orientation data, and appends it to the DOM's body.
/* might be good to use this library -
https://github.com/dorukeker/gyronorm.js */
function handleOrientation(event) {
var absolute = event.absolute;
var alpha = event.alpha;
var beta = event.beta;
var gamma = event.gamma;
$(".alpha").text("alpha (z axis, 0 to 360): " + alpha);
@fasiha
fasiha / README.md
Last active October 2, 2022 22:36
Pitch (fundamental frequency) detection using (1) harmonic product spectrum, (2) Blackman-Tukey spectral estimator, and (3) Welch spectral estimator.

Experimenting with pitch detection and spectral estimators

See the question and discussion on StackOverflow: How to get the fundamental frequency using Harmonic Product Spectrum?.

We’re trying to estimate the fundamental frequency of a voiced A4 note (440 Hz). (See the question for link to audio clip.)

Harmonic product spectrum

Result: full data, 0 to 2 KHz

@gabonator
gabonator / password.txt
Last active May 23, 2024 19:15
HiSilicon IP camera root passwords
Summary of passwords by sperglord8008s, updated November 1. 2020. For login try "root", "default", "defaul" or "root"
00000000
059AnkJ
4uvdzKqBkj.jg
7ujMko0admin
7ujMko0vizxv
123
1111
1234
@gabonator
gabonator / camera.md
Created June 4, 2016 13:48
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@RedToor
RedToor / btDVR.py
Last active November 8, 2023 19:41
BruteForce IP CAMERA H.264 DVR - Exploit
# Exploit Title: BruteForce IP CAMERA H.264 DVR
# Google Dork: intext:Any time & Any where IP Surveillance for Your Life
# Date: 10/2/15
# Exploit Author: RedToor
# Source: https://gist.github.com/RedToor/71a109a7732884714e8ee07f61cfda59
# Version: ALL
# Tested on: Windows and Linux
# USE:
# python btDVR.py -h 127.0.0.1 -p 3000 -l passwords.txt -u admin
#
@mojoaxel
mojoaxel / getImageAndSaveToFTP.sh
Created January 14, 2016 19:42
Upload image from AirCam to Wunderground (FTP)
#!/bin/bash
# Download image from AirCam
curl --insecure -o image.jpg https://XXX.XXX.XXX.XXX/snapshot.cgi?chan=1
# create folder archive if it doesn't already exist
mkdir -p archive
# save image to archive
cp image.jpg archive/webcam_$(date +"%Y%m%d-%H%M").jpg
@davestevens
davestevens / LetsEncrypt.md
Last active March 28, 2024 10:35
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
// a really, really simple proxy to request
// non-CORS enabled webservices
// Drop this script on your server and prepend
// the url you want to access like e.g.
// $.getJSON("http://pathtouyourserver.com/folderwiththisscript/corsproxy.php?url=http://theapiwithoutcors.com").success(....
//
// You find a more sophisticated one here: http://benalman.com/projects/php-simple-proxy/
<?php
$url = $_GET['url'];
$content = file_get_contents($url);