Skip to content

Instantly share code, notes, and snippets.

View AlexAndrascu's full-sized avatar
🦉

Alex Andrascu AlexAndrascu

🦉
  • Bletchley, United Kingdom
View GitHub Profile
@Alvarus
Alvarus / nginx.kolab3.conf
Last active January 17, 2019 14:17
A sample nginx + php-fpm pool config for Kolab 3. Roundcube web client will be accessible from "https://mail.example.net", Kolab web administration from "https://mail.example.net/kolab-webadmin". Attempt to set all php variables using "fastcgi_param PHP_VALUE" resulted in strange behaviour, so they're set in php-fpm pools. Please note that sligh…
# http part, may want to move that to nginx.conf, but will work here also
fastcgi_cache_path /var/lib/nginx/fastcgi/ levels=1:2 keys_zone=kolab3.example.net:16m max_size=256m inactive=1d;
fastcgi_temp_path /var/lib/nginx/fastcgi/temp 1 2;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
listen 80;
server_name kolab3.example.net;
rewrite ^ https://$server_name$request_uri permanent; # enforce https
@johnnncodes
johnnncodes / gist:8436644
Created January 15, 2014 13:54
Using custom validation messages in Sails.js. Credits to: sfb_
/**
* Takes a Sails Model object (e.g. User) and a ValidationError object and translates it into a friendly
* object for sending via JSON to client-side frameworks.
*
* To use add a new object on your model describing what validation errors should be translated:
*
* module.exports = {
* attributes: {
* name: {
* type: 'string',
@rbarros
rbarros / fix1.sh
Created February 12, 2015 20:29
This script remove malware of PHP files.
#!/bin/bash
#
# This script remove malware of PHP files.
#
# In this case it will remove some malicious code
# from all Wordpress PHP files that is at top of
# every PHP file.
#
# The string at the top of every file is:
#