This file contains 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
# stop script on error signal | |
set -e | |
# delete deployment folder if script exit before end last time | |
if [ -d "/home/forge/deployment" ]; then | |
rm -R /home/forge/deployment | |
fi | |
# set up your env variables if your app using them | |
export DB_HOST=localhost |
This file contains 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 | |
// Issue 1, empty associative arrays (dictionaries) become regular arrays. | |
$dictionary = array('key' => 'value'); | |
var_dump(json_encode($dictionary)); // gives '{"key":"value"}'; | |
unset($dictionary['key']); | |
var_dump(json_encode($dictionary)); // Gives '[]' -> json dictionary turned into array |
This file contains 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
// testend on iOS | |
/* | |
Copyright 2011 Pedro Enrique | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
This file contains 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
# Grab the protocol being used | |
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.+)$ - [env=ps:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.+)$ - [env=ps:http] | |
# Force WWW | |
RewriteCond %{HTTP_HOST} !^www\. |
This file contains 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
Name: logstash | |
Version: 1.1.0 | |
Release: 1%{?dist} | |
Summary: logstash is a tool for managing events and logs | |
Group: System/Logging | |
License: ASL 2.0 | |
URL: http://logstash.net/ | |
Source0: http://semicomplete.com/files/logstash/logstash-%{version}-monolithic.jar | |
Source1: logstash |
This file contains 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
package com.simonmacdonald.imei; | |
import org.json.JSONArray; | |
import android.content.Context; | |
import android.telephony.TelephonyManager; | |
import com.phonegap.api.Plugin; | |
import com.phonegap.api.PluginResult; |
This file contains 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
-- install packages | |
# yum update | |
# yum groupinstall "Development Tools" "Additional Development" | |
-- epel for redis, libyaml, pip, qtwebkit-devel | |
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
# yum install libicu-devel libyaml-devel redis wget python-pip qt-devel qtwebkit-devel | |
-- install ruby |
This file contains 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
# for real, I have a mapping and my color is not "indexed" | |
curl -XPUT 'http://localhost:9200/pony_index_tmp' -d ' | |
{ | |
settings: { | |
number_of_shards: 1, | |
number_of_replicas: 0 | |
} | |
}' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/pony/1" -d ' |
This file contains 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 | |
if (Config::has('sentry.key')) { | |
$bufferHandler = new Monolog\Handler\BufferHandler( | |
new Monolog\Handler\RavenHandler( | |
new Raven_Client(Config::get('sentry.key')), | |
Monolog\Logger::WARNING | |
) | |
); | |
This file contains 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
1. Drop all incoming connections to ElasticSearch on port 9200: | |
iptables -A INPUT -j DROP -p tcp --destination-port 9200 -i eth0 | |
2. Persist this change on reboot: | |
iptables-save > /root/my_iptables_config | |
/sbin/iptables-restore < /root/my_iptables_config | |
3. Create a directory in your web application, I usually name mine /_es and add an .htaccess file. |
OlderNewer