Skip to content

Instantly share code, notes, and snippets.

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 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
@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 / 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 / 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 / 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 / remove click_under.js
Created May 14, 2019 09:40
tampermonkey remove click under js.
Object.defineProperty(navigator, "userAgent", {value: 'fake browser'});
// ==UserScript==
// @name prevent pop-ad
// @include http://animeflv.net/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
@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 / gist:3f59cd5c58305f7e5e7ff94d8d1a7816
Created August 15, 2019 06:55
Using curl for testing apps behind load-balancers
curl --verbose --header 'Host: www.example.com' 'http://10.1.1.36:8000/the_url_to_test'
func TestGetEntryByID(t *testing.T) {
req, err := http.NewRequest("GET", "/entry", nil)
if err != nil {
t.Fatal(err)
}
q := req.URL.Query()
q.Add("id", "1")
req.URL.RawQuery = q.Encode()
rr := httptest.NewRecorder()