Skip to content

Instantly share code, notes, and snippets.

@sithu
sithu / Ubuntu1604py36Dockerfile
Created September 29, 2017 05:51 — forked from monkut/Ubuntu1604py36Dockerfile
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y software-properties-common vim
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git

https://www.linuxbabe.com/ubuntu/install-linux-kernel-4-10-ubuntu-16-04-ukuu

http://old-releases.ubuntu.com/releases/16.04.2/ https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions http://www.omgubuntu.co.uk/2016/10/download-ubuntu-16-10-new-features

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/linux-headers-4.8.0-040800-generic_4.8.0-040800.201610022031_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/linux-headers-4.8.0-040800_4.8.0-040800.201610022031_all.deb
@sithu
sithu / q2.py
Created August 31, 2017 03:35
Quizz 2 Baseline
import requests
def http_call_sync():
r = requests.get('https://httpbin.org/status/200')
print(r.status_code)
r = requests.get('https://httpbin.org/status/204')
print(r.status_code)
def http_call_async():
@sithu
sithu / latency.py
Last active February 4, 2018 05:15
In-class Exercise 1
"""
Question:
Pick one IP from each region, find network latency from via the below code snippet
(ping 3 times), and finally sort the average latency by region.
http://ec2-reachability.amazonaws.com/
Expected Output for all 15 regions:
1. us-west-1 [50.18.56.1] - 100ms (Smallest average latency)
2. xx-xxxx-x [xx.xx.xx.xx] - 200ms
3. xx-xxxx-x [xx.xx.xx.xx] - 300ms
0x0006eC2E5Ca955d38cA133FBf440DDFab050804e
chain: ropsten
# Use automated Chrome to verify all contracts on etherscan.io
# You need to install Splinter package:
# pip install splinter
verify_on_etherscan: no
browser_driver: chrome
contracts:
chain: ropsten
# Use automated Chrome to verify all contracts on etherscan.io
# You need to install Splinter package:
# pip install splinter
verify_on_etherscan: no
browser_driver: chrome
contracts:
0x0c8cf01ae70831ac018160ffeedf2033b3364d7d
@sithu
sithu / gist:f9b3c67871ee2d3ec13c382fd1d93511
Created August 1, 2017 06:06 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

HelloWorld.deployed().then(helloworld=> console.log(helloworld.balance.call()))
// OR
HelloWorld.deployed().then(function(instance){helloworld=instance})
// THEN
helloworld.balance.call()