Skip to content

Instantly share code, notes, and snippets.

@zhangguanzhang
zhangguanzhang / systemd-timer.md
Created December 20, 2024 09:34
linux systemd timer demo

关于

大致写下快速写一个 systemd 的定时任务,不使用 cron 是因为 cron 比较弱,而且日志查看不友好。

文件

需要有一个 service 文件和 timer 文件,前者描述启动相关,后者描述定时相关属性

cat > /etc/systemd/system/gitlab-runner.service << EOF
@mkckr0
mkckr0 / init.gradle.kts
Last active August 11, 2026 07:12
Gradle 设置全局镜像源,支持 Android 项目,解决镜像源缺失 POM 或 JAR 文件,支持直接替换 URL
// https://gist.github.com/mkckr0/97ec5b0d99feede4c19ee6f905d5e722
val repoMirrorMap = mapOf(
"https://repo.maven.apache.org/maven2" to "https://maven.aliyun.com/repository/central",
"https://dl.google.com/dl/android/maven2" to "https://maven.aliyun.com/repository/google",
"https://plugins.gradle.org/m2" to "https://maven.aliyun.com/repository/gradle-plugin",
"https://jcenter.bintray.com" to "https://maven.aliyun.com/repository/jcenter",
)
val repoReplaceMap = mapOf(
"https://maven.google.com" to "https://dl.google.com/dl/android/maven2"
@ferstar
ferstar / delete_action_runs.py
Created January 7, 2022 01:25
Delete all workflow runs&artifacts of a github repo
import asyncio
import sys
from aiohttp import ClientSession, ClientTimeout
def seq_iter(seq, step=10):
if not seq:
return seq
from_idx, to_idx, seq_len = 0, step, len(seq)
@MadeBaruna
MadeBaruna / README.md
Last active September 27, 2026 14:46
Get Genshin Impact wish history link
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active November 16, 2026 04:14
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 8, 2026 10:33
set -e, -u, -o, -x pipefail explanation
@unitycoder
unitycoder / local-stream-server-win10.md
Last active March 3, 2026 22:45
Local RTMP Stream Server for Windows

https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmfp-server-using-monaserver.153/ (copied here as a backup)

This article is inspired of the great guide of How to set up your own private RTMP server using nginx. https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/

MonaServer is a tiny and scalable open source server which provide protocols RTMFP, RTMP, RTMPE, WebSocket and HTTP. Server applications are written in lua and clients just need to support one of these protocols.

The interest of MonaServer here is the RTFMP broadcast feature that avoid congestion (because it is a UDP protocol) unlike RTMP.

This guide will presents you an easy way to broadcast a video with OBS over RTMFP. Don't worry, you will not need to configure or write any code here :)