This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
RTMP_URL="rtmp://a.rtmp.youtube.com/live2/<STREAM-KEY>" | |
ffmpeg \ | |
-re \ | |
-f lavfi -i "testsrc=s=1920x1080:r=30,format=yuv420p" \ | |
-f lavfi -i "sine=f=440:b=4" \ | |
-vf "drawtext=text='%{pts\:localtime\:$(date +%s)\:%Y-%m-%d %T}':fontsize=48:fontcolor=white:box=1:boxborderw=6:[email protected]:x=(w-text_w)/2:y=h-text_h-20" \ | |
-vcodec libx264 -pix_fmt yuv420p -preset medium -r 30 -b:v 1M \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tmp = require('tmp') | |
tmp.setGracefulCleanup() | |
const spawn = require('child_process').spawn | |
const net = require('net') | |
async function sleep(t){ | |
return new Promise((res) => setTimeout(res, t)) | |
} | |
(async function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM arm64v8/ubuntu:20.04 as builder | |
RUN apt-get update \ | |
&& apt-get install -y pkg-config openssl libz-dev libssl-dev libevent-dev libpcap-dev libnet1-dev \ | |
libc-dev linux-headers-5.4.0-1013-raspi gcc make git-core --no-install-recommends | |
COPY . /opt/sslsplit | |
WORKDIR /opt/sslsplit | |
ENV TCPPFLAGS -DDOCKER | |
RUN export SOURCE_DATE_EPOCH=$(stat -c '%Y' *.c *.h|sort -r|head -1); \ | |
make clean && make -j$(nproc) all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.12.0 AS builder | |
# bump: ffmpeg /FFMPEG_VERSION=([\d.]+)/ https://github.com/FFmpeg/FFmpeg.git|^4 | |
ARG FFMPEG_VERSION=4.3 | |
ARG FFMPEG_URL="https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" | |
ARG FFMPEG_SHA256=a7e87112fc49ad5b59e26726e3a7cae0ffae511cba5376c579ba3cb04483d6e2 | |
# bump: mp3lame /MP3LAME_VERSION=([\d.]+)/ svn:http://svn.code.sf.net/p/lame/svn|/^RELEASE__(.*)$/|/_/./|* | |
ARG MP3LAME_VERSION=3.100 | |
ARG MP3LAME_URL="https://sourceforge.net/projects/lame/files/lame/$MP3LAME_VERSION/lame-$MP3LAME_VERSION.tar.gz/download" | |
ARG MP3LAME_SHA256=ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker run --gpus=all --rm -it -p 3389:3389 --shm-size=256m -u ubuntu --privileged myblender | |
FROM ubuntu:20.04 as builder | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://ftp.iij.ad.jp/pub/linux/ubuntu/archive/%g" /etc/apt/sources.list | |
RUN sed -i "s/# deb-src/deb-src/g" /etc/apt/sources.list | |
RUN apt-get -y update \ | |
&& apt-get -yy upgrade \ | |
&& apt-get -yy install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 AS build-env | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://ftp.iij.ad.jp/pub/linux/ubuntu/archive/%g" /etc/apt/sources.list | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends wget curl ca-certificates build-essential checkinstall git \ | |
python3-pip \ | |
libmicrohttpd-dev libjansson-dev \ | |
libssl-dev libsofia-sip-ua-dev libglib2.0-dev \ | |
libopus-dev libogg-dev libcurl4-openssl-dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import altair as alt | |
import pandas as pd | |
import random | |
import requests | |
#geo_json = requests.get('https://github.com/dataofjapan/land/raw/master/japan.topojson').json() | |
#japan_geo = alt.Data( | |
# values=geo_json, | |
# format=alt.TopoDataFormat(feature='japan',type='topojson') | |
#) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ethon' | |
require 'httpclient' | |
require 'net/http' | |
require 'uri' | |
url = 'http://example.com/' | |
dummy = 'a' * 2000 | |
# ethon | |
easy = Ethon::Easy.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ffi' | |
require 'fiddle' | |
require 'benchmark' | |
def setup | |
open("/tmp/test.c","w") do |io| | |
c_src = <<-EOS | |
int add(int a, int b){ | |
return a + b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate nom; | |
use nom::*; | |
fn take_digits_n(input: &[u8], n: u8) -> IResult<&[u8],&[u8]> { | |
verify!(input, take!(n), |chars: &[u8]| chars.iter().all(|c: &u8| is_digit(*c)) ) | |
} | |
named!(take_4_digits, apply!(take_digits_n, 4)); | |
named!(take_1_or_2_digits, alt_complete!( apply!(take_digits_n, 2) | apply!(take_digits_n, 1)) ); |
NewerOlder