Skip to content

Instantly share code, notes, and snippets.

Avatar

Achim Rosenhagen arosenhagen

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am arosenhagen on github.
  • I am aro (https://keybase.io/aro) on keybase.
  • I have a public key ASDvoh9uZE6d55TVvbBnVryerBlfkZVntZ7qR9F9v06WKgo

To claim this, I am signing this object:

@arosenhagen
arosenhagen / exception.php
Last active May 9, 2018 — forked from abtris/exception.php
Magento How To Show Full Error/Exception Message Instead of Truncated One
View exception.php
<?php
function getExceptionTraceAsString($exception) {
$rtn = "";
$count = 0;
foreach ($exception->getTrace() as $frame) {
$args = "";
if (isset($frame['args'])) {
$args = array();
foreach ($frame['args'] as $arg) {
if (is_string($arg)) {
@arosenhagen
arosenhagen / gist:8aaf5d7f94171778c0e9
Last active Feb 16, 2021 — forked from supairish/gist:2951524
[nginx] limit requests from searchengine crawlers/bots to 1r/m (prevent DDOS)
View gist:8aaf5d7f94171778c0e9
http {
map $http_user_agent $limit_bots {
default '';
~*(bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
@arosenhagen
arosenhagen / gist:700cc39ecee0c2ac03b4
Last active Aug 29, 2015
create self-signed ssl certificate
View gist:700cc39ecee0c2ac03b4
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days XXX -nodes
@arosenhagen
arosenhagen / gist:10401848
Created Apr 10, 2014
install docker in a vagrant box
View gist:10401848
$docker = <<SCRIPT
wget -q -O - https://get.docker.io/gpg | apt-key add -
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update -qq
apt-get install -q -y --force-yes lxc-docker
usermod -a -G docker vagrant
docker version
su - vagrant -c 'echo alias d=docker >> ~/.bash_aliases'
SCRIPT
@arosenhagen
arosenhagen / php.xdebug.ini.erb
Last active Dec 15, 2015
completely parameterized php.xdebug.ini from xdebug 2.2.2 to use with chef provisioning. This aims to be a 1:1 copy which can be edited by node attributes
View php.xdebug.ini.erb
<% unless @xdebug['zend_extension'].empty? %>
zend_extension = <%= @xdebug['zend_extension'] %>
<% else %>
zend_extension = xdebug.so
<% end %>
[xdebug]
<% unless @xdebug['auto_trace'].empty? %>
xdebug.auto_trace = <%= @xdebug['auto_trace'] %>
<% else %>
xdebug.auto_trace = 0
@arosenhagen
arosenhagen / php.apc.ini.erb
Created Apr 1, 2013
completely parameterized php.apc.ini from apc 3.1.13 to use with chef provisioning. This aims to be a 1:1 copy which can be edited by node attributes.
View php.apc.ini.erb
<% unless @apc['extension'].empty? %>
extension = <%= @apc['extension'] %>
<% else %>
extension = apc.so
<% end %>
[APC]
<% unless @apc['enabled'].empty? %>
apc.enabled = <%= @apc['enabled'] %>
<% else %>
apc.enabled = "1"
@arosenhagen
arosenhagen / php.ini-production.erb
Created Apr 1, 2013
completely parameterized php.ini-production from php 5.4.13 to use with chef provisioning. This aims to be a 1:1 copy which can be edited by node attributes.
View php.ini-production.erb
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@arosenhagen
arosenhagen / index.php
Last active Oct 23, 2020
[magento] multidomain-multistore-multistoreview setup with visible language codes
View index.php

Use these snippets to setup a magento installation with the following structure:

@arosenhagen
arosenhagen / default.vcl
Last active Dec 14, 2015
varnish wildcard vcl include: run /etc/varnish/include_varnish_configs then include vcl.d/.all_includes.vcl in your default.vcl
View default.vcl
include "vcl.d/.all_includes.vcl";