Skip to content

Instantly share code, notes, and snippets.

@obazoud
obazoud / attack-dyn-free.md
Created Oct 21, 2016 — forked from bortzmeyer/attack-dyn-free.md
Attack against Dyn from Free (France)
View attack-dyn-free.md
% check-soa -i twitter.com
ns1.p34.dynect.net.
	208.78.70.34: OK: 2007130853 (22 ms)
	2001:500:90:1::34: ERROR: read udp [2001:500:90:1::34]:53: i/o timeout
ns2.p34.dynect.net.
	204.13.250.34: ERROR: read udp 204.13.250.34:53: i/o timeout
ns3.p34.dynect.net.
	208.78.71.34: OK: 2007130853 (28 ms)
	2001:500:94:1::34: ERROR: read udp [2001:500:94:1::34]:53: i/o timeout
@obazoud
obazoud / aws-s3-get-bucket-lifecycles.sh
Created May 17, 2016 — forked from Dunedan/aws-s3-get-bucket-lifecycles.sh
Small bash script to get the lifecycle transitions of all buckets in an AWS account.
View aws-s3-get-bucket-lifecycles.sh
#!/bin/bash
AWS_PROFILE="default"
BUCKETS=$(aws --profile $AWS_PROFILE s3api list-buckets --query 'Buckets[*].Name' --output text)
echo -e "bucket name\tstatus of the transition\tprefix the transition applies to\tdays after which the transition applies\tto storage class\tdelete after days\tdescription"
for bucket in $BUCKETS; do
TRANSITION=$(aws --profile $AWS_PROFILE s3api get-bucket-lifecycle --bucket $bucket --query 'Rules[*][Status, Prefix, Transition.Days, Transition.StorageClass, Expiration.Days ID]' --output text 2> /dev/null)
if [ "$?" = "255" ]; then
@obazoud
obazoud / create_table.sql
Created Apr 8, 2016 — forked from marcocitus/create_table.sql
Scripts for loading Github events into Citus
View create_table.sql
CREATE TABLE github_events
(
event_id bigint,
event_type text,
event_public boolean,
repo_id bigint,
payload jsonb,
repo jsonb,
actor jsonb,
org jsonb,
@obazoud
obazoud / function.js
Last active Aug 29, 2015 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
View function.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
View .travis.yml
---
language: node_js
node_js:
- '0.10'
branches:
only:
- master
before_script: .travis/before_script.sh
script: echo -e " >>> Do something... \"grunt\" for example\n"
after_success: .travis/after_success.sh
@obazoud
obazoud / gist:9aa1d005ce619ccea5e8
Created Mar 18, 2015
Chef: Migrate role name with Knife
View gist:9aa1d005ce619ccea5e8
knife exec -E 'nodes.find("role:qwerty") { |node| new_run_list = node.run_list.map { |element| (element == "role[qwerty]") ? "role[azerty]" : element }; node.run_list.reset!(new_run_list); node.save; }'
View gemrc.erb
:sources:
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/
View AliceInAggregatorLand.scala
/**
* To get started:
* git clone https://github.com/twitter/algebird
* cd algebird
* ./sbt algebird-core/console
*/
/**
* Let's get some data. Here is Alice in Wonderland, line by line
*/
View bootstrap.py
#!/usr/bin/env python
"""
This module will bootstrap a machine using chef. The purpose of this
script is actually to work with AWS Auto Scaling Groups. The user data
for the Launch Configuration is set to download this script and then
run it. This is also stores the results in a private gist and sends
a message to logstash with the results.
"""
@obazoud
obazoud / report.sql
Last active Aug 29, 2015
When a cookbook has been uploaded to chef server ?
View report.sql
-- su - opscode-pgsql
-- psql -d opscode_chef
-- https://github.com/opscode/chef-server-schema/tree/master/deploy
SELECT c.name,
v.major || '.' || v.minor || '.' || v.patch AS version,
v.updated_at,
v.created_at
FROM cookbooks AS c
JOIN cookbook_versions AS v
ON c.id = v.cookbook_id