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
@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");
@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
@angeloxx
angeloxx / modsec-clamscan.lua
Last active April 28, 2024 20:45
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
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}
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
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
@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
@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
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
+