Skip to content

Instantly share code, notes, and snippets.

View perusio's full-sized avatar

António P. P. Almeida perusio

View GitHub Profile
@perusio
perusio / project.make
Created March 5, 2014 14:16
Make file doesn't work dawg
; -*-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
perusio / gist:9196472
Created February 24, 2014 20:34
Bug in platform with the package manager
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() bootstrap.inc:1529 [warning]
strtr(): The second argument is not an array bootstrap.inc:1546 [warning]
DRUSH_GET_CLASS_ERROR [error]
commerce_be2bill was enabled successfully. [
@perusio
perusio / gist:9184811
Created February 24, 2014 09:53
Future Pay live site certificate chain
CONNECTED(00000003)
---
Certificate chain
0 s:/C=US/ST=Washington/L=Federal Way/O=Futurepay Inc./CN=api.futurepay.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
-----BEGIN CERTIFICATE-----
MIIGpjCCBY6gAwIBAgIQD7KB06XHieFnEY5VOsFTiTANBgkqhkiG9w0BAQUFADBm
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBDQS0zMB4XDTEzMDUyOTAwMDAwMFoXDTE2MDgwMTEyMDAwMFowbTELMAkGA1UE
@perusio
perusio / gist:9184773
Created February 24, 2014 09:49
Future pay demo cite certificate chain
CONNECTED(00000003)
---
Certificate chain
0 s:/C=US/ST=Washington/L=Federal Way/O=Futurepay Inc./CN=demo.futurepay.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
-----BEGIN CERTIFICATE-----
MIIGvzCCBaegAwIBAgIQDxc1iZrsrm3FtPQEbC08ADANBgkqhkiG9w0BAQUFADBm
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBDQS0zMB4XDTEzMDYxNzAwMDAwMFoXDTE2MDYyMTEyMDAwMFowbjELMAkGA1UE
@perusio
perusio / gist:9033590
Last active August 29, 2015 13:56
Running drupal in a subdir.
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
### Nginx configuration for Drupal. This configuration makes use of
### drush (http:///drupal.org/project/drush) 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
perusio / gist:9033447
Last active August 29, 2015 13:56
Create a map to extract the subdir.
map $uri $drupal_dir {
~^/(?<dir>[^/]*)/ $dir;
}
@perusio
perusio / gist:8975110
Created February 13, 2014 13:35
How to run Piwik in a subdirectory
# -*- 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 *.mysite.com othersite.com;
if ($invalid_referer) {
@perusio
perusio / gist:7083057
Last active December 26, 2015 02:59
Drop all stashes from git in a single command line.
git stash list | cut -f 1 -d ':' | sort -r | xargs -n 1 git stash drop
@perusio
perusio / gist:7081563
Created October 21, 2013 10:11
Remove all messages from the Postfix queue.
mailq | awk '/^[0-9A-F]+/ {print $1}' | postsuper -d -
@perusio
perusio / gist:7080496
Last active December 26, 2015 02:39
Limit access to the global environment in a Lua module to avoid side effects.
-- Include this after all import of global functions
-- and modules in your module.
-- If we are in Lua 5.1 this function exists.
if _G.setfenv then
setfenv(1, {})
else -- Lua 5.2.
_ENV = nil
end