Skip to content

Instantly share code, notes, and snippets.

@alekc
alekc / Installation of Keepalived with Systemd on Debian Jessie.sh
Last active April 14, 2016 11:13
Installation instructions of latest (at the moment of writing) keepalived on Debian.
apt-get install build-essential libssl-dev -y
cd /tmp
wget http://www.keepalived.org/software/keepalived-1.2.20.tar.gz
tar xzvf keepalived*
cd keepalived*
./configure --prefix=
make
make install
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /root/.gvm/scripts/gvm
# Add bison dependency
apt-get install -y bison
# Add go. Note: you need to go through the 1.4 due to toolchain being replaced in 1.5 version. Not
# sure if that's still a case for 1.6, but just in case...
gvm install go1.4
@alekc
alekc / installation-carbon-relay-ng.sh
Created April 14, 2016 12:37
Installation of carbon relay ng
# Installing carbon-relay-ng requirements
go get -d github.com/graphite-ng/carbon-relay-ng
go get github.com/jteeuwen/go-bindata/...
# Build and install carbon
cd /root/.gvm/pkgsets/go1.6.1/global/src/github.com/graphite-ng/carbon-relay-ng
mv carbon-relay-ng /usr/local/bin/
mkdir -p /etc/carbon-relay-ng/
@alekc
alekc / varnish-hash-debug.vcl
Created February 1, 2017 13:21
How to set varnish hash debug
Hi, is it just me or varnish 5 doesn't print hash_data() debug info in varnishlog like it used to around version 2?
Alekc
(http://pastebin.com/6C4G6XsJ)
← hpeter has quit (Client exited)
→ hpeter has joined
daghf
Alekc: param.set vsl_mask +Hash should enable that
← vegazo has quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
→ vegazo has joined
Alekc
@alekc
alekc / squid.conf
Created February 27, 2018 09:33
Transparent squid setup with custom ads blocking.
#
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
@alekc
alekc / remove-all-from-docker.sh
Last active November 7, 2018 15:43 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
docker system prune
docker volume prune
docker rmi -f `docker images -qa `
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
@alekc
alekc / install-docker-and-compose.sh
Last active October 4, 2018 16:01
install docker
apt-get update && apt-get install curl -y && curl -fsSL get.docker.com | sh
curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@alekc
alekc / debian-install-secure-tls-docker.sh
Last active June 8, 2019 21:39
create secure tls docker
#!/bin/bash/
apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
sudo \
gnupg2 \
software-properties-common
curl -fsSL get.docker.com | sh
@alekc
alekc / firehol-cheatsheet.sh
Last active November 30, 2018 15:12
Firehol cheatsheet
#Define custom service directly inside interface block
server custom grayrests "tcp/9000" any accept
#Common noise ports
server custom plex "tcp/32412" any drop
server custom smb "tcp/445" any drop
#Whitelist an ip address(es)
server all accept src "8.8.8.8,1.1.1.1"
@alekc
alekc / install-firehol-netdata.sh
Last active March 7, 2020 16:02
Install firehol and netdata.
#!/bin/bash
# You can also run this script with 1 line
# curl https://gist.githubusercontent.com/alekc/dcbf3a6e0d76560023fb08a6aa58d02c/raw/install-firehol-netdata.sh | bash
LC_ALL=C
# you need to install a basic build environment
# this is for ubuntu, change it according to your needs for other systems
apt-get update && apt-get install -y zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config traceroute ipset curl nodejs zip unzip jq ulogd2 autoconf-archive || exit 1
for x in iprange firehol netdata