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
canimus / ssh-keygen.sh
Created Sep 13, 2019
Store SSH key with previous version
View ssh-keygen.sh
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
@canimus
canimus / dna_functions.py
Last active Sep 1, 2019 — forked from vestalisvirginis/dna_functions.py
dna manipulation functions
View dna_functions.py
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
canimus / recursive_tree.py
Created Jun 25, 2019
Build NetworkX Graph
View recursive_tree.py
# 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)
View hdf5-alpine.docker
apk --no-cache add --virtual .builddeps.edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
hdf5-dev
@canimus
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
canimus / expand_xfs.sh
Created Mar 12, 2019
Expand volume linux
View expand_xfs.sh
# 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
View Docker API via the Unix socket.md
# 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
canimus / termgraph-influxdb.sh
Last active Jan 8, 2019
termgraph with query to influxdb
View termgraph-influxdb.sh
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
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
canimus / telegraf-iis.properties
Created Nov 7, 2018
Telegraf configuration to parse IIS log files
View telegraf-iis.properties
[global_tags]
environment = "a1"
[agent]
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.