Skip to content

Instantly share code, notes, and snippets.

@katmai
katmai / ovpn_client.sh
Created March 8, 2019 13:05
OpenVPN Client Configuration Generate Script
#!/bin/bash
# OpenVPN configuration Directory
OPENVPN_CFG_DIR=/etc/openvpn
# Directory where EasyRSA outputs the client keys and certificates
KEY_DIR=/etc/openvpn/easy-rsa/keys
# Where this script should create the OpenVPN client config files
OUTPUT_DIR=/etc/openvpn/client-config
@katmai
katmai / sysctl.conf
Created January 24, 2017 10:55 — forked from sokratisg/sysctl.conf
Tuned sysctl.conf for use by CentOS/RHEL 6.x or later
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Turn on execshield
# 0 completely disables ExecShield and Address Space Layout Randomization
# 1 enables them ONLY if the application bits for these protections are set to “enable”
# 2 enables them by default, except if the application bits are set to “disable”
# 3 enables them always, whatever the application bits
@katmai
katmai / nginx-cors.conf
Created October 31, 2016 09:00 — forked from algal/nginx-cors.conf
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@katmai
katmai / cors-nginx.conf
Created October 31, 2016 09:00 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#

Introduction to Magenta

We’re happy to announce Magenta, a project from the Google Brain team that asks: Can we use machine learning to create compelling art and music? If so, how? If not, why not?

Steps to setup Magenta

@katmai
katmai / my.cnf
Created November 15, 2015 18:28 — forked from fevangelou/my.cnf
Optimized MySQL configuration
# The settings provided below are ideal for a 4GB-8GB RAM server.
# You can adjust values accordingly for higher or lower spec systems, but generally,
# it's an almost "one size, fits all" setup.
# Use DB diagnostics tools like:
# https://launchpad.net/mysql-tuning-primer or http://blog.mysqltuner.com/download/
# to get more insight on your MySQL DB's resource usage and more...
# Special thanks to Yves Trudeau (Percona) for his valuable help on compiling this setup.
[mysqld]
default_storage_engine=InnoDB # Options are MyISAM & InnoDB. Prefer the latter
@katmai
katmai / gist:a9eba188e1f1036e8fca
Created November 15, 2015 18:26
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
@katmai
katmai / default.vcl
Created November 15, 2015 17:48 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla (& other CMS based) websites
#################################################################################
### The perfect Varnish configuration for Joomla (& other CMS based) websites ###
#################################################################################
# USE: Place the contents of this configuration inside the main
# Varnish configuration file, located in: /etc/varnish/default.vcl (root server access required - obviously)
# IMPORTANT: The following setup assumes a 2 minute cache time. You can safely increase
# this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites.