Skip to content

Instantly share code, notes, and snippets.

View ttys3's full-sized avatar
💭
sad, ttyS0 has been taken by other user

ttys3

💭
sad, ttyS0 has been taken by other user
View GitHub Profile
@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active August 18, 2024 02:58
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

@17twenty
17twenty / exportstats.go
Last active May 31, 2024 20:09
Simple example of using expvar to instrument Golang apps.
package exportstats
import (
"expvar"
"fmt"
"runtime"
)
var stats *expvar.Map
@iamazeem
iamazeem / qt_directory_watcher.cpp
Last active January 9, 2023 17:04
Qt QFileSystemWatcher Example - Watch a directory and do some processing if it is changed with QEventLoop
// ----------------------------------------------
// List the contents of a directory if changed
// Using QFileSystemWatcher, QDirIterator and
// QEventLoop, and lambda function for connect
// ----------------------------------------------
#include <QObject>
#include <QEventLoop>
#include <QDebug>
#include <QFileSystemWatcher>
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@sterpe
sterpe / line_length.rb
Last active December 27, 2020 17:34
Overcommit LineLength pre-commit hook
# ./.git-hooks/pre_commit/line_length.rb
#
# E.g.:
# Precommit:
# LineLength:
# enabled: true
# description: Verify source line lengths do not exceed 72 columns
# max: 72
# include: ["src/**/*.*"]
#
@systemdarena
systemdarena / arch-chroot
Created November 14, 2016 17:14
arch-chroot for fedora
#!/bin/bash
shopt -s extglob
# generated from util-linux source: libmount/src/utils.c
declare -A pseudofs_types=([anon_inodefs]=1
[autofs]=1
[bdev]=1
[binfmt_misc]=1
[cgroup]=1
@snakevil
snakevil / s6-svscan-1.md
Created September 29, 2016 09:32
【译】如何将 s6-svscan 用作初始进程

【译】如何将 s6-svscan 用作初始进程

点击这里阅读原文。


2015 年 6 月 17 日之后,如果你是 Linux 用户,你可以使用 s6-linux-init 包来帮助你实现同样的目标!尽管如此,还是请你首先阅读本篇文档,以理解 s6-linux-init 的工作内容。

将 s6-svscan 用作初始进程是可行的。但这并不意味着你可以直接通过 s6-svscan 引导,因为它还无法胜任完整的初始化系统所应做地全部工作。正确地替换掉初始进程,还需要对其工作内容做更多地理解。

@snakevil
snakevil / docker-and-s6-my-new-favorite-process-supervisor.md
Created September 29, 2016 05:50
【译】Docker 和 S6 ——我的进程管理器新欢
@snakevil
snakevil / the-5-most-important-things-ive-learned-from-using-docker.md
Created September 29, 2016 04:25
【译】使用 Docker 地 5 大心得
@snakevil
snakevil / baseimage-docker-fat-containers-treating-containers-vms.md
Last active July 18, 2019 12:56
【译】Baseimage-docker,胖容器和“容器也是虚拟机”

【译】Baseimage-docker,胖容器和“容器也是虚拟机”

作者 Hongli Lai 看着像是华人,可惜没找到文章的中文版本,于是就很土鳖地手翻了一遍。文章的措辞很口语化,因此意译为主。点击这里可以阅读原文。


Baseimage-docker 是针对 Docker 优化地 Ubuntu 最小化基础镜像。我们可以从 Docker 仓库中拉取回来作为基础镜像用在自己的镜像中。

笔者也算是 Docker 的早期使用者了,早在其 1.0 版本发布前,就已经将其用来做持续集成和构建开发环境了。因而,笔者才研发了 Baseimage-docker 以解决 Docker 工作模式中的一些问题,主要是子进程的“僵尸化”问题