Skip to content

Instantly share code, notes, and snippets.

View behringer24's full-sized avatar
:electron:
coding

Andreas Behringer behringer24

:electron:
coding
View GitHub Profile
@behringer24
behringer24 / Export Chapters ffMpeg.cs
Last active November 11, 2022 08:57
Export Vegas Pro chapter markers to use as chapters in MP4 with ffMpeg
/**
* You can use this script to export Vegas markers to the ffMpeg format to use
* as chapters in mp4 metadata. You can also export the .xml, .csv and .txt format
* for use in other applications.
*
* Copy script to \Script Menu in your Vegas program path.
* If Vegas is running rescan via menu Tools>Scripting>Rescan Script Menu Folder
*
* To use this script:
*
@behringer24
behringer24 / Export Regions as Subtitles SRT.cs
Last active November 11, 2022 08:58
Script to export Vegas Pro regions as SRT compatible subtitles for use with ffMpeg
/**
* You can use this script to export Vegas regions to the .srt format to use
* it with ffMpeg and other subtitle readers. You can also export the .sub format
* for use in DVDA as subtitles and .txt regions
* as tab separated text.
*
* Copy script to \Script Menu in your Vegas program path.
* If Vegas is running rescan via menu Tools>Scripting>Rescan Script Menu Folder
*
* To use this script:
@behringer24
behringer24 / gist:d01890253b93e6b1585c3db52d39407f
Created February 22, 2021 14:19
ffmpeg parameter to create compatible Dolby Digital 5.1 ac3 files
ffmpeg -hwaccel cuvid -hwaccel_output_format cuda -i frameserv.avs -map 0:0 -map 0:1 -c:a ac3 -ab 1536k -disposition:a:0 default -async 1 -c:v h264_nvenc -b:v 9000k -preset slow -maxrate 15000k -bufsize 15000k -r 24000/1001 -s 1920x1080 -aspect 16:9 -pix_fmt yuv420p -bsf:v h264_mp4toannexb -preset medium -level 41 -bluray-compat 1 -coder ac -trellis 1 -bf 1 -b_strategy 1 -flags +loop -mbd rd -sc_threshold 40 -keyint_min 24 -g 24 -qmin 2 -qmax 51 -qdiff 4 -f mpegts -mpegts_m2ts_mode 1 -slices 4 -y output-a4.264
@behringer24
behringer24 / iptables-allports24.conf
Created June 27, 2018 11:06
How to block a whole IP subnet with fail2ban and iptables
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
# Modified: Andreas Behringer
# made fail2ban block whole /24 subnets
# put this file in /etc/fail2ban/action.d/
#
@behringer24
behringer24 / nginx.conf
Created January 25, 2012 11:23
nginx configuration snippet for dynamic image manipulation using HttpImageFilterModule
/*
* nginx configuration snippet for dynamic image manipulation using HttpImageFilterModule
*
* URL example: http://www.yourserver.com/imgresize/250-100-0/demo.jpg
* Parameters are width-height-rotation
* You need to compile nginx with --with-http_image_filter_module
* More information at http://wiki.nginx.org/HttpImageFilterModule
*/
location ~/imgresize/(?P<width>[0-9]+)-(?P<height>[0-9]+)-(?P<rotate>[0-9]+)/(?P<filename>.+)$ {
rewrite /imgresize/[0-9]+-[0-9]+-[0-9]+/(.+)$ /images/$1 break;
@behringer24
behringer24 / jquery_confirm.html
Created June 19, 2011 09:56
Flexible confirm dialogs for multiple rows with jQuery UI
<div class='content'>
<h1>Demo</h1>
<div id='testupdate'>AJAX Update</div>
<a href='/ajax/remote' data-update='testupdate' data-dialog='confirm_delete' class='confirm'>Update something</a>
<a id='removetest' href='/ajax/remote2' data-remove='removetest' data-dialog='confirm_delete' class='confirm'>Remove something</a>
</div>
<div id='confirm_delete' title='Delete Confirmation' data-confirm='Ok' data-cancel='Cancel' class='confirm_dialog'>
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you shure?</p>
@behringer24
behringer24 / gist:1012015
Created June 7, 2011 10:34
Easy method to build SQL queries and escape parameters
/**
* Replacement callback function
*
* @param array $match
* @return string
*/
private function queryReplacementCallback($match) {
if (!isset($this->queryReplacementData[$match[2]]) || $this->queryReplacementData[$match[2]] === null) {
$replace = 'null';
} else {