Skip to content

Instantly share code, notes, and snippets.

View leocelis's full-sized avatar
💭
I may be slow to respond.

Leo Celis leocelis

💭
I may be slow to respond.
View GitHub Profile
Installation
$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get install tcl8.5
$ cd /opt
$ sudo wget http://download.redis.io/releases/redis-stable.tar.gz
$ sudo tar xzf redis-stable.tar.gz
$ cd redis-stable
$ make
$ make test
Blog post: https://josephscott.org/archives/2011/10/timing-details-with-curl/
Checkout repo: https://github.com/leocelis/python3buildingblocks
Then run:
$ curl -w "@curl-format.txt" -o /dev/null -s -X GET "http://www.google.com"
You will get an output like this:
time_namelookup: 0.031
@leocelis
leocelis / gist:638712f675b01e6e9d7b8e513610a27d
Created May 24, 2016 23:56
nosetests not running unit tests
# check visibility
$ nosetests -vv --collect-only
# remove executable permission from the file
$ chmod -R -x+X <filename>
# verify nosetests has visibility on the file
$ nosetests -vv --collect-only
List active processes:
$ docker ps
Grab the CONTAINER ID and use it in the next command
$ docker exec -it <CONTAINER ID> bash
git clone https://github.com/awslabs/aws-python-sample.git
pip3 install boto3
vim ~/.aws/credentials
--
Add the following:
[default]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
--
cd aws-python-sample
aws kinesis create-stream --stream-name Foo --shard-count 1
aws kinesis describe-stream --stream-name Foo
aws kinesis list-streams
aws kinesis put-record --stream-name Foo --partition-key 123 --data testdata
SHARD_ITERATOR=$(aws kinesis get-shard-iterator --shard-id shardId-000000000000 --shard-iterator-type TRIM_HORIZON --stream-name Foo --query 'ShardIterator')
aws kinesis get-records --shard-iterator $SHARD_ITERATOR
Copy the value from Records > Data
Decode it here: https://www.base64decode.org
aws kinesis delete-stream --stream-name Foo
aws kinesis describe-stream --stream-name Foo
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
sudo pip install awscli
aws configure