Skip to content

Instantly share code, notes, and snippets.

View andrewgross's full-sized avatar

Andrew Gross andrewgross

View GitHub Profile
Multiple vulnerabilities have been discovered in the PHP language:
CVE-2015-4598
thoger at redhat dot com discovered that paths containing a NUL
character were improperly handled, thus allowing an attacker to
manipulate unexpected files on the server.
CVE-2015-4643
headers = {
"Accept": "application/vnd.travis-ci.2+json"
"Authorization": "token {}".format(travis_token)
}
hook_data = {
"hook": {
"id": hook_id,
"active": True,
}
@andrewgross
andrewgross / Makefile
Created August 13, 2015 15:22
Git Tagging in Makefile
tag:
@if [ $$(git rev-list $$(git describe --abbrev=0 --tags)..HEAD --count) -gt 0 ]; then \
if [ $$(git log -n 1 --oneline $$(git describe --abbrev=0 --tags)..HEAD CHANGELOG.md | wc -l) -gt 0 ]; then \
git tag $$(python setup.py --version) && git push --tags || echo 'Version already released, update your version!'
else \
echo "CHANGELOG not updated since last release!"; \
exit 1; \
fi; \
else \
echo "No commits since last release!"; \
0.06s$ Installing caching utilities
0.81sattempting to download cache archive
fetching master/cache--python-2.7.tgz
found cache
0.26s/home/travis/.casher/bin/casher:65:in `add': undefined local variable or method `url' for #<Casher:0x000000023cd3e8> (NameError)
from /home/travis/.casher/bin/casher:35:in `block in run'
from /home/travis/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
from /home/travis/.casher/bin/casher:35:in `run'
from /home/travis/.casher/bin/casher:120:in `<main>'
The command "rvm 1.9.3 --fuzzy do $CASHER_DIR/bin/casher add $HOME/.cache/pip" failed and exited with 1 during .
{
"DescribeSecurityGroupsResponse": {
"-xmlns": "http://ec2.amazonaws.com/doc/2014-09-01/",
"requestId": "59dbff89-35bd-4eac-99ed-be587EXAMPLE",
"securityGroupInfo": {
"item": [
{
"ownerId": "111122223333",
"groupId": "sg-1a2b3c4d",
"groupName": "WebServers",
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2014-09-01/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<securityGroupInfo>
<item>
<ownerId>111122223333</ownerId>
<groupId>sg-1a2b3c4d</groupId>
<groupName>WebServers</groupName>
<groupDescription>Web Servers</groupDescription>
<vpcId/>
<ipPermissions>
@andrewgross
andrewgross / event_watch.py
Last active August 29, 2015 14:07
event_watch.py
import boto.ec2
ec2_conn = boto.ec2.connect_to_region('us-east-1')
def check_events():
statuses = ec2_conn.get_all_instance_status(filters={"event.description": "Scheduled reboot"})
for status in statuses:
if status.events:
for event in status.events:
print "{}: {}".format(status.id, event.description)

I was curious if there were any plans to update or modify the JSON query API in ES 2.0+?

While I find the API to very powerful, it is confusing to construct a valid request and requires special casing a lot of rules. I have some thoughts below on what I see as the current issues, and some suggestions to correct them. I don't intend for this to be a rant, just to provoke discussion. This is done purely from the point of view of constructing queries (not parsing them), and only for the JSON DSL query syntax for searching (not percolate or aggregators).

It is currently hard to construct small parts of a JSON query without knowing all of the elements involved. Looking at a simple query and a filtered query:

Simple Query:

deploy_cookbook ()
{
EXPECTED_ARGS=2;
BAD_ARGS_ERROR_CODE=65;
if [ $# -ne $EXPECTED_ARGS ]; then
echo 'Usage: deploy_cookbook ${ENV} ${COOKBOOK}';
return $BAD_ARGS_ERROR_CODE;
fi;
environment=$1;
cookbook=$2;