Skip to content

Instantly share code, notes, and snippets.

@rom3r4
rom3r4 / tomcat7
Created August 27, 2014 23:42
Integration of Tomcat7 + JDK7 + Solr4 + Carrot2 - .XML files.
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat7.
TOMCAT7_USER=tomcat7
# Run Tomcat as this group ID. Not setting this or leaving it blank will use
# the default of tomcat7.
TOMCAT7_GROUP=tomcat7
# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.5. If JAVA_HOME is not set, some common directories for
@rom3r4
rom3r4 / source-solr.xml
Last active August 29, 2015 14:05
Integration of Tomcat7 + JDK7 + Solr4 + Carrot2 - .XML files.
<component-suite>
<sources>
<source component-class="org.carrot2.source.solr.SolrDocumentSource" id="solr"
attribute-sets-resource="source-solr-attributes.xml">
<label>ODS Search</label>
<title>Open Discovery Space Search</title>
<icon-path>icons/solr.png</icon-path>
<mnemonic>s</mnemonic>
<description>Open Discovery Space Search Engine.</description>
<example-queries>
@rom3r4
rom3r4 / source-solr-attributes.xml
Last active August 29, 2015 14:05
Integration of Tomcat7 + JDK7 + Solr4 + Carrot2 - .XML files.
<attribute-sets default="overridden-attributes">
<attribute-set id="overridden-attributes">
<value-set>
<label>overridden-attributes</label>
<!--
Below are some attributes of this component you can change. Please see
http://download.carrot2.org/head/manual/#section.customizing.component-suites-and-attributes.component-attributes
@rom3r4
rom3r4 / suite-webapp.xml
Last active August 29, 2015 14:05
Integration of Tomcat7 + JDK7 + Solr4 + Carrot2 - .XML files.
<component-suite>
<!--
<sources>
-->
<!-- Webapp-specific document source (prefetching from Google) -->
<!--
<source component-class="org.carrot2.webapp.source.WebDocumentSource" id="web">
<label>Web</label>
<title>Search the Web with etools.ch</title>
<description>Searches the web using the etools.ch meta search
@rom3r4
rom3r4 / solr.xml
Created August 22, 2014 22:14
Integration of Tomcat7 + JDK7 + Solr4 + Carrot2 - .XML files.
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/var/lib/tomcat7/webapps/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/var/lib/tomcat7/solr" override="true"/>
</Context>
@rom3r4
rom3r4 / init.pp
Created August 20, 2014 07:07 — forked from lordofthejars/init.pp
# update the (outdated) package list
exec { "update-package-list":
command => "/usr/bin/sudo /usr/bin/apt-get update",
}
class java_6 {
package { "openjdk-6-jdk":
ensure => installed,
require => Exec["update-package-list"],
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@rom3r4
rom3r4 / drupal settings.php memcache
Created May 27, 2014 10:26
drupal settings.php memcache
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
@rom3r4
rom3r4 / gitlab webhook (autopull)
Created May 20, 2014 11:22
gitlab webhook (autopull)
<?php
$DIR="/var/www/vhost/____change_me______";
$GIT=$DIR."/.git";
$output = exec("/usr/bin/git --git-dir=". $GIT ." --work-tree=" .$DIR ." pull origin master");
#$output = shell_exec("id");
echo "<pre>". $output ."</pre>";
@rom3r4
rom3r4 / Drupal 7 Memcached, Memcache, settings.php, cheatsheet
Last active August 29, 2015 14:01
Drupal 7 Memcached, Memcache, settings.php, cheatsheet
sudo nano /etc/php5/conf.d/memcache.ini
extension=memcache.so
memcache.hash_strategy="consistent"
sudo nano /etc/memcached.conf
# Change this default value to ~ 1/4 of your total available RAM
-m 16
sudo /etc/init.d/memcached restart