Skip to content

Instantly share code, notes, and snippets.

View fitz123's full-sized avatar

Anton Lugovoi fitz123

View GitHub Profile
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@fitz123
fitz123 / deleteImageTag.sh
Created July 16, 2019 17:51
Delete docker image:tag
#!/bin/bash
set -euo pipefail
set -x
fullimage=${IMAGE:-$1}
image=${fullimage##*/}
repo=${image%%:*}
tag=${image##*:}
REG=${fullimage%%/*}
PROTO=https://
set +x
@fitz123
fitz123 / lockdown.sh
Last active April 26, 2018 19:43
Disable interface if target IP became unavailable
#!/usr/bin/env bash
set -u
IFS=$'\n\t'
## Author: anton.lugovoi
#/
#/ Description: Move interface into the drop zone
#/ if monitored IP became unreachable
#/ Restores interface original zone
#/ if monitored IP became reachable
@fitz123
fitz123 / vpnc-script
Last active April 18, 2018 16:30 — forked from rexroof/vpnc-script
A custom OpenConnect script to set DNS using `networksetup` on OSX, which makes it work with things that don't read from `/etc/resolv.conf`. Change by Rex: move the provided DNS servers to be first in the search path. Change by fitz123: replace path to ip command in order to use BSD-like ip system-wide
#!/bin/sh
#
# Originally part of vpnc source code:
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
# © 2009-2012 David Woodhouse <[email protected]>
#
# 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
# (at your option) any later version.
@fitz123
fitz123 / install
Created November 25, 2017 03:28
install consul server
#!/usr/bin/env bash
set -e
echo "Installing dependencies..."
if [ -x "$(command -v apt-get)" ]; then
sudo su -s /bin/bash -c 'sleep 30 && apt-get update && apt-get install unzip' root
else
sudo yum update -y
sudo yum install -y unzip wget
fi
@fitz123
fitz123 / server
Created November 25, 2017 03:25
basic config
datacenter = "dc1"
ui = true
client_addr = "0.0.0.0"
@fitz123
fitz123 / consul.service
Last active November 17, 2018 17:12
consul.service
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
PIDFile=/run/consul/consul.pid
Restart=on-failure
{
"streams": {
"Nasa-high": {
"input-path": "/liveedge4/smil:c03_high_th.smil/playlist.m3u8?gid=anywhere&uid=2112038&did=1c0bb708-3c1a-54c1-bf8e-174e3809d584&ip=103.13.228.0-103.13.229.255&cid=dtv%3Ac03&exp=915902&max=1&sig=2dccf297b4f274c93b959d292eaca1c3ad4806a8&app=anywhere",
"servers": ["http://tvsedge127.truevisions.tv"]
}
}
}
@fitz123
fitz123 / webapp.js
Last active August 21, 2016 21:51
Current Backend API
var express = require('express')
var bodyParser = require('body-parser');
var MongoClient = require('mongodb').MongoClient;
var ObjectId = require('mongodb').ObjectID;
var app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
var db;
@fitz123
fitz123 / jobtask.sh
Created August 19, 2016 13:05
Job transcoding task
SRV_PORT=9006
CH_NAME=ch7
SRC="udp://@224.2.2.2:1006?fifo_size=1000000&overrun_nonfatal=1"
###
# use 2 CPUs and 1024 RAM for 720p
# use 1 CPU and 512 RAM for 480p
CONSUL=localhost:8500
CH_RES=720
CH_BAND=1800
CPU_RES=2