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 time | |
import urllib.parse | |
import urllib.request | |
import json | |
import os | |
import csv, sys | |
from urllib.error import HTTPError | |
def http_get(path): |
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
netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c |
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
from urllib import request, parse | |
# some json data | |
data = parse.urlencode({'secret':'a', 'response':'b'}).encode() | |
req = request.Request("https://www.google.com/", data=data) # this will make the method "POST" | |
resp = request.urlopen(req) | |
print(resp.read()) |
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
%% Check the default lookup resolution option | |
inet_db:res_option(lookup). | |
%% Set the lookup resolution option giving priority to the ERVM dns client | |
inet_db:set_lookup([dns, native]). | |
%% Setup DBG (DO NOT USE IT IN PRODUCTION) good to run in the local erl console | |
dbg:stop_clear(). % Stop in any case | |
dbg:start(). % start application | |
dbg:tracer(). % create tracer | |
dbg:p(all, c). % allow for all process |
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 | |
pip install amazon-dax-client |
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
AMI_FILTER=amzn-ami-hvm-2018.03*-x86_64-ebs | |
for REGION in us-east-1 us-west-2 us-west-1 eu-west-1 eu-central-1 ap-northeast-1 ap-southeast-1 ap-southeast-2 us-east-2 | |
do | |
aws --region $REGION ec2 describe-images --owners amazon \ | |
--filters "Name=name,Values=$AMI_FILTER" \ | |
--query 'sort_by(Images, &CreationDate)[] ' | jq -c 'max_by(.CreationDate) | {region: "'$REGION'", name: .Name, image: .ImageId, date: .CreationDate} ' | |
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
/* | |
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"). You may not | |
* use this file except in compliance with the License. A copy of the License | |
* is located at | |
* | |
* http://aws.amazon.com/apache2.0/ | |
* | |
* or in the "license" file accompanying this file. This file is distributed on |
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
-module(inet_utils). | |
-export([inet_aton/1, inet_ntoa/1]). | |
-export([ip_between/3]). | |
%% @doc Converts a binary string with a human readable ip | |
%% address representation into an uint32. | |
-spec inet_aton(binary()) -> pos_integer(). | |
inet_aton(Ip) -> | |
[O1Bin, O2Bin, O3Bin, O4Bin] = binary:split(Ip, <<".">>, [global]), |
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
# | |
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# This file is licensed under the Apache License, Version 2.0 (the "License"). | |
# You may not use this file except in compliance with the License. A copy of | |
# the License is located at | |
# | |
# http://aws.amazon.com/apache2.0/ | |
# |
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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/go-sql-driver/mysql" | |
poolboy "github.com/posilva/go-poolboy" | |
"strconv" | |
) |