Explore Your Environment

Get Latest Code


In [ ]:
%%bash

pull_force_overwrite_local

Helper Scripts

Find Script from Anywhere


In [ ]:
!which pull_force_overwrite_local

List /scripts Directory


In [ ]:
!ls -l /root/scripts/

Show pull_force_overwrite_local Script


In [ ]:
!cat /root/scripts/pull_force_overwrite_local

In [ ]:
%%html

<iframe width=800 height=600 src="http://pipeline.io"></iframe>

All Code in GitHub Repo

Please Star this GitHub Repo!!

Verify IP Address

This should match your browser!


In [ ]:
import requests

url = 'http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip'
headers = {'Metadata-Flavor': 'Google'}

r = requests.get(url, headers=headers)

ip_address = r.text
print('Your IP:  %s' % ip_address)

Get Allocation Index

We may use this later.


In [ ]:
import requests
import json

url = 'http://allocator.demo.pipeline.io/allocation/%s' % ip_address

r = requests.get(url, timeout=5)

allocation = r.text
allocation_json = json.loads(allocation)
print(allocation_json)
print(allocation_json['index'])

In [ ]: