Skip to content

Instantly share code, notes, and snippets.

@boynoiz
boynoiz / gulpfile.js
Last active August 29, 2015 14:15
My Gulpfile.js
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del gulp-sourcemaps --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
@boynoiz
boynoiz / gist:7052775b333550752618
Created February 27, 2015 08:23
compile php-fpm
mkdir -p /usr/local/src/php5-build
mkdir -p /opt/php-5.6.5
./configure --prefix=/opt/php-5.6.5 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --enable-phar --with-pear
cp /usr/local/src/php5-build/php-5.6.5/php.ini-production /opt/php-5.6.5/lib/php.ini
cp /opt/php-5.6.5/etc/php-fpm.conf.default /opt/php-5.6.5/etc/php
@boynoiz
boynoiz / phpinfo.php
Last active August 29, 2015 14:16 — forked from krisanalfa/phpinfo.php
<!DOCTYPE html>
<html>
<head>
<title>PHP INFO</title>
<style type="text/css">
body {font-family: "Ubuntu Mono", "Monospace", "Monaco", "Courier New"; font-size: 12px}
</style>
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
</head>
<body>
@boynoiz
boynoiz / munin-froxlor-vhost
Last active November 24, 2015 13:05
munin-froxlor-vhost
# Rewrite rules to serve traffic from the root instead of /munin-cgi
RewriteEngine On
#Static files
RewriteRule ^/favicon.ico /var/www/munin/static/favicon.ico [L]
RewriteRule ^/static/(.*) /var/www/munin/static/$1 [L]
RewriteRule ^/.*/static/(.*) /var/www/munin/static/$1 [L]
# HTML
RewriteCond %{REQUEST_URI} .html$ [or]
@boynoiz
boynoiz / php7.sh
Last active September 5, 2018 16:30
PHP 7.0 on Debian 7 Wheezy
#!/bin/bash
set -e
PHP_VERSION=7.0
# Script base on php7.sh by Tom Van Looy https://gist.github.com/tvlooy/881d0d67d0ad699c38a3
# Dont use this shell script in production server unless you dont care
# You must first add the testing repository in your sourcelist before run this
# You must stop php7-fpm service if you already install
@boynoiz
boynoiz / Rakefile
Last active October 28, 2015 10:47 — forked from rosskevin/Rakefile
Rakefile - less to sass a.k.a. less2sass or less2scss
# less to scss based on http://stackoverflow.com/a/19167099/2363935
namespace :convert do
task :less_to_scss do
source_glob = "resources/assets/less/*.less"
dest_dir = "resources/assets/sass/"
rm_r dest_dir rescue nil
mkdir_p(dest_dir)
@boynoiz
boynoiz / sysctl.conf
Created November 7, 2015 10:12 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1

SSL Cheat Sheet

Create self signed certificate:

openssl req -new -x509 -sha256 -newkey rsa:2048 -nodes -keyout server.key -days 365 -out server.crt

Create new key:

openssl genrsa -out server.key 2048
var gulp = require('gulp');
var sass = require('gulp-sass');
var postcss = require('gulp-postcss');
var cssnano = require('gulp-cssnano');
var sourcemaps = require('gulp-sourcemaps');
var merge = require('merge-stream');
var clone = require('gulp-clone');
var bower_path = 'vendor/bower_components';
@boynoiz
boynoiz / do-debian8-locale-issues.md
Created March 10, 2016 09:12 — forked from 5car1z/do-debian8-locale-issues.md
Debian 8 DO Locale Issues Fix

#Debian 8 DO Locale Issues Fix

##Problem

"Locale problems" in both the 32-bit & 64-bit versions of Debian 8 droplets

Create a new Debian 8 droplet and login as root: