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
vageli@kafka:~ | |
=> sudo dd-agent jmx list_everything | |
2016-03-04 13:35:40,325 | WARNING | dd.collector | jmxfetch(jmxfetch.py:379) | {'host': 'localhost', 'port': 9999} doesn't have a 'conf' section. Only basic JVM metrics will be collected. See http://docs.datadoghq.com/integrations/java/ for more information | |
2016-03-04 13:35:40,326 | INFO | dd.collector | jmxfetch(jmxfetch.py:234) | Starting jmxfetch: | |
2016-03-04 13:35:40,327 | INFO | dd.collector | jmxfetch(jmxfetch.py:282) | Running java -Xms50m -Xmx200m -classpath /opt/datadog-agent/agent/checks/libs/jmxfetch-0.9.0-jar-with-dependencies.jar org.datadog.jmxfetch.App --check jmx.yaml kafka.yaml --check_period 15000 --conf_directory /etc/dd-agent/conf.d --log_level INFO --log_location /var/log/datadog/jmxfetch.log --reporter console --status_location /opt/datadog-agent/run/jmx_status.yaml list_everything | |
##################################### | |
Instance: localhost:9999 | |
##################################### |
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
[general] | |
logdir=/home/kafka/burrow/log | |
[zookeeper] | |
hostname=localhost | |
[kafka "local"] | |
broker=localhost | |
zookeeper=localhost | |
zookeeper-path=/kafka-cluster |
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
def locations_of_substring(string, substring): | |
"""Return a list of locations of a substring.""" | |
substring_length = len(substring) | |
def recurse(locations_found, start): | |
location = string.find(substring, start) | |
if location != -1: | |
return recurse(locations_found + [location], location+substring_length) | |
else: | |
return locations_found |
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 luigi | |
from luigi import configuration | |
import datetime | |
from luigi.contrib import redshift | |
from mortar.luigi import mortartask | |
from dd_tasks import DatadogPigscriptTask | |
from luigi.s3 import S3Target, S3PathTask | |
from mortar.luigi.s3transfer import S3ToLocalTask | |
import dd_utils | |
#from redshift_utils import CopyToRedshiftTask |
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
#!/usr/bin/env bash | |
# **create-stack-user.sh** | |
# Create a user account suitable for running DevStack | |
# - create a group named $STACK_USER if it does not exist | |
# - create a user named $STACK_USER if it does not exist | |
# | |
# - home is $DEST | |
# |
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 | |
# Requires pip | |
pip install virtualenv | |
virtualenv listener | |
listener/bin/pip install kombu | |
listener/bin/python openstackEvents.py |
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 | |
# Usage: lc [number_of_cpus_to_load [number_of_seconds] ] | |
lc() { | |
( | |
pids="" | |
cpus=${1:-1} | |
seconds=${2:-60} | |
echo loading $cpus CPUs for $seconds seconds | |
trap 'for p in $pids; do kill $p; done' 0 | |
for ((i=0;i<cpus;i++)); do while : ; do : ; done & pids="$pids $!"; 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
######################################## | |
# Required changes to nova.conf # | |
######################################## | |
# notification_driver=nova.openstack.common.notifier.rpc_notifier | |
# notification_topics = notifications | |
# notify_on_state_change = vm_and_task_state | |
# instance_usage_audit_period = hour | |
# instance_usage_audit = True | |
# default_notification_level = INFO | |
# notify_api_faults = true |
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
def find_nth(haystack, needle, n): | |
"""Take a string (haystack) and find start the nth occurrence of the substring (needle)""" | |
start = haystack.find(needle) | |
while start >= 0 and n > 1: | |
start = haystack.find(needle, start+len(needle)) | |
n -= 1 | |
return start |
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
#Configuration variables | |
BASE_URL = "http://www.amazon.com/gp/offer-listing/" | |
XPATH_SELECTOR = '//body//*[@class="a-size-large a-color-price olpOfferPrice a-text-bold"]' | |
USER_AGENT = {'User-agent': 'Mozilla/5.0'} | |
ITEM = '1429218274' |