Skip to content

Instantly share code, notes, and snippets.

View hex128's full-sized avatar
👾

Hex hex128

👾
View GitHub Profile
@hex128
hex128 / contact.lua
Last active December 5, 2017 05:49
Contact Form with NGINX, Lua, Python and SMTP
ngx.req.read_body()
local fp = assert(io.popen('/usr/local/bin/contact.py >> /var/log/nginx/contact-form.log 2>&1', 'w'))
fp:write(ngx.var.remote_addr)
fp:write('\r\n')
fp:write(ngx.req.get_body_data())
assert(fp:close())
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --demuxer-lavf-analyzeduration=0 --demuxer-lavf-probesize=32 --no-audio --framedrop=decoder --force-seekable=no --no-cache --cache-secs=0 --no-cache-pause --rtsp-transport=tcp --geometry=432x768+0+0 rtsp://192.0.2.10/
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --geometry=934x768+432+0 video.mp4
@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi
sc.exe config mrxsmb10 start= disabled
) else (
echo Please run with Administrator rights.>&2
)
pause
@hex128
hex128 / install.sh
Last active April 26, 2017 14:14 — forked from 2xyo/install.sh
SNORT installation on debian 8
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo "usage: $0 <interface>" > /dev/stderr
exit 1
fi
INTERFACE="$1"
<?php
if (
!isset($_POST['name']) ||
!isset($_POST['company']) ||
!isset($_POST['email']) ||
!isset($_POST['phone']) ||
!isset($_POST['message']) ||
!(isset($_SERVER['HTTP_X_FORWARDED_FOR']) || isset($_SERVER['REMOTE_ADDR'])) ||
!isset($_POST['g-recaptcha-response'])
) {
const fs = require('fs');
const path = require('path');
const Realm = require('realm');
const json2csv = require('json2csv');
const realm = new Realm({
path: 'default.realm',
readOnly: true
});
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main (int argc, char **argv) {
int a = 0;
int i;
int o;
#!/usr/bin/env python3
import json
import sys
import signal
import urllib.request
import urllib.parse
import re
from html.parser import HTMLParser
#!/bin/bash
ontrap () {
for j in $(jobs -p)
do
kill -s SIGTERM $j > /dev/null 2>&1 || (sleep 1 && kill -9 $j > /dev/null 2>&1 &)
done
}
trap ontrap INT TERM EXIT
server () {
while :
ffmpeg -f lavfi -i anullsrc -re -rtsp_transport tcp -analyzeduration 0 -i rtsp://admin:[email protected]/h264/ch${channel}/main/av_stream -c:v libx264 -c:a libfaac -ar 44100 -ac 2 -preset ultrafast -tune zerolatency -crf 30 -g 20 -f flv rtmp://127.0.0.1/live/ch${channel}