Skip to content

Instantly share code, notes, and snippets.

View sriram-mv's full-sized avatar
:shipit:

Sriram Madapusi Vasudevan sriram-mv

:shipit:
  • Seattle, WA
View GitHub Profile
@sriram-mv
sriram-mv / terraform.tfstate
Created June 17, 2025 05:23
Terraform state file
{
"terraform_version": "1.5.0",
"serial": 1,
"lineage": "3c77e9e7-0d23-9db4-4b42-4e12d0d531b4",
"version": 4
}
@sriram-mv
sriram-mv / gist:97d87eda11a18fd890a9ea03db78c1aa
Created January 28, 2020 21:17
Sam build - validation failure message
Building resource 'HelloWorldFunction'
Build Failed
Error: PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations : ['/Users/srirammv/workspace/python_versions/play/bin/python', '/usr/bin/python'] which did not satisfy constraints for runtime: python3.8. Do you have python for runtime: python3.8 on your PATH?
~/aws_sam_/aws-sam-cli package_off_awscli *18 ❯ SAM_CLI_DEV=1 pytest -vv tests/regression ⇶ Py package_venv Py 3.7.0 Ruby 2.5.0
=================================================================== test session starts ===================================================================
platform darwin -- Python 3.7.4, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- /Users/srirammv/aws_sam_cli_WS/package_venv/bin/python3.7
cachedir: .pytest_cache
rootdir: /Users/srirammv/aws_sam_cli_WS/aws-sam-cli, inifile: pytest.ini
plugins: cov-2.7.1, forked-1.1.3, rerunfailures-7.0, timeout-1.3.3, xdist-1.30.0
collected 42 items
tests/regression/package/test_package_regression.py::TestPackageRegression::test_package_with_output_template_file_00_aws_serverless_function_yaml PASSED [ 2%]
tests/regression/package/test_package_regression.py::TestPackageRegression::test_package_with_output_template_file_01_aws_serverless_api_yaml PASSED [ 4%]
=================================================================== test session starts ===================================================================
platform darwin -- Python 3.7.4, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- /Users/srirammv/aws_sam_cli_WS/package_venv/bin/python3.7
cachedir: .pytest_cache
rootdir: /Users/srirammv/aws_sam_cli_WS/aws-sam-cli, inifile: pytest.ini
plugins: cov-2.7.1, forked-1.1.3, rerunfailures-7.0, timeout-1.3.3, xdist-1.30.0
collected 79 items
test_package_command.py::TestPackage::test_package_barebones_00_aws_serverless_function_yaml PASSED [ 1%]
test_package_command.py::TestPackage::test_package_barebones_01_aws_serverless_api_yaml PASSED [ 2%]
test_package_command.py::TestPackage::test_package_barebones_02_appsync_graphqlschema_yaml PASSED [ 3%]
@sriram-mv
sriram-mv / gist:8e4be6fc5bd040af82b97d69e0124cc6
Created October 9, 2019 23:08
Example of moving exception handling into decorators
In [3]: def validate(func):
...: def wrapper(*args, **kwargs):
...: if kwargs['a'] < 0 and kwargs['b'] < 0:
...: raise ValueError("No Negatives!")
...: else:
...: func(*args,**kwargs)
...: return wrapper
...:
@sriram-mv
sriram-mv / gist:bbde18ae65b45b8d487748fa8adfe51c
Created June 1, 2018 01:01
Retry with futures examples
https://gist.github.com/kunalgrover05/b960643679a4417eac0db240d8b6f352
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.function.Supplier;
/**
@sriram-mv
sriram-mv / bst.py
Last active November 13, 2015 02:57
BST
from collections import deque
class BinarySearchTree(object):
def __init__(self, data, parent=None):
self.data = data
self.left = None
self.right = None
self.parent = parent
@sriram-mv
sriram-mv / callback_chain.py
Created January 29, 2015 14:53
Deuce cassandra block status reset
def reset_block_status(self, projectid, vault_id, marker=None, limit=None):
# NOTE(TheSriram): the projectid needs to be explicitly passed in,
# as when the callback is called, on future completion, there is
# a switching of threads. Therefore, access to deuce.context.projectid
# is lost, as it is present in thread local storage.
def mark_block_as_good(results, projectid, limit):
def on_result(results, vaultid, projectid, blockid):
@sriram-mv
sriram-mv / mutipleblockmsgpack.py
Last active August 29, 2015 14:08
multiple block upload deuce
def helper_create_blocks(num_blocks, async=False,
singleblocksize=False, blocksize=100):
import hashlib
import msgpack
import os
import requests
from random import randrange
min_size = 1
max_size = 2000
if singleblocksize:
@sriram-mv
sriram-mv / create_deuce_branch.sh
Created October 10, 2014 14:35
Simple utility to help me checkout new branches which are upto date with master, along with some debugging tools.
cd deuce_dev
mkdir $1
cd $1
mkdir $1"_py3env"
virtualenv -p /usr/local/bin/python3.4 $1"_py3env"
source $1"_py3env"/bin/activate
git clone https://github.com/TheSriram/deuce
cd deuce
pip install ipython
git remote add upstream https://github.com/rackerlabs/deuce