Skip to content

Instantly share code, notes, and snippets.

@dcnl1980
dcnl1980 / nginx-naxsi.sh
Created November 28, 2016 22:00
Nginx Naxsi (firewall) on Ubuntu 16.04
#!/usr/bin/env bash
apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \
libgoogle-perftools-dev google-perftools jq
mkdir /tmp/ngxbuild
cd /tmp/ngxbuild
latestNginx=$(curl -s http://hg.nginx.org/nginx/tags |
grep "^ *release-" | head -1 | cut -c 9-)
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases |
jq -r .[].tag_name | grep -v rc | head -1)
@dcnl1980
dcnl1980 / hipchat-server.sh
Created November 28, 2016 21:59
Install the HipChat Server
sudo su
echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add -
apt-get update
apt-get install hipchat
@dcnl1980
dcnl1980 / zabbix-server.sh
Created November 28, 2016 21:57
Zabbix Server Installation
#!/bin/sh
apt update && apt install wget htop curl nano ssh -y
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb && apt-get update
export DEBIAN_FRONTEND=noninteractive
apt install zabbix-server-mysql zabbix-frontend-php -y
@dcnl1980
dcnl1980 / nginx-cookieless.conf
Last active September 17, 2021 02:48
Nginx Cookieless Domain
#
# Name: nginx-cookieless.conf
# Auth: Chris van Steenbergen <cvsteenbergen@gmail.com>
# Date: 12 August 2016
# Desc: Nginx Cookieless Domain configuration for 100% performance grade with
#
# See for yourself at: https://tools.pingdom.com/#!/beJG0v/http://www.reclick.nl
#
server {
@dcnl1980
dcnl1980 / create-slugs.php
Created August 6, 2016 14:40
Create Slugs in large MYSQL tables
<?php
// This script must be run on a command line
error_reporting(E_ALL);
set_time_limit(1200);
date_default_timezone_set("Europe/Amsterdam");
$mysqli = new mysqli('localhost', 'username', 'password', 'table');
if ($mysqli->connect_error) {
@dcnl1980
dcnl1980 / nginx-tls.conf
Last active June 13, 2016 12:23
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Chris van Steenbergen <cvsteenbergen@gmail.com>
# Date: 13 June 2016
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are omitted here.
#
# Preparation: Strong 4096 bits DHE parameters (takes time)