Skip to content

Instantly share code, notes, and snippets.

View rahmatov's full-sized avatar

Gani Rakhmatov rahmatov

View GitHub Profile
@pauloricardomg
pauloricardomg / cors.nginxconf
Last active March 8, 2024 18:31
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@aktau
aktau / ffmpeg-interlace-test.sh
Last active October 28, 2023 14:26
ffmpeg detect interlacing
#!/bin/bash
# for a blogpost on this, check: http://www.aktau.be/2013/09/22/detecting-interlaced-video-with-ffmpeg/
# detect interlacing with the ffmpeg "idet" filter, the longer
# you let this run, the better, though it's never 100% accurate
# flags:
# -an = discard audio, we don't need it
# -f rawvideo = output raw video
@hzbd
hzbd / haproxy.config
Created May 4, 2013 17:34
Sample HAProxy config with logging.
global
pidfile /var/run/haproxy.pid
log 127.0.0.1 local0 info
ulimit-n 65536
defaults
mode http
clitimeout 600000 # maximum inactivity time on the client side
srvtimeout 600000 # maximum inactivity time on the server side
@Atem18
Atem18 / iptables.sh
Last active November 2, 2023 17:13
My own iptables script.
#!/bin/sh
IPT="/sbin/iptables" #Iptable's path
#Network interfaces :
interface=eth0 # Internet
start() {
### DELETE ALL ENTRIES ###
$IPT -F
@kgriffs
kgriffs / sysctl.conf
Last active April 29, 2024 11:32
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
#
# See also: https://gist.github.com/kgriffs/4027835
#
# Assumes a beefy machine with lots of network bandwidth