Skip to content

Instantly share code, notes, and snippets.

View MefhigosetH's full-sized avatar
:octocat:
Making a serverless-alpine docker image...

Victor Villarreal MefhigosetH

:octocat:
Making a serverless-alpine docker image...
View GitHub Profile
anonymous
anonymous / gist:269310
Created January 5, 2010 10:39
Index: channels/chan_rtmp.c
===================================================================
--- channels/chan_rtmp.c (revision 234093)
+++ channels/chan_rtmp.c (working copy)
@@ -73,6 +73,8 @@
static char context[AST_MAX_EXTENSION] = "default";
static char type[] = "RTMP";
+#define RTMP_FRAME_BUFFER_MAX 4096
+
@zircote
zircote / ssh.sh
Created September 26, 2011 21:45
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub
@zhangtaihao
zhangtaihao / mysqltmpfs
Created August 30, 2012 02:44
Debian init script to set up MySQL data on tmpfs
#!/bin/sh
### BEGIN INIT INFO
# Provides: mysqltmpfs
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Start-Before: mysql
# X-Stop-After: mysql
### END INIT INFO
@jfinstrom
jfinstrom / asterisk.py
Last active July 14, 2021 14:37
Example of using the Asterisk Manager API in python...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# asterisk.py
#
# Copyright 2014 James Finstrom<jfinstrom at gmail>
#
# This program 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 2 of the License, or
@plentz
plentz / nginx.conf
Last active July 27, 2024 16:11
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
WINDNS %{NUMBER:log_date} %{TIME:log_time} %{WORD:dns_thread_id} %{WORD:dns_context}%{SPACE}%{WORD:dns_packet_id} %{WORD:dns_ip_protocol} %{WORD:dns_direction} %{IP:dns_client_address}%{SPACE}%{WORD:dns_xid}%{SPACE}(?:Q|R|U) ?(Q|R|U)?%{SPACE}[%{GREEDYDATA:dns_hex_flags}%{SPACE}%{WORD:dns_response}]%{SPACE}%{WORD:dns_recordtype}%{SPACE}([1-9][0-9]?)%{GREEDYDATA:dns_query_name}
@angeloxx
angeloxx / modsec-clamscan.lua
Last active July 16, 2024 15:13
ModSecurity ClamAV integration script (LUA)
#!/usr/bin/lua
--[[
This script can be used to inspect uploaded files for viruses
via ClamAV. To implement, use with the following ModSecurity rule:
SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity/bin/modsec-clamscan.lua" "phase:2,t:none,log,deny"
Author: Angelo Conforti (based on Josh Amishav-Zlatin code)
Requires the clamav-server and clamav-scanner
@niemasd
niemasd / download_m3u8.sh
Last active May 28, 2023 01:59
Download an M3U8 video stream and output it as an MKV using ffmpeg
#!/usr/bin/env bash
if [ "$#" -ne 2 ] ; then
echo "USAGE: $0 <m3u8_url> <out_file>"; exit
fi
base=$(echo "$1" | rev | cut -d'/' -f2- | rev)
curl -s $1 | grep -v "^#" | sed -e "s>^>$base/>" | xargs curl -s | ffmpeg -i pipe:0 -c:v copy -c:a copy $2
@tanaikech
tanaikech / submit.md
Created January 5, 2021 06:59
Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js

Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js

This is a sample script of Node.js for downloading the data and uploading the data to Google Drive with the resumable upload without saving it as a file. The downloaded data is uploaded to Google Drive with the stream.

Sample script

Before you use this, please set the variables of accessToken, url, fileSize, mimeType and filename. In this case, fileSize is required to set because the data is uploaded with the resumable upload.

const request = require("request");
@V-Juarez
V-Juarez / Entorno de Desarrollo para php usando Docker.md
Last active May 9, 2024 23:45
Configuración de docker, php y nginx

Entorno de Desarrollo para php usando Docker 🐳

Quieres aprender php, pero las configuraciones te han abrumado y el deseo de aprender van mermando. No, no detengas tu aprendizaje, siempre existe una solución a los problemas. Instalar php, configurar un servidor web en Windows es muy sencillo, en Linux y macOS es otra situación. Debes conocer sobre la terminal, un editor de código, vim, nano, ser avanzado... y mucho más.

La herramienta que vamos a utilizar y que permite trabajar con php, un servidor web y la terminal es Docker.

Docker: Es una plataforma de software que permite crear, probar e implementar aplicaciones rápidamente.

Docker-compose: Es una herramienta para definir y ejecutar aplicaciones; es multicontenedor que permite simplificar el uso de Docker a partir de archivos YAML, de esta forma es más sencillo generar contendores que se relacionen entre sí, conectarlos, habilitar puertos, volúmenes, etc.