Skip to content

Instantly share code, notes, and snippets.

Herminio Vazquez canimus

  • Valencia, Spain
Block or report user

Report or block canimus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
canimus /
Created Sep 13, 2019
Store SSH key with previous version
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
canimus /
Last active Sep 1, 2019 — forked from vestalisvirginis/
dna manipulation functions
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'''
canimus /
Created Jun 25, 2019
Build NetworkX Graph
# Navigate through xml tree and build a directed graph
def add_tree(G, node):
for n in node.getchildren():
G.add_edge(node.tag, n.tag)
add_tree(G, n)
View hdf5-alpine.docker
apk --no-cache add --virtual .builddeps.edge \
--repository \
canimus / pearson.tick
Created Mar 16, 2019
Flux - Pearson of CPUs
View pearson.tick
// 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)
canimus /
Created Mar 12, 2019
Expand volume linux
# Logical volume display
# Volume maps
# Extend based on VG Name and lvdisplay path
lvextend -l +5120 /dev/dockerimvg/varlibdocker
# Apply fs grow into volume
View Docker API via the Unix
# 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 \
canimus /
Last active Jan 8, 2019
termgraph with query to influxdb
http :8086/query?db=telegraf \
"q==select stddev(Bytes_Sent_persec) from win_websrv where host =~ /3020/ group by time(1d) fill(0)" \
'Accept: application/csv' |
tail -n +2 |
awk -F, '{print strftime("%Y-%m-%d", $3/1000000000)","$4}' |
termgraph --calendar --start-dt 2018-06-01 --color green
canimus / new_alert.influx
Created Nov 29, 2018
Inserting alerts manually
View new_alert.influx
insert alerts,alertID=MEM:ID,alertName=MEM,instance=total,environment=p,host=localhost,level=INFO,triggerType=threshold duration=100i,message="Testing msg",value=80
insert alerts,alertID=MEM:ID,alertName=MEM,instance=total,environment=p,host=localhost,level=WARNING,triggerType=threshold duration=100i,message="Testing msg",value=100
insert alerts,alertID=MEM:ID,alertName=MEM,instance=total,environment=p,host=localhost,level=CRITICAL,triggerType=threshold duration=100i,message="Testing msg",value=200
insert alerts,alertID=MEM:ID,alertName=MEM,instance=total,environment=p,host=localhost,level=OK,triggerType=threshold duration=100i,message="Testing msg",value=10
canimus /
Created Nov 7, 2018
Telegraf configuration to parse IIS log files
environment = "a1"
interval = "10s"
round_interval = true
metric_batch_size = 100
metric_buffer_limit = 300
collection_jitter = "0s"
flush_interval = "10s"
You can’t perform that action at this time.