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
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
#!/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
%% 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
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
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
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
# List the existing targets in the installed engine build | |
./Engine/Build/BatchFiles/RunUAT.command BuildGraph -Script=Engine/Build/InstalledEngineBuild.xml -ListOnly | |
# Build Editor | |
./Engine/Build/BatchFiles/RunUAT.command BuildGraph -Script=Engine/Build/InstalledEngineBuild.xml -Target="Editor Mac" | |
# Build the editor but remove the Android and other options | |
./Engine/Build/BatchFiles/RunUAT.command BuildGraph \ | |
-Script=Engine/Build/InstalledEngineBuild.xml \ | |
-Target="Make Installed Build Mac" \ | |
-set:WithMac=true \ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This console application description | |
EXAMPLE: | |
python3 {} | |
""".format(__file__) |