# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine
# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
-ti \
--rm \
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 seaborn as sns | |
import pandas as pd | |
from collections import OrderedDict | |
x = df[df.statusChangeBy>10].groupby([pd.Grouper(freq="W", key="statusChangedDate"), "Name"]).size().compute() | |
x = x.reset_index() | |
x.columns = ["Date", "Team", "Total"] | |
x = x.sort_values(by="Date") | |
plt.figure(figsize=(30,30)) |
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 | |
import numpy as np | |
import pymssql | |
conn = pymssql.connect("localhost", "SA", "yourStrong(!)Password", "FORCE_PAPPA") | |
with open("task.sql") as infile: | |
doc_query = infile.read().strip() | |
time_range = list(pd.date_range(start='2019-01-01', periods=12, freq="MS").strftime("%Y-%m-%d").values) |
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
# Author: Herminio Vazquez | |
# Date: 2019-10-28 | |
# Project: DataStore | |
# @canimus | |
import os | |
from multiprocessing import Pool | |
import multiprocessing | |
import subprocess | |
from functional import seq |
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
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa |
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 functional import seq # PyFunctional | |
from itertools import product | |
def all_kmers(k): | |
'''return list of all dna carthesien products of length k''' | |
all = list(product('ACGT', repeat=k)) | |
return seq(all).map(lambda x: ''.join(x)).to_list() | |
def kmer_per_segment(dna_segment, k): | |
'''return all the dna substrings of length k of the different dna strings in dna 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
# Navigate through xml tree and build a directed graph | |
def add_tree(G, node): | |
for n in node.getchildren(): | |
G.add_node(n.tag) | |
G.add_edge(node.tag, n.tag) | |
add_tree(G, n) | |
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
apk --no-cache add --virtual .builddeps.edge \ | |
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ | |
hdf5-dev |
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
// Calculate the correlation between 2 CPU Usage | |
cpu0 = from(bucket: "telegraf") | |
|> range(start: v.timeRangeStart, stop: v.timeRangeStop) | |
|> filter(fn: (r) => r._measurement == "cpu") | |
|> filter(fn: (r) => r._field == "usage_idle") | |
|> filter(fn: (r) => r.cpu == "cpu0") | |
cpu1 = from(bucket: "telegraf") | |
|> range(start: v.timeRangeStart, stop: v.timeRangeStop) |
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
# Logical volume display | |
lvdisplay | |
# Volume maps | |
vgdisplay | |
# Extend based on VG Name and lvdisplay path | |
lvextend -l +5120 /dev/dockerimvg/varlibdocker | |
# Apply fs grow into volume |