Skip to content

Instantly share code, notes, and snippets.

@Scumtron
Scumtron / geoip.sh
Created July 26, 2018 18:09 — forked from kenjij/geoip.sh
Downloading free MaxMind GeoIP file, use with NGINX
# Download the legacy format for NGINX compatibility
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# Unzip
gunzip Geo*.gz
# Copy to /usr/share/GeoIP/
cp Geo*.dat /usr/share/GeoIP/
@Scumtron
Scumtron / compress.sh
Last active February 24, 2018 10:18
Compression static with Brotli and Zopfli
#!/bin/bash
filetypes=(js css)
user=user:user
zcomp() {
for file in ./static/*.${1}; do
zopfli --i1000 ${file}
chown $user ${file}.gz
done
@Scumtron
Scumtron / nginx.sh
Last active September 27, 2022 17:56
Nginx updater with custom modules over ISPmanager Lite 5
#!/bin/bash
#
# chmod +x nginx.sh && ./nginx.sh
#
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
export NGX_VER=1.13.9
#!/usr/bin/python
#
# 20-updates - create the system updates section of the MOTD
# Copyright (c) 2013 Nick Charlton
#
# Authors: Nick Charlton <[email protected]>
# Based upon prior work by Dustin Kirkland and Michael Vogt.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#!/bin/bash
#
# 10-sysinfo - generate the system information
# Copyright (c) 2013 Nick Charlton
#
# Authors: Nick Charlton <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@Scumtron
Scumtron / 00-header
Last active February 20, 2018 19:56
#!/bin/sh
#
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
#
# Authors: Nick Charlton <[email protected]>
# Dustin Kirkland <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@Scumtron
Scumtron / limits.conf
Last active February 20, 2018 17:53
/etc/security/limits.conf
* - nofile 1048576
* soft nproc 65000
* hard nproc 500000
* hard nofile 500000
* soft nofile 500000
root hard nofile 500000
root soft nofile 500000
@Scumtron
Scumtron / 99-sysctl.conf
Last active July 8, 2023 16:03
/etc/sysctl.d/99-sysctl.conf
# Kernel sysctl configuration file for Linux
# Version 1.11 - 2015-07-07
# Aysad Kozanoglu Aysad K.
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
#
# Tested with: Ubuntu 14.04 LTS kernel version 3.13
# Debian 7 kernel version 3.2