I've tried so much times install GoAccess. For this reason, i create this gist to make your job easy.
Don't skip the steps:
$ sudo su
# cd /usr/local/src
<?php | |
// from http://php.net/manual/en/function.filesize.php | |
function formatBytes($bytes, $precision = 2) { | |
$units = array('B', 'KB', 'MB', 'GB', 'TB'); | |
$bytes = max($bytes, 0); | |
$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); | |
$pow = min($pow, count($units) - 1); | |
// by Erik Wrenholt | |
import java.util.*; | |
class Mandelbrot | |
{ | |
static int BAILOUT = 16; | |
static int MAX_ITERATIONS = 1000; | |
private static int iterate(float x, float y) | |
{ |
// vanilla JavaScript | |
var links = document.links; | |
for (var i = 0, linksLength = links.length; i < linksLength; i++) { | |
if (links[i].hostname != window.location.hostname) { | |
links[i].target = '_blank'; | |
} | |
} | |
// or in jQuery |
<?php | |
// Same approach as of `fizzbuzz_short.php` but with some generators love so you | |
// can fizzbuzz all you want without blowing up you memory. HOW GREAT IS IT? | |
$fbrange = function ($start, $stop) { | |
if ($start > 0) { | |
for ($n = $start; $n < $stop; $n++) { | |
yield (($f=!($n%3))|($b=!($n%5)))?($f?'Fizz':'').($b?'Buzz':''):"$n"; | |
} |
modifier: None | |
created: | |
modified: 20100127161718 | |
type: None | |
tags: systemConfig | |
/*** | |
|Name|BookmarkletPlugin| | |
|Version|0.1| | |
|Author|Ben Gillies| |
#!/bin/bash | |
# Logging utility that simplifies user of bash logger command | |
# # First source the script | |
# source ~/scripts/logr.bash | |
# # Start the logger, generates log name from scripts filename | |
# logr start | |
# # or define your own | |
# logr start LOG_NAME |
<?php | |
/* | |
echo plural_form(42, array('арбуз', 'арбуза', 'арбузов')); | |
*/ | |
function plural_form($n, $forms) { | |
return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]); | |
} |
#!/usr/bin/env bash | |
# | |
# Script to create MySQL db + user | |
# | |
# @author Karel Wintersky <karel.wintersky@gmail.com> | |
# @version 0.2 | |
# mysql_config_editor set --login-path=proftpd --host=localhost --user=proftpd --password | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
namespace csv | |
{ | |
static class CSV | |
{ |