This file contains hidden or 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
#########Scan a given github url passed as parameter with gitleaks | |
#eg: REPO=https://github.com/Telefonica/epg-airflow | |
# Other Param | |
#SERVER_DESTINO_SSH="github.com" | |
Scan_Repo() | |
{ | |
REPO="$1" |
This file contains hidden or 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 pymysql | |
import matplotlib.pyplot as plt | |
def get_query(SQL): | |
con = pymysql.connect(host='MYSQL_REPLACE', user='MYUSUARIO_REPLACE',password='MY_PASSWORD_REPLACE') | |
return pd.read_sql(SQL , con=con) | |
def get_table(db,table=""): | |
"""Return all rows from table """ | |
if (table == "" and "." in db) | (db == "" and "." in table): |
This file contains hidden or 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
# Execute a job in jenkins, using api and crumb | |
# Replace CRED for your credentials and my_jenkins_instance.com with your jenkins instance | |
CRED=<admin:secret> | |
# Get crumb | |
CRUMB=`curl -s --cookie-jar ./cookie -k -u "$CRED" 'https://my_jenkins_instance.com/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)' ` | |
# Execute a job without parameters | |
curl -k -sS --cookie ./cookie -H $CRUMB 'https://my_jenkins_instance.com/job/test/build' -X POST --user $CRED |
This file contains hidden or 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
>>> a=1 | |
>>> b=2 | |
>>> c=3 | |
>>> | |
>>> # We will extract user variables, filtering those who do not contain '__' | |
>>> | |
>>> { k:v for k,v in locals().items() if '__' not in k } | |
{'a': 1, 'b': 2, 'c': 3} |
This file contains hidden or 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
[root@prod-epg-icimas-01 plugins]# cat /usr/lib64/nagios/plugins/check_times/check_times.sh | |
# Measure times and send it to graphite" | |
# time_appconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0) | |
# | |
# time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. | |
# | |
# time_namelookup The time, in seconds, it took from the start until the name resolving was completed. | |
# |
This file contains hidden or 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
#! /bin/bash | |
# script to update jupyter notebooks from command line | |
#### Environment | |
git config --global core.mergeoptions --no-edit | |
DATE=`Actualizado a fecha: date +'%Y-%m-%d %H:%M'` | |
export GIT_MERGE_AUTOEDIT=no |
This file contains hidden or 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
# Order an awesome list by number stars. | |
# | |
# Tis one liner scripts extracts the number of stars from each repo from a given awesome list, and order repos by the number of start | |
# This one liner uses jq command, so you should have it installed in your machine | |
# Parameter | |
# Awesome List to extract, in raw | |
AWESOME_LIST=https://raw.githubusercontent.com/pditommaso/awesome-pipeline/master/README.md | |
#CREDENTIALS="jaimevalero:mysecret" | |
CREDENTIALS="replace-for-your-github-user:replace-for-your-github-password" |