This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Simple script to monitor a ipcam stream running on mpv | |
# using the ipc-server | |
# requires mpv, socat, and jq written for bash 4 | |
# xwinwrap to run on the Desktop | |
# by gmail plgroves 2019 | |
# | |
# script creates a kill script in same path as this script | |
# named This_script-kill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -f | |
<?php | |
error_reporting(~E_WARNING); | |
//Create a UDP socket | |
if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0))) { | |
$errorcode = socket_last_error(); | |
$errormsg = socket_strerror($errorcode); | |
die("Couldn't create socket: [$errorcode] $errormsg \n"); | |
} | |
echo "Socket created \n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-A INPUT -i eth0 -p udp -m udp --dport 5060 -j SIP | |
# | |
-A SIP -i eth0 -p udp -m udp --dport 5060 -m string --string "INVITE" --algo bm --from 23 --to 28 -m comment --comment "Catch SIP INVITEs" -j SIPINVITE | |
-A SIP -i eth0 -p udp -m udp --dport 5060 -m string --string "REGISTER" --algo bm --from 23 --to 30 -m comment --comment "Catch SIP REGISTERs" -j SIPREGISTER | |
-A SIP -m comment --comment "Catch and accept everything else" -j ACCEPT | |
# | |
-A SIPINVITE -m hashlimit --hashlimit-upto 4/min --hashlimit-burst 4 --hashlimit-mode srcip,dstip,dstport --hashlimit-name anon-sip-rateinv --hashlimit-srcmask 24 -m comment --comment "Rate limit SIP invites" -j ACCEPT | |
-A SIPINVITE -m limit --limit 10/min -j LOG --log-prefix "SIPINV DROP: " | |
-A SIPINVITE -m comment --comment "Rate limit exceeded, reject" -j REJECT | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Once this scipt is executed it will connect to the local port you have assigned to | |
* Asterisk (default: 5038) and send an authentication request. If successfull, it will | |
* send a second request to originate your call. | |
* | |
* The internal SIP line $internalPhoneline will be dialed, and when picked up the | |
* $target phone will be dialed using your outbound calls context ($context). | |
* | |
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs. | |
* you can find more about the available options at: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function require_auth() { | |
$AUTH_USER = 'admin'; | |
$AUTH_PASS = 'admin'; | |
header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
$is_not_authenticated = ( | |
!$has_supplied_credentials || | |
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
############################################################ | |
# MIGRATED TO REPOSITORY | |
# https://github.com/tavinus/cloudsend.sh | |
# | |
# This gist will NOT be updated anymore | |
############################################################ | |
############################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Author: Luis Felipe Domínguez Vega <[email protected]> | |
# https://gist.github.com/lfdominguez/08de623d9f9c0fa84e6b4d5d0d25025c | |
# Program to use with the rate software to send to InfluxDB the | |
# rate of each IP on interface | |
# | |
# rate_to_influx <influxdb_url> <influxdb_database> <local_network> <interface> | |
# rate_to_influx http://127.0.0.1:8086 network 192.168.0.0/24 re1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pushgatewayip="192.168.1.2:9091" | |
network="192.168.1.0/24" | |
rate -i bce1 -r 1 -e -n -Ab -a 255 -c "${network}" -d | while read -r line; do | |
host=`echo $line | cut -d':' -f1` | |
downloadrate=`echo $line | cut -d':' -f4` | |
uploadrate=`echo $line | cut -d':' -f5` | |
if [ ! -z "$downloadrate" -a "$downloadrate" != " " ]; then | |
echo "download_rate_bits $downloadrate" | curl --data-binary @- "${pushgatewayip}/metrics/job/pfsense/instance/${host}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>Starter Template</title> | |
<meta name="description" content=""> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |