This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get remove apache2 -y | |
apt-get autoremove -y | |
curl https://repogen.simplylinux.ch/txt/sources_c74a15400e68208192ca8980c7a90e7b678f2822.txt | sudo tee /etc/apt/sources.list | |
sudo apt-get update --fix-missing | |
sudo apt-get install git software-properties-common gcc | |
sudo add-apt-repository ppa:evarlast/golang1.4 -y | |
sudo apt-get update | |
sudo apt-get install golang -y | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rule: | |
--- | |
description: 'Ask the StackStorm team every week when the next version is coming out' | |
tags: [] | |
type: | |
ref: standard | |
parameters: | |
enabled: true | |
name: weekly_irritation | |
trigger: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Today I used as the blog post as a starting point https://libcloud.apache.org/blog/2016/02/05/libcloud-containers-example.html. I came across a couple of issues with the example code that meant it didn't work. I have made some small changes to your example to get it to work. I also found that the install_image(path) method sometimes gets a JSON parsing error due to the docker API streaming multiple new line limited json messages. By adding the check if the image has been downloaded allows it to be rerun again and the deployment will work. With the docker image tomcat:8.0 you need to provide a command parameter in deploy_container call otherwise the container starts and immediately stops. Will continue to evaluate as it looks like it will be very useful. | |
Code for my working example below: | |
from libcloud.container.providers | |
import get_driver from libcloud.container.types | |
import Provider | |
driver = get_driver(Provider.DOCKER) | |
docker_driver = driver(host='https://198.61.239.128', port=4243, key_file='key.pem' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: '2.0' | |
argo.deploy_global: | |
type: direct | |
input: | |
- region | |
- location | |
- name | |
- image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir | |
from os.path import isfile, join | |
import re | |
import matplotlib.pyplot as plt | |
import numpy as np | |
path = 'transcripts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use libcloud 1.0.0-rc2 | |
from libcloud.compute.types import Provider | |
from libcloud.compute.providers import get_driver | |
from libcloud.common.dimensiondata import API_ENDPOINTS | |
# instantiate driver connection - 1 instance per region | |
cls = get_driver(Provider.DIMENSIONDATA) | |
# list regions | |
for (region, value) in API_ENDPOINTS.items(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sciencelogic.client import Client | |
from pprint import pprint | |
c = Client('jazz', 'hands!', 'https://au-monitoring.mcp-services.net/') | |
# API details | |
print(c.sysinfo) | |
# Get the first device | |
devices = c.devices(details=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = ''' | |
import random | |
random.seed('slartibartfast') | |
s = [random.random() for i in range(1000)] | |
timsort = list.sort | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from nltk.sentiment.vader import SentimentIntensityAnalyzer | |
from matplotlib import pyplot as plt | |
import matplotlib.dates as mdates | |
import numpy | |
import pylab | |
with open('tweets.csv') as tweets: | |
df = pd.read_csv(tweets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from nltk.sentiment.vader import SentimentIntensityAnalyzer | |
from matplotlib import pyplot as plt | |
with open('tweets.csv') as tweets: | |
df = pd.read_csv(tweets) | |
data = [] | |
sid = SentimentIntensityAnalyzer() | |
df['timestamp'] = pd.to_datetime(df['timestamp']) |
OlderNewer