Skip to content

Instantly share code, notes, and snippets.

@samrose
samrose / dbg
Last active December 16, 2015 13:59
dbg commands for Erlang
dbg:tracer().
dbg:p(all, c).
dbg:tpl(boss_router, x).
@samrose
samrose / cb_admin_command_chain
Created May 21, 2013 15:06
cb_admin command chain (thanks to @kotedo )
rm -rf cb_admin && git clone git://github.com/evanmiller/cb_admin.git && cd cb_admin && vi boss.config && ./rebar compile && cd -
@samrose
samrose / drupal_nginx_conf
Created August 21, 2013 12:26
Drupal nginx conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@samrose
samrose / default
Created August 21, 2013 12:39
default conf for nginx sites-available
server {
server_name localhost;
root /var/www/;
# Enable compression, this will help if you have for instance advaggΓÇÄ module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
log_not_found off;
@samrose
samrose / drupal_site
Created August 21, 2013 12:41
typical drupal site nginx sites-available file
server {
server_name example.com www.example.com;
root /var/www/example;
# Enable compression, this will help if you have for instance advaggΓÇÄ module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
log_not_found off;
@samrose
samrose / nginx_drupal
Created August 21, 2013 12:45
Settings needed for NGINX drupal conf
Edits to /etc/php5/fpm/pool.d/www.conf
;listen = 127.0.0.1:9000
listen = /var/run/php-fpm.sock
pm.max_requests = 5000
Edits to /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0
@samrose
samrose / gist:6296154
Last active December 21, 2015 10:59
Drupal7 tomcat7 solr4.4.0 configuration
(setup tomcat 7 [task was already done])
download solr wget http://mirror.nexcess.net/apache/lucene/solr/4.4.0/solr-4.4.0.tgz
following http://calibrate.be/labs/create-multi-core-solr-4-service-running-tomcat-6-ubuntu-1204-lts (same approach works for tomcat7)
except not multicore, so:
cp /var/www/example.com/sites/all/modules/apachesolr/solr-conf/solr-4.x/* solr/collection1/conf/
@samrose
samrose / apc_drupal
Created August 22, 2013 18:51
Drupal APC Steps Ubuntu 12.04 LTS Apache 2 mod_php
Pre-req:
apt-get install libpcre3-dev
pecl install apc
drush dl apc
edit /etc/php5/apache2/php.ini add:
extension=apc.so
@samrose
samrose / gist:6554033
Last active December 23, 2015 00:29
aegir ubuntu 12.04 error
+ echo Enabling hosting-queued daemon
Enabling hosting-queued daemon
+ su -s /bin/sh aegir -c drush @hostmaster pm-enable -y hosting_queued
Table 'vagrantlocal.access' doesn't exist [warning]
query: SELECT 1 FROM access WHERE type = 'host' AND
LOWER('127.0.0.1') LIKE LOWER(mask) AND status = 0 LIMIT 0,
1 database.mysqli.inc:134
Table 'vagrantlocal.cache' doesn't exist [warning]
query: SELECT data, created, headers, expire, serialized FROM cache
WHERE cid = 'variables' database.mysqli.inc:134
@samrose
samrose / gist:6670773
Created September 23, 2013 13:59
Custom Olark Command and Population of field
olark('api.chat.onCommandFromOperator', function(event) {
if (event.command.name == 'resolution') {
olark('api.visitor.updateCustomFields', {customerResolution: event.command.body});
}
});