Skip to content

Instantly share code, notes, and snippets.

@ilyash
ilyash / copy_sys_pkg_to_virtualenv.sh
Last active January 1, 2016 03:59
Python - copy system package to virtualenv (example)
tar -h -C /usr/lib/python2.7/dist-packages -czf netaddr.tgz netaddr netaddr-0.7.10.egg-info
tar -C $VIRTUAL_ENV/lib/python2.7/site-packages/ -xzf netaddr.tgz
alias REGIONS_NAMES='aws ec2 describe-regions | jq ".Regions[].RegionName" -r'
alias TERMINATE='aws ec2 terminate-instances --instance-ids'
alias STOP='aws ec2 stop-instances --instance-ids'
alias START='aws ec2 start-instances --instance-ids'
alias MON_ENA='aws ec2 monitor-instances --instance-ids'
alias MON_DIS='aws ec2 unmonitor-instances --instance-ids'
RESIZE() {
aws ec2 modify-instance-attribute --instance-id "$1" --instance-type "{\"Value\": \"$2\"}"
}
DESC() {
@ilyash
ilyash / pipeline.censored.json
Created June 7, 2021 19:42
aws codepipeline get-pipeline --name XXX
{
"pipeline": {
"name": "sher2-pipeline",
"roleArn": "arn:aws:iam::00000000:role/sher2-us-west-2-pipeline",
"artifactStore": {
"type": "S3",
"location": "sher2-00000000-us-west-2-pipeline"
},
"stages": [
{
@ilyash
ilyash / aws-paginators.json
Created August 27, 2021 19:33
AWS pagination - naming of fields used for pagination
{
"shapes": {
"input_token=NextToken;limit_key=MaxResults;output_token=NextToken": 725,
"input_token=nextToken;limit_key=maxResults;output_token=nextToken": 305,
"input_token=Marker;limit_key=MaxRecords;output_token=Marker": 141,
"input_token=NextToken;limit_key=Limit;output_token=NextToken": 72,
"input_token=NextToken;output_token=NextToken": 68,
"input_token=nextToken;output_token=nextToken": 41,
"input_token=Marker;limit_key=MaxItems;more_results=IsTruncated;output_token=Marker": 27,
"input_token=nextToken;limit_key=limit;output_token=nextToken": 22,
@ilyash
ilyash / ec2-instance-types-table.py
Last active February 20, 2023 11:54
Quick hack to create CSV containing AWS EC2 instance types with their properties. This format is more convenient (at least for me) than the types page.
#!/usr/bin/python
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of