Skip to content

Instantly share code, notes, and snippets.

View gtgt's full-sized avatar
🏠
Working from home

GT gtgt

🏠
Working from home
View GitHub Profile
@gtgt
gtgt / 00-ffmpeg_random_segment_format.patch
Last active April 2, 2023 10:05
ffmpeg - random filename segment patch (this way you only need to protect the playlist, not the segments)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 17ae300..7ff8c22 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3809,6 +3809,36 @@ uint64_t ff_ntp_time(void)
return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
}
+static char *randstring(size_t length) {
+ static char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
@gtgt
gtgt / build-orangepipc-gentoo.py
Last active March 11, 2016 16:30 — forked from atx/build-orangepipc-gentoo.py
Script for building a Gentoo image for the Allwinner H3, use at your own risk
#! /bin/bash
# This script builds a Gentoo image for the Allwinner H3
# Based on http://linux-sunxi.org/H3_Manual_build_howto
# Tested on Orange Pi PC
set -e
function green {
echo -e '\033[0;32m'$@'\033[0m'
@gtgt
gtgt / README.md
Last active May 7, 2016 11:00
Orange PI LCD test
#!/bin/sh
#
# git-subtree.sh: split/join git repositories in subdirectories of this one
#
# Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>
# Copied from https://bitbucket.org/durdn/git/src/643f425beb30560b323a79a293282148c09da300/contrib/subtree/git-subtree.sh?at=np%2Fgit-subtree-list-4&fileviewer=file-view-default
#
if [ $# -eq 0 ]; then
set -- -h
fi
@gtgt
gtgt / Whats the difference (if any)?
Created July 22, 2016 10:47
Warm-up questions for job seekers.
/* Case 1 */
<?php
header('Content-Type: text/css');
$exit_normally = 0;
register_shutdown_function(function() {
register_shutdown_function(function() {
global $exit_normally;
if (!$exit_normally) {
echo "/*\n".ob_get_clean()."\n*/\n";
}
// ==UserScript==
// @name miui.hu anti-ad
// @namespace http://tampermonkey.net/
// @version 0.1
// @description I hate to force ads
// @author You
// @match http://miui.hu/*
// @grant none
// ==/UserScript==
onload_functions.shift();
@gtgt
gtgt / symfony_dbg_switch.url
Last active April 4, 2017 11:29
/xxx <--> index_dbg.php/xxx switcher bookmarklet
javascript:window.location.replace(window.location.protocol+'//'+window.location.hostname+(window.location.pathname.indexOf('/index_dbg.php') >= 0 ? '' : '/index_dbg.php')+window.location.pathname.replace('/index_dbg.php','')+window.location.search+window.location.hash)
@gtgt
gtgt / build-php-static.sh
Last active March 6, 2024 04:51
Script to build static php
#!/bin/bash
U=${SUDO_USER:=${USER}}
if [[ -x `which realpath` ]]; then
T=$(realpath ${BASH_SOURCE[0]:=${0}})
else
T=${BASH_SOURCE[0]:=${0}}
fi
D=$(dirname ${T})
#apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libtidy-dev libmemcached-dev imagemagick-dev msgpack-dev
@gtgt
gtgt / Memcache.php
Created September 11, 2017 10:09
Memcache class emulation by extending Memcached
<?php
if (!class_exists('Memcache') && class_exists('Memcached')) {
define('MEMCACHE_COMRESSED', 2);
/**
* Memcache class emulation by extending Memcached
*
* @author gt <gt-kani.hu>
* @class Memcache
*/
@gtgt
gtgt / eg
Created November 17, 2021 12:36
easy-git wrapper
#!/usr/bin/perl -w
## Easy GIT (eg), a frontend for git designed for former cvs and svn users
## Version 1.7.5.2
## Copyright 2008-2013 by Elijah Newren and others
## Licensed under GNU GPL, version 2.
## To use eg, simply stick this file in your path. Then fire off an
## 'eg help' to get oriented. You may also be interested in
## http://www.gnome.org/~newren/eg/git-for-svn-users.html