-
pt-query-advisor, pt-variable-advisor, and other tools available in Percona Toolkit - Debian, Ubuntu packages
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
| import javax.annotation.Nonnull; | |
| import android.app.Activity; | |
| import android.app.Service; | |
| import android.support.v4.app.Fragment; | |
| import android.content.Context; | |
| /** | |
| * <p>Retrieves the {@link dagger.ObjectGraph} and injects dependencies.</p> | |
| * @author Dandré Allison |
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
| #!/bin/sh | |
| cd /opt/zookeeper/zookeeper | |
| rm -rf cluster | |
| mkdir -p cluster/server{1,2,3}/{conf,data,logs} | |
| cp conf/log4j.properties cluster/server1/conf/ | |
| cp conf/log4j.properties cluster/server2/conf/ | |
| cp conf/log4j.properties cluster/server3/conf/ |
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
| import sys | |
| import subprocess | |
| import tempfile | |
| import urllib | |
| text = sys.stdin.read() | |
| chart_url_template = ('http://chart.apis.google.com/chart?' | |
| 'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
| chart_url = chart_url_template.format(data=urllib.quote(text)) |
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
| // http://www.cocos2d-x.org/boards/6/topics/23093 | |
| //Hi, I'm using this class for generating random numbers since our app has multiplayer support on all platforms and consistent pseudo random numbers are very important: | |
| //Based on Java's LinearRandom pseudo random number implementation | |
| class Random | |
| { | |
| public: | |
| Random(void); | |
| Random( long seed); | |
| static void setSeed(long _seed); |
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
| from concurrent.futures import ThreadPoolExecutor | |
| from functools import partial, wraps | |
| import time | |
| import tornado.ioloop | |
| import tornado.web | |
| EXECUTOR = ThreadPoolExecutor(max_workers=4) |
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
| curl -XPUT 'http://localhost:9200/_template/template_logstash/' -d ' | |
| { | |
| "template": "logstash-*", | |
| "settings": { | |
| "index.cache.field.type" : "soft", | |
| "index.refresh_interval" : "5s", | |
| "index.store.compress.stored" : true, | |
| "index.store.compress.tv" : true, | |
| "index.query.default_field" : "@message" | |
| }, |
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
| cluster.name: logs | |
| # Puppet-ism to put in the hostname and IP | |
| node.name: <%= @hostname %> | |
| network.host: <%= @ipaddress %> | |
| # Turn off multicast autodiscovery | |
| discovery.zen.ping.unicast.hosts: 172.1.1.100:9300, 172.1.1.101:9300 | |
| index.number_of_shards: 4 | |
| index.routing.allocation.total_shards_per_node: 1 |
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
| #!/bin/bash | |
| CURRENTINDEX="test" | |
| NEWINDEX="newindex" | |
| #where the indices are stored within the DATADIR | |
| INDICESDIR=/var/lib/elasticsearch/elasticsearch/nodes/0/indices/ | |
| #get the metadata for the current index | |
| curl localhost:9200/$CURRENTINDEX/_settings?pretty=true > /tmp/settings | |
| curl localhost:9200/$CURRENTINDEX/_mapping?pretty=true > /tmp/mappings |
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
| var myApp = angular.module('myApp').config(function($httpProvider) { | |
| $httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val(); | |
| }); |