Skip to content

Instantly share code, notes, and snippets.

António P. P. Almeida perusio

  • Perusio LLC & UP42
  • Berlin, Germany
Block or report user

Report or block perusio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
perusio / gist:8975110
Created Feb 13, 2014
How to run Piwik in a subdirectory
View gist:8975110
# -*- mode: nginx; mode: flyspell-prog; mode: autopair; ispell-local-dictionary: "american" -*-
## Try all locations and relay to index.php as a fallback.
location /piwik/ {
## Disallow any usage of piwik assets if referer is non valid.
location ~* ^.+\.(?:css|gif|jpe?g|js|png|swf)$ {
## Defining the valid referers.
valid_referers none blocked *;
if ($invalid_referer) {
perusio / gist:9033590
Last active Aug 29, 2015
Running drupal in a subdir.
View gist:9033590
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
### Nginx configuration for Drupal. This configuration makes use of
### drush (http:/// for site maintenance
### and like tasks:
### 1. Run the cronjobs.
### 2. Run the DB and code updates: drush up or drush upc followed by
### drush updb to run any DB updates required by the code upgrades
### that were performed.
### 3. Disabling of xmlrpc.xml, install.php (needed only for
perusio / gist:9033447
Last active Aug 29, 2015
Create a map to extract the subdir.
View gist:9033447
map $uri $drupal_dir {
~^/(?<dir>[^/]*)/ $dir;
perusio / gist:9184773
Created Feb 24, 2014
Future pay demo cite certificate chain
View gist:9184773
Certificate chain
0 s:/C=US/ST=Washington/L=Federal Way/O=Futurepay Inc./
i:/C=US/O=DigiCert Inc/ High Assurance CA-3
perusio / gist:9184811
Created Feb 24, 2014
Future Pay live site certificate chain
View gist:9184811
Certificate chain
0 s:/C=US/ST=Washington/L=Federal Way/O=Futurepay Inc./
i:/C=US/O=DigiCert Inc/ High Assurance CA-3
perusio / gist:9196472
Created Feb 24, 2014
Bug in platform with the package manager
View gist:9196472
drush en -y commerce_be2bill
The following extensions will be enabled: commerce_be2bill
Do you really want to continue? (y/n): y
Invalid argument supplied for foreach() [warning]
strtr(): The second argument is not an array [warning]
commerce_be2bill was enabled successfully. [
perusio / project.make
Created Mar 5, 2014
Make file doesn't work dawg
View project.make
; -*-conf-*-
api = 2
core = 7.x
; Commerce kickstart.
projects[commerce_kickstart][type] = core
; Be2Bill needed modules.
projects[commerce_cardonfile] = "2.0-beta2"
projects[commerce_be2bill] = "1.x-dev"
perusio / strict.lua
Created Mar 24, 2014
Verify the usage of global variables previously undeclared from
View strict.lua
-- strict.lua
-- checks uses of undeclared global variables
-- All global variables must be 'declared' through a regular assignment
-- (even assigning nil will do) in a main chunk before being used
-- anywhere or assigned to inside a function.
-- distributed under the Lua license:
local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget
local mt = getmetatable(_G)
View gist:fb9736baf1629f311f55
; Set the shared memory segment size.
apc.shm_size = 256M
; Optimize the require_once and include_once calls.
;apc.include_once_override = 1
; Change the TTL.
apc.ttl = 7200
View gist:77779624f9c6114bb189
-- Require the library.
mmh2 = require "murmurhash2"'
-- Returns a hex representation of the hash.
string.format('%x', mmh2('<string>'))
You can’t perform that action at this time.