Skip to content

Instantly share code, notes, and snippets.

@Madji
Madji / haproxy.cfg
Created Sep 4, 2019 — forked from T0MM0R/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
View haproxy.cfg
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@Madji
Madji / he-dns-update.sh
Created Nov 24, 2018 — forked from joemiller/he-dns-update.sh
script for updating dynamic DNS records on he.net (hurricane electric)
View he-dns-update.sh
#!/bin/bash
#
# Script for updating DNS records on Hurricane Electirc's DNS system (https://dns.he.net).
#
# The record will be updated with the IP address that originates the request.
#
# Usage
# -----
#
# Create config file `/etc/he-dns-update.conf`:
@Madji
Madji / README.md
Created May 5, 2018 — forked from LeonDevLifeLog/README.md
Telegram webhooks with nginx reverse proxy
View README.md

Make config file:

sudo nano /etc/nginx/sites-available/bot.conf

Then copy and paste bot.conf content and edit YOUR.DOMAIN strings. Now install Let's Encrypt on your server. For example in Debian you need to add jessie-backports and easily install it with apt-get:

sudo apt-get install -t jessie-backports letsencrypt

Then get cert for you domain:

@Madji
Madji / vpnclient
Created Jan 21, 2018 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
View vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.
@Madji
Madji / bridge-conf
Created Aug 20, 2017 — forked from Belphemur/bridge-conf
Configuration and scripts for OpenVPN in Bridged Mode. Script to generate new client (with their keys and configuration file for OpenVPN). Script to manage the bridge. Configuration for systemd to start/stop the OpenVPN with Brige.
View bridge-conf
#!/bin/bash
# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="192.168.42.2"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.42.255"
eth_gateway="192.168.42.1"
eth_mac="XX:XX:XX:XX:XX:XX"
View client.sh
ADDRESS=10.10.0.2
CLIENT=$(hostname -s)
yum install -y epel-release
yum install -y tinc
mkdir -p /etc/tinc/hosts
cat >/etc/tinc/tinc.conf <<EOF
Name=$CLIENT
ConnectTo=vp1
EOF
tincd -K </dev/null
@Madji
Madji / ssh-telegram.sh
Created Jan 22, 2017 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
View ssh-telegram.sh
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
You can’t perform that action at this time.