Skip to content

Instantly share code, notes, and snippets.

View e1ectr0cut1e's full-sized avatar
🏳️‍🌈

Hex e1ectr0cut1e

🏳️‍🌈
View GitHub Profile
@e1ectr0cut1e
e1ectr0cut1e / nodejs.service
Last active July 30, 2016 17:26
Node.JS server with SystemD socket activation
[Service]
ExecStart=/usr/bin/node /var/www/server.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodejs
User=www-data
Group=www-data
@e1ectr0cut1e
e1ectr0cut1e / rtpdec_h264.patch
Last active July 30, 2016 17:25
Ignore invalid sprop-parameter-sets
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -168,6 +168,10 @@ static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
int ret;
+ if (value[strlen(value) - 1] == ',') {
+ av_log(s, AV_LOG_WARNING, "Missing PPS in sprop-parameter-sets, ignoring\n");
+ return 0;
+ }
codec->extradata_size = 0;
av_freep(&codec->extradata);
@e1ectr0cut1e
e1ectr0cut1e / jenkins-2-no-valid-crumb-nginx.url
Last active July 30, 2016 17:24
Jenkins 2 No valid crumb was included in the request
https://issues.jenkins-ci.org/browse/JENKINS-12875?focusedCommentId=168028&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-168028
@e1ectr0cut1e
e1ectr0cut1e / remainingTime.js
Last active October 25, 2016 01:14
Human readable remaining time till timestamp (Russian)
/**
* @description Get a human readable remaining time till timestamp
* @param till {Number} Timestamp of the moment in the future
* @return {String} Human readable remaining time string
*/
remainingTime = function (till) {
var delta = till - this.timestamp,
string;
if (delta < -60) { // In the past
string = 'Далее';
ffmpeg -f lavfi -i anullsrc -re -rtsp_transport tcp -analyzeduration 0 -i rtsp://admin:12345@192.0.0.1/h264/ch${channel}/main/av_stream -c:v libx264 -c:a libfaac -ar 44100 -ac 2 -preset ultrafast -tune zerolatency -crf 30 -g 20 -f flv rtmp://127.0.0.1/live/ch${channel}
@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi
sc.exe config mrxsmb10 start= disabled
) else (
echo Please run with Administrator rights.>&2
)
pause
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --demuxer-lavf-analyzeduration=0 --demuxer-lavf-probesize=32 --no-audio --framedrop=decoder --force-seekable=no --no-cache --cache-secs=0 --no-cache-pause --rtsp-transport=tcp --geometry=432x768+0+0 rtsp://192.0.2.10/
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --geometry=934x768+432+0 video.mp4
@e1ectr0cut1e
e1ectr0cut1e / bspatch.patch
Last active December 24, 2018 21:29
KingstVIS 3.1.1 dark theme fix
/*
* gcc -fPIC -Wall -ldl -shared -o pwd_override.so -Wl,-soname,pwd_override.so pwd_override.c
*/
#define _GNU_SOURCE
#include <pwd.h>
#include <stdio.h>
#include <dlfcn.h>
#!/usr/bin/env python3
import datetime
import fcntl
import glob
import html.parser
import logging
import os
import re
import shutil
import socket