Skip to content

Instantly share code, notes, and snippets.

View suigintoulain's full-sized avatar

Zachary Hardesty suigintoulain

View GitHub Profile

Keybase proof

I hereby claim:

  • I am suigintoulain on github.
  • I am suigintoulain (https://keybase.io/suigintoulain) on keybase.
  • I have a public key ASD8XaK7SoVlDt99DrEz8wnwVo6-pJUMZT9bJW-JJz12HQo

To claim this, I am signing this object:

@suigintoulain
suigintoulain / generic zone file for nsd.conf
Created August 27, 2013 12:03
name it after your domain eg. example.com and put it in /etc/nsd3 OR /usr/local/etc/nsd OR whatever your package maintainer wants you to do
$ORIGIN example.com.
$TTL 3600 ; 1 hour
@ IN SOA ns1.example.com. root.example.com. ( ; your ns1 server or your host followed by the admins email with . not at
2013082701 ; serial ; yyyymmdd and 01 02 depending on how many edits that day
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
3600 ; minimum (1 hour)
)
NS ns1.example.com. ; your first ns
server:
ip-address: (ip goes here)
port: 53
server-count: (number of threads eg. 2)
ip4-only: yes
hide-version: yes
identity: ""
zonesdir: "/etc/nsd3"
key:
# NO WARRANTIES
log in as root OR sudo -s OR su -
apt-get -y install python-software-properties
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian wheezy main'
apt-get update
apt-get -y install nginx php5-fpm php5-gd php5-mysqlnd mariadb-server
@suigintoulain
suigintoulain / universal php-fpm user conf
Created May 24, 2013 22:56
Delete /etc/php5/fpm/pool.d/www.conf (on ubuntu/debian), create a user, name the file createdusername.conf (if you fail this step, you're an idiot,) replace [username] with created username
[username]
listen = 127.0.0.1:9000 #increment this for new users
user = username
group = username
pm = dynamic
pm.max_children = 100
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 200
@suigintoulain
suigintoulain / universal nginx site
Last active September 11, 2019 18:15
Replace fixme with whatever port you put the php-fpm for "username" on. This is very unsecure and you should research how to secure file upload directories.
server {
server_name www.example.com;
root /home/username/www;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
location ~ \.php {
# zero day fix, unsure if still necessary
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:fixme;
fastcgi_index index.php;
@suigintoulain
suigintoulain / debian-based or ubuntu nginx.conf
Last active September 11, 2019 18:15
Simple, based on my freebsd nginx.conf. Put site configs in /etc/nginx/sites/ and don't use those stupid symlinks that the distro packagers use.
user www-data;
# number of cpus x 2
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
}
http {