Skip to content

Instantly share code, notes, and snippets.

@yongkyuns
yongkyuns / ffmpeg_example.rs
Created Jul 7, 2020
FFMPEG usage in rust using command and raw pixels
View ffmpeg_example.rs
use std::io::prelude::*;
use std::process::{Command, Stdio};
fn main() {
let mut child = Command::new("ffmpeg")
// Overwrite file if it already exists
.arg("-y")
// Interpret the information from stdin as "raw video" ...
.arg("-f")
.arg("rawvideo")
View certPolicy.ps1
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@derralf
derralf / phpList-ACCESS_CONTROL_ALLOW_ORIGIN.txt
Last active Jan 26, 2022
Allow multiple Origins für phpList
View phpList-ACCESS_CONTROL_ALLOW_ORIGIN.txt
/*
=========================================================================
Hack: Allow multiple Origins
z.B. für Ajax-Anmeldung von Subdomain
platziere dies zu oberst in /lists/config/config.php
@phracker
phracker / unpackxip.md
Created Aug 5, 2018
Unpack XIP on Linux
View unpackxip.md

Unpacking XIP files on Linux:

  1. Install xar from https://mackyle.github.io/xar/
  2. Install pbzx from https://github.com/NiklasRosenstein/pbzx (use gcc -llzma -lxar -I /usr/local/include pbzx.c -o pbzx and copy the binary into your PATH)
  3. use xar -xf XIP_FILE -C /path/to/extract/to
  4. Change to the directory where you extracted the file.
  5. Use pbzx -n Content | cpio -i to extract the contents.
@nuriel77
nuriel77 / doDomainSnapshot.py
Created Apr 23, 2017
Do libvirt snapshot for domain and define how many recent snapshots to keep
View doDomainSnapshot.py
#!/usr/bin/env python
import argparse
import libvirt
import logging
import time
import sys
import os
from pprint import pformat
from heapq import nlargest
@sphaero
sphaero / gstseamlessloop.py
Last active Sep 20, 2021
Gstreamer seamless loop test
View gstseamlessloop.py
#/usr/bin/env python3
#
# Seamless loop test
# Copyright (c) 2015 Arnaud Loonstra <arnaud@sphaero.org>
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@toabctl
toabctl / libvirt-listen-events.py
Last active Nov 2, 2021
Listen for libvirt events
View libvirt-listen-events.py
#!/usr/bin/python
import libvirt
import sys
# virDomainEventType is emitted during domain lifecycles (see libvirt.h)
VIR_DOMAIN_EVENT_MAPPING = {
0: "VIR_DOMAIN_EVENT_DEFINED",
1: "VIR_DOMAIN_EVENT_UNDEFINED",
2: "VIR_DOMAIN_EVENT_STARTED",
@lg3bass
lg3bass / padVideosTo16:9
Last active May 31, 2022
ffmpeg to pad videos to 16:9
View padVideosTo16:9
//source: https://lists.ffmpeg.org/pipermail/ffmpeg-user/2011-July/001746.html
//source: http://ffmpeg.org/ffmpeg-filters.html#pad
//works
ffmpeg -i PAN_17-1_Final.m4v -filter:v 'pad=max(iw\,ih*(16/9)):ow/(16/9):(ow-iw)/2:(oh-ih)/2' -aspect 16:9 PAN_17-1_Final_auto1.m4v
//works but calculates manually (pad=<width output>:<height output>:<x upper-left-corner>:<y upper-left-corner>
ffmpeg -i PAN_17-1_Final.m4v -filter:v 'pad=939:528:22:0' PAN_17-1_Final_PADTEST2.m4v