Skip to content

Instantly share code, notes, and snippets.

@wsaribeiro
wsaribeiro / nginx.conf
Created July 15, 2016 20:40 — forked from LeonardoGentile/nginx.conf
Nginx HTTPS configs 2016
### Nginx main config: Tweaks & SSL settings (without the FastCGI-cache config parts)
### Copied from http://pastebin.com/FtDdGTeX, All credits to the original author
## http {} block:
http {
# [...]
server_tokens off;
@wsaribeiro
wsaribeiro / vsftpd.sh
Created May 30, 2016 19:33 — forked from yamishi13/vsftpd.sh
Vsftpd Installer
#!/bin/bash
#actualiza repos e instala vsftpd
sudo apt-get update
sudo apt-get install vsftpd -y
#remplaza opcioes para activar/desactivar en el archivo de configuracion
sudo sed -i -e 's/anonymous_enable=YES/anonymous_enable=NO/g' /etc/vsftpd.conf
sudo sed -i -e 's/#local_enable=YES/local_enable=YES/g' /etc/vsftpd.conf
sudo sed -i -e 's/#write_enable=YES/write_enable=YES/g' /etc/vsftpd.conf
---
- name: Group by Distribution
hosts: all
tasks:
- group_by: key={{ansible_distribution}}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
vars:
@wsaribeiro
wsaribeiro / smush.sh
Last active May 21, 2016 22:31 — forked from uglyrobot/smush.sh
Cronjob for optimizing image uploads
#!/bin/bash
JPG_MAX = '85'
#pngs
for i in `find -iname '*.png'`
do
BEFORE_SIZE=$(stat -c%s "$i")
optipng -o2 -preserve -quiet $i
AFTER_SIZE=$(stat -c%s "$i")
@patrickmaciel
patrickmaciel / server_block_wordpress_nginx.conf
Created April 7, 2016 20:10
Configuração do Nginx para um site Wordpress - utilizando um cache violento
# fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:25m inactive=1440m;
# fastcgi_cache_key "$scheme$request_method$host$request_uri";
# fastcgi_cache_use_stale error timeout invalid_header http_500;
# fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
server {
listen 80;
root /var/www/html/pasta_do_wordpress;
index index.php index.html index.htm;
server_name dominiodosite.com.br;
@elipapa
elipapa / _Setup_new_laptop.md
Last active February 26, 2024 04:27
Steps to set up a new osx laptop for data science and computational biology work

Set up a new os x laptop

Steps to setup a new OS X laptop with a data science & computational biology development environment.

Last updated: 7 Jan 2017 macOS: Yosemite => Sierra

Sure you could try to do this from dotfiles, but historically something has broken and required manual input anyway. So, inspired by the pragmatism of paul irish bash setup script and a few other gists written in markdown like this, I rolled my own.

Some design considerations:

#!/bin/sh
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
@harshadyeola
harshadyeola / nginx-plus-fastcgi-cache.conf
Last active June 5, 2018 14:25
NGINX PLUS FASTCGI CACHE CONFIGURATION
# FastCGI cache settings
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m;
fastcgi_cache_key "$scheme://$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
fastcgi_cache_valid 200 6h;
fastcgi_cache_valid 404 10m;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
@oogali
oogali / etc-nginx-conf.d-observium.conf
Created September 10, 2015 15:42
Observium Nginx configuration
server {
listen 80;
server_name observium.yourdomain.com;
access_log /var/log/nginx/observium-access_log combined;
error_log /var/log/nginx/observium-error_log warn;
root /opt/observium/html;
client_max_body_size 10m;
client_body_buffer_size 8K;
# -*- coding: utf-8 -*-
from datetime import datetime
from django.core.files.base import ContentFile
from django.core.files.storage import Storage
from django.utils.deconstruct import deconstructible
from settings.base import get_env_variable