This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -uroot -pmysqlpass -e 'show databases' | while read dbname; do mysqldump -uroot -pmysqlpass "$dbname" > "$dbname".sql; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"filtered":{ | |
"filter":{ | |
"bool":{ | |
"must":[ | |
{ | |
"bool":{ | |
"should":[ | |
{ | |
"bool":{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | ssh deployer@host "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################# | |
#### MODULES #### | |
################# | |
$ModLoad imuxsock # provides support for local system logging | |
$ModLoad imfile | |
########################### | |
#### GLOBAL DIRECTIVES #### | |
########################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Core\Db; | |
/** | |
* Helps to iterate over huge data collection. | |
* It loads records by small chunks | |
* | |
* Example: | |
* <pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-display-header-line nil) ;; t by default | |
(set-face-attribute 'helm-source-header nil :height 0.1) | |
(helm-autoresize-mode 1) | |
(setq helm-autoresize-max-height 30) | |
(setq helm-autoresize-min-height 30) | |
(setq helm-split-window-in-side-p t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
##If you want to install OpenJDK | |
#sudo apt-get update | |
#sudo apt-get install openjdk-8-jre-headless -y | |
###Or if you want to install Oracle JDK, which seems to have slightly better performance | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer |
OlderNewer