Skip to content

Instantly share code, notes, and snippets.

View dlgg's full-sized avatar

Damien Lesgourgues dlgg

View GitHub Profile
@dlgg
dlgg / nginx-rtmp-stream-multi-debian-18.md
Created May 31, 2023 08:50 — forked from xiCO2k/nginx-rtmp-stream-multi-debian-18.md
RTMP Server to Stream to Facebook, Youtube, Instagram
apt install nginx
apt install libnginx-mod-rtmp
apt install ffmpeg
apt install stunnel4

vim /etc/nginx/nginx.conf

  • Remove http {} and mail {}
@dlgg
dlgg / __upload_file.md
Created November 28, 2017 17:30 — forked from maxivak/__upload_file.md
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");;
@dlgg
dlgg / gist:5b2b5f1ad5d0108bddaffddf2845387e
Created August 31, 2016 14:01 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@dlgg
dlgg / mkinventory.pl
Created October 16, 2015 17:28 — forked from jamesog/mkinventory.pl
Exporting from RackTables (e.g. for creating an inventory spreadsheet).
#!/usr/bin/env perl
use warnings;
use strict;
# Use modules installed with cpanm -L
use lib 'extlib/lib/perl5';
use DBI;
use POSIX qw(strftime);
use Spreadsheet::WriteExcel;
@dlgg
dlgg / .bashrc_ssh
Last active August 29, 2015 14:15 — forked from mzedeler/.bashrc_ssh
#!/bin/bash
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
touch $SSH_ENV
chmod 600 "${SSH_ENV}"
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
#!/bin/sh
if [ $# -eq 0 ]; then
echo "Usage: $0 script args ..."
exit 1
fi
SCRIPT=$1
shift
env -i HOME="$HOME" PATH="$PATH" SHELL="$SHELL" "$SCRIPT" "$@"
#http://httpd.apache.org/docs/2.2/rewrite/intro.html#rewritecond
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
#Use NOT logic. If cookie doesn't exist then redirect. Otherwise, default behavior.
RewriteCond %{HTTP_COOKIE} !request_method
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/$ /public/ [NE,R,L]
#! /bin/sh
### BEGIN INIT INFO
# Provides: beep
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Beeps that indicate startup and shutdown
### END INIT INFO