Skip to content

Instantly share code, notes, and snippets.

View yegorg's full-sized avatar

Yegor G. yegorg

View GitHub Profile
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
vrrp_script chk_haproxy {
script "killall -0 haproxy" # verify the pid existance
interval 2 # check every 2 seconds
weight 2 # add 2 points of prio if OK
}
vrrp_instance VI_1 {
interface eth0 # interface to monitor
state MASTER
virtual_router_id 51 # Assign one ID for this route
@yegorg
yegorg / kibana.json
Created November 11, 2015 08:46 — forked from untergeek/kibana.json
Simple Kibana dashboard for collectd stats
{
"title": "Collectd: Blackbox",
"services": {
"query": {
"list": {
"0": {
"query": "plugin:\"load\"",
"alias": "Load",
"color": "#7EB26D",
"id": 0,
@yegorg
yegorg / rsyslog-35-remote.conf
Created November 12, 2015 02:06
enable remote logging / server
$modload imtcp
$InputTCPServerRun 10514
# $ActionQueueType LinkedList # use asynchronous processing
# $ActionQueueFileName srvrfwd # set file name, also enables disk mode
# $ActionResumeRetryCount -1 # infinite retries on insert failure
# $ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down
# *.notice @@logserver.local:10514
auth,authpriv.* -/var/log/auth.log
@yegorg
yegorg / instructions.md
Created November 12, 2015 05:18 — forked from jiphex/instructions.md
Static OpenVPN between two hosts

Static OpenVPN configuration between a single pair of hosts

So you've got two boxes, separated by some kind of network that you're not in control of, and you'd like to encrypt traffic between them. You're not going to have multiple clients connecting to each other, just these two boxes.

As of OpenVPN 2, it's possible to configure the hosts in peer-to-peer mode, with static keying, meaning that the actual VPN setup is super easy:

  1. Install OpenVPN (>=2) on both boxes, the standard Wheezy version is fine.
  2. Generate a static key as follows: openvpn --genkey --secret /path/to/somewhere/secret.key
  3. Copy the secret key to both boxes over a secure channel (e.g SSH)
  4. Create /etc/openvpn/p2p.conf on both boxes as show in box1.vpn.cnf and box2.vpn.cnf below
@yegorg
yegorg / text.md
Created November 12, 2015 05:19 — forked from awinder/text.md
Vyatta Blog Post Outline

Building Secure Networks with Vyatta

What is Vyatta, and why do you want to use it?

  • Discussion of key strenths of vyatta, and firewalls in general
  • Link to the open-source VyOS version and the commercial Vyatta project
  • Talk about Softlayer choices specifically -- why softlayer version is insecure / finnicky with SSL & PPTP options, limitations & cost of the Fortigate appliance

Splitting your public and private traffic

@yegorg
yegorg / README.md
Created November 12, 2015 05:38 — forked from schickling/README.md
Install OpenVPN on Ubuntu 14.04 for yourserver.se

Preconditions

  • You need to have TUN/TAP enabled

Install dependencies

$ apt-get install -y openvpn easy-rsa
@yegorg
yegorg / sysctl.conf
Created September 20, 2016 09:25 — forked from jgeiger/sysctl.conf
Tweaked sysctl.conf for ubuntu
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
@yegorg
yegorg / blocksync.py
Created March 31, 2017 08:07 — forked from shodanshok/blocksync.py
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <[email protected]>
Copyright 2011 Robert Coup <[email protected]>
License: GPL
Getting started:
@yegorg
yegorg / DNS tunneling with iodine.md
Created May 31, 2017 19:03 — forked from nukeador/DNS tunneling with iodine.md
How to install and use iodine for DNS tunneling.

##Domain

We need some records on our domain (mydomain.com) DNS for connections. Add these records:

t1              IN      NS      t1ns.mydomain.com. ; note final the dot!
t1ns            IN      A       OUR_SERVER_IP

##Server