Skip to content

Instantly share code, notes, and snippets.

@firstrow
firstrow / es.sh
Last active August 29, 2015 14:06 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
#################
#### MODULES ####
#################
$ModLoad imuxsock # provides support for local system logging
$ModLoad imfile
###########################
#### GLOBAL DIRECTIVES ####
###########################
@firstrow
firstrow / ssh-copy-id.sh
Created August 29, 2014 13:20
ssh-copy-id analog
cat ~/.ssh/id_rsa.pub | ssh deployer@host "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
{
"filtered":{
"filter":{
"bool":{
"must":[
{
"bool":{
"should":[
{
"bool":{
@firstrow
firstrow / dump_all.sh
Created March 31, 2014 06:58
Dumps all databases to separate file
mysql -uroot -pmysqlpass -e 'show databases' | while read dbname; do mysqldump -uroot -pmysqlpass "$dbname" > "$dbname".sql; done
<?php
/**
* @version 1.0
* @author Rasmus Schultz <http://blog.mindplay.dk/>
* @license LGPL3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
*/
/**
* Helper-class to build SQL queries that calculate the geographical distance
@firstrow
firstrow / 0. nginx_setup.sh
Created September 9, 2012 14:25 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn
# Nginx+Unicorn best-practices congifuration guide.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#