Skip to content

Instantly share code, notes, and snippets.

<?php
abstract class BaseModelManager {
protected $em;
protected $class;
protected $repository;
protected $container;
/**
* Constructor.
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
@jigante
jigante / elasticsearch_install_ubuntu1204.sh
Last active August 29, 2015 13:57
Elasticsearch installation in Ubuntu 12.04
### Install java 7
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
### NOT starting elasticsearch by default on bootup, please execute
<?php
// ...
class FeatureContext extends MinkContext
{
/**
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
*
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#
#!/bin/bash
################################################################
##### script to backup lucene index from elastic search ####
################################################################
# Shamelessly copied from https://gist.github.com/nherment/1939828
NOW=`date +%Y%m%d%H%M%S`
@jigante
jigante / gist:f892d6143c49e1cda18a
Created July 19, 2014 07:05 — forked from therobot/gist:102770
Capistrano Rollback database migrations
before "deploy:rollback:revision", "deploy:rollback_database"
desc "Rolls back database to migration level of the previously deployed release"
task :rollback_database, :roles => :db, :only => { :primary => true } do
if releases.length < 2
abort "could not rollback the code because there is no prior release"
else
rake = fetch(:rake, "rake")
rails_env = fetch(:rails_env, "production")
migrate_env = fetch(:migrate_env, "")
@jigante
jigante / nginx.conf
Last active August 29, 2015 14:06 — forked from denys281/nginx.conf
server {
# Listen on port 81
listen 81;
# Server name being used (exact name, wildcards or regular expression)
# server_name phpmyadmin.my;
root /usr/share/phpmyadmin;
---
- hosts: all
user: root
sudo: true
tasks:
- name: update apt
command: apt-get update
- name: update bash
## ===================================================
## Hetzner Online AG - installimage - standardconfig.
## ===================================================
## ====================
## HARD DISK DRIVE(S):
## ====================