A very simple example of using a map of channels for pub/sub in go.
To run it go here http://play.golang.org/p/eXwppMgHR3
FROM ubuntu:16.04 | |
## ----------------------------------------------------------------------------- | |
## Installing dependencies | |
## ----------------------------------------------------------------------------- | |
RUN set -xe \ | |
&& apt-get update \ | |
&& apt-get -y --no-install-recommends install \ | |
software-properties-common \ | |
apt-transport-https \ |
YUV -> MP4 | |
gst-launch filesrc location=<YUV file name> ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! mp4mux ! filesink location=<mp4 file name> | |
gst-launch filesrc location=foreman15_600.yuv ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! rtph264pay name=packetiser ! fakesink | |
MP4 -> YUV | |
gst-launch filesrc location=<MP4 file name> ! qtdemux ! ffdec_h264 ! videoparse height=144 width=176 framerate=15 ! filesink locatiion=<YUV file name> | |
---- | |
Stream MP4 file | |
gst-launch filesrc location=IM2-YT-2_128k_20.mp4 ! qtdemux ! rtph264pay seqnum-offset=0 timestamp-offset=0 ssrc=0xaaaabbbb mtu=1450 perfect-rtptime=true ! udpsink clients=172.16.183.134:4400 |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: deadsfu-in | |
spec: | |
hostNetwork: true | |
containers: | |
- name: deadsfu | |
image: x186k/deadsfu:latest | |
command: ["/app/main"] |
c@macmini ~/D/t/d/bug> terraform apply -var "do_token=$DIGITALOCEAN_ACCESS_TOKEN" -var "pvt_key=$HOME/.ssh/id_rsa" -auto-approve | |
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: | |
+ create | |
Terraform will perform the following actions: | |
# digitalocean_droplet.www-1 will be created | |
+ resource "digitalocean_droplet" "www-1" { | |
+ backups = false |
# builder image | |
FROM golang:1.13-alpine3.11 as builder | |
RUN mkdir /build | |
ADD *.go /build/ | |
WORKDIR /build | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -o golang-memtest . | |
# generate clean, final image for end users | |
FROM alpine:3.11.3 |
docker kill (docker ps -q) | |
docker rm (docker ps -a -q) | |
docker rmi (docker images -q) | |
# three commands above do | |
# stop all containers: | |
# remove all containers | |
# remove all docker images |
A very simple example of using a map of channels for pub/sub in go.
To run it go here http://play.golang.org/p/eXwppMgHR3
#include <mach/port.h> /* mach_port_t */ | |
#include <mach/mach.h> /* mach_port_allocate(), mach_task_self(), mach_port_insert_member(), MACH_PORT_RIGHT_PORT_SET */ | |
#include <sys/event.h> /* kqueue(), kevent64(), struct kevent64_s, EVFILT_MACHPORT, EV_SET64, EV_ADD */ | |
#include <sys/time.h> /* struct timespec */ | |
//#include <dispatch/private.h> | |
extern mach_port_t _dispatch_get_main_queue_port_4CF(void); | |
extern void _dispatch_main_queue_callback_4CF(void); | |
#include <stdio.h> |
# http://duckdns.org | |
# https://github.com/RSATom/janus-gateway-snap | |
snap install janus-gateway | |
systemctl status snap.janus-gateway.janus-gateway.service | |
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list | |
sudo apt update |