Skip to content

Instantly share code, notes, and snippets.

View jb-alvarado's full-sized avatar
💭
I may be slow to respond.

jb-alvarado

💭
I may be slow to respond.
View GitHub Profile
@lg3bass
lg3bass / padVideosTo16:9
Last active May 31, 2022 11:13
ffmpeg to pad videos to 16: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
@toabctl
toabctl / libvirt-listen-events.py
Last active November 2, 2021 10:02
Listen for libvirt events
#!/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",
@sphaero
sphaero / gstseamlessloop.py
Last active December 23, 2023 09:50
Gstreamer seamless loop test
#/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.
#
@lopspower
lopspower / README.md
Last active March 28, 2024 20:45
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@nuriel77
nuriel77 / doDomainSnapshot.py
Created April 23, 2017 10:45
Do libvirt snapshot for domain and define how many recent snapshots to keep
#!/usr/bin/env python
import argparse
import libvirt
import logging
import time
import sys
import os
from pprint import pformat
from heapq import nlargest
@notionquest
notionquest / Git_create_branch_error_resolution.txt
Last active December 20, 2023 03:15
Git create branch error src refspec matches more than one
If you get the below error when you try to create branch, you can use the below command to resolve it.
Error:
error: src refspec 9.0.1 matches more than one.
Solution:
git push origin refs/heads/branchName:refs/heads/branchName
@phracker
phracker / unpackxip.md
Created August 5, 2018 20:40
Unpack XIP on Linux

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.
@derralf
derralf / phpList-ACCESS_CONTROL_ALLOW_ORIGIN.txt
Last active January 26, 2022 16:12
Allow multiple Origins für phpList
/*
=========================================================================
Hack: Allow multiple Origins
z.B. für Ajax-Anmeldung von Subdomain
platziere dies zu oberst in /lists/config/config.php
@larsks
larsks / create-bridge-network.md
Last active February 15, 2023 12:58
podman-bridge-network

This will work if you have an existing bridge or if you don't: if the bridge referenced in this config doesn't exist, it will be created when you start a container attached to the network.

  1. Create the CNI network configuration in /etc/cni/net.d/99-example.conflist:
{
  "cniVersion": "0.4.0",
  "name": "example",
  "plugins": [
{
@rchaganti
rchaganti / certPolicy.ps1
Created April 14, 2020 12:04
Cert Policy
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;
}
}