Skip to content

Instantly share code, notes, and snippets.

View vagelim's full-sized avatar

vagelim vagelim

View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@vagelim
vagelim / latest-ecs-ami.tf
Created August 5, 2019 22:49
latest ecs ami
data "aws_ami" "latest" {
most_recent = true
owners = ["591542846629"]
filter {
name = "name"
values = ["*amazon-ecs-optimized"]
}
filter {
@vagelim
vagelim / gist:cdd54498537c60da31d1c0fa419963a3
Created June 18, 2019 20:33 — forked from tlrobinson/gist:1073865
Autocomplete Makefile targets. Add this to your shell config file.
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make
@vagelim
vagelim / event_env.sh
Last active January 30, 2019 10:14
Sets up a virtual environment, installs kombu, and runs the event listener
#!/bin/bash
# Requires pip
pip install virtualenv
virtualenv listener
listener/bin/pip install kombu
listener/bin/python openstackEvents.py
@vagelim
vagelim / postgres_queries_and_commands.sql
Created July 3, 2018 18:48 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@vagelim
vagelim / kafka.tf
Created June 23, 2016 15:25
Terraform for Kafka on DigitalOcean
resource "digitalocean_droplet" "kafka" {
image = "ubuntu-14-04-x64"
name = "${var.machine_name}"
region = "nyc2"
size = "4gb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
@vagelim
vagelim / rdwr.py
Created October 31, 2016 14:39 — forked from pakt/rdwr.py
Direct read/write access to Python's memory
#
# read/write access to python's memory, using a custom bytearray.
# some code taken from: http://tinyurl.com/q7duzxj
#
# tested on:
# Python 2.7.10, ubuntu 32bit
# Python 2.7.8, win32
#
# example of correct output:
# inspecting int=0x41424344, at 0x0228f898
@vagelim
vagelim / gist:d1209f5075e20e46b68b7193544f29fc
Created May 22, 2017 22:24
Get a mapping of containers to host for service discovery via DNS
docker network inspect bridge | jq '.[].Containers[] | "\(.Name)", "\(.IPv4Address)"' | sed -e '$!N;s/\n/ /' -e 's/"//g' -e 's,/16,,g'
@vagelim
vagelim / agent_version.sh-session
Last active May 22, 2017 13:57 — forked from miketheman/agent_version.sh-session
Retrieve metadata about systems from Datadog
# Ensure you have `jq` installed - http://stedolan.github.io/jq/
$ brew install jq
...
/usr/local/Cellar/jq/1.4: 15 files, 748K, built in 9 seconds
# Grab your API_KEY and create an APPLICATION_KEY from https://app.datadoghq.com/account/settings#api
$ export API_KEY=aaabbbccc
$ export APPLICATION_KEY=111222333
$ curl -s "https://app.datadoghq.com/reports/v2/overview?with_meta=true&api_key=$DD_API&application_key=$DD_APP" \
@vagelim
vagelim / fuckumbreon.c
Created October 31, 2016 14:51
GID inconsistency bruteforcer This can be used to detect LD_PRELOAD rootkit that hide fds, procs and files based on GID Since GID is an unsigned int, it is finite and thus bruteforceable, however it might take a while. This took less than 20mins on my system, this may vary based on your setup. NOTE: the rkit could detect it is under GID brutefor…
/*
GID inconsistency bruteforcer
This can be used to detect LD_PRELOAD rootkit that hide fds, procs and files based on GID
Since GID is an unsigned int, it is finite and thus bruteforceable, however it might take a while.
This took less than 20mins on my system, this may vary based on your setup.
NOTE: the rkit could detect it is under GID bruteforce attack and switch GIDs, however this is not easy to perform.
This will detect Umbreon and other GID based rkits