Skip to content

Instantly share code, notes, and snippets.

View wouterds's full-sized avatar
:octocat:
Hello world!

Wouter wouterds

:octocat:
Hello world!
View GitHub Profile
@wouterds
wouterds / m3u8-to-mp4.md
Created March 20, 2020 07:27 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
This method also works with wireless doorbells and other similar systems.
We're gonna need a RTL-SDR, which is basically a radio dongle and a cheap radio transmitter.
We will also need a microcontroller to interface with the transmitter, any Arduino would do it.
You can get one for less than 8$ on Ebay, a 433MHz radio transmitter for less than 1$ and any kind of arduino clone for less than 3$.
Let's start...
First you need to install the drivers for the RTL-SDR, the Arduino IDE if you don't already have it,
the Audacity Audio Analyser/Editor and finally a spectrum analyzer, you can use http://airspy.com/?ddownload=3130 SDR# or https://github.com/pothosware/pothos/wiki/Downloads GQRX in Windows and https://github.com/pothosware/pothos/wiki/Downloads GQRX on linux.
@wouterds
wouterds / useAppState.ts
Created February 22, 2020 17:09
React Native useAppState hook
import { useState, useEffect, useCallback } from 'react';
import { AppState, AppStateStatus } from 'react-native';
const useAppState = () => {
const [appState, setAppState] = useState(AppState.currentState);
const handleAppStateChange = useCallback(
(nextAppState: AppStateStatus) => {
setAppState(nextAppState);
},
[setAppState],
version: "3.3"
services:
server01:
image: containous/whoami
container_name: service
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.whoami-http.rule=Host(`service.server.com`)"
version: "3.3"
services:
traefik:
image: traefik:2.1
container_name: reverse-proxy
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
@wouterds
wouterds / docker-compose.yml
Created February 9, 2020 11:14
Traefik reverse proxy with letsencrypt & auto forwarding of http to https
version: "3.3"
services:
traefik:
image: traefik:2.1
container_name: reverse-proxy
command:
- "--api.insecure=true"
- "--providers.docker=true"
@wouterds
wouterds / setup.sh
Created February 9, 2020 10:23
Droplet setup essentials
# login
ssh root@server
# install updates
sudo apt-get update && sudo apt-get upgrade -y
# install some utils
sudo apt-get install -y git zsh wget curl htop
# firewall
@wouterds
wouterds / Dockerfile
Created August 3, 2019 20:14
Phantomjs support for Nodejs Alpine Docker container
ENV PHANTOMJS_VERSION 2.1.1
RUN apk add --update --no-cache curl && \
curl -Ls https://github.com/dustinblackman/phantomized/releases/download/${PHANTOMJS_VERSION}/dockerized-phantomjs.tar.gz | tar xz -C / && \
curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 | tar -jxvf - -C . && \
cp phantomjs-${PHANTOMJS_VERSION}-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs && \
rm -fR phantomjs-${PHANTOMJS_VERSION}-linux-x86_64 && \
apk del curl
@wouterds
wouterds / samples.sql
Last active July 17, 2019 08:12
I want to select data between day x and day y returned as z amount of rows (scaled down data set).
CREATE TABLE IF NOT EXISTS `samples` (
`id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`value` float(8,2) NOT NULL,
`createdAt` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `samples_created_at` (`createdAt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `samples` (`id`, `value`, `createdAt`)
VALUES
CREATE USER 'user'@'host' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON `db`.* TO 'user'@'host' IDENTIFIED BY 'pass';
FLUSH PRIVILEGES;