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
#!/usr/bin/python3 | |
# https://stackoverflow.com/questions/64991055/can-i-get-the-most-recent-commit-of-a-repository-with-bitbucket-api | |
import requests | |
from requests.auth import HTTPBasicAuth | |
##Login | |
username = '<<bitbucket user>>' | |
password = '<<app password>>' |
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
#! /bin/sh | |
SERVER=$1 | |
TIMEOUT=5 | |
RETVAL=0 | |
SNI=$3 | |
TIMESTAMP=`echo | date` | |
if [ -z "$2" ]; then | |
PORT=443; | |
else | |
PORT=$2; |
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
# kubectl apply -f https://gist.githubusercontent.com/teopost/0ae4af9d5b6f2fa79283dca29fd77f1c/raw/eaae035f5adca37ca00d4a49f1c1958fe3db89e3/ubuntu-sleep.yaml | |
# kubectl exec -it ubuntu -- /bin/bash | |
# apt update && apt-get install -y telnet curl net-tools ssh nmap iputils-ping bind9-utils | |
# oppure: | |
# kubectl run -i --tty busybox --image=busybox --restart=Never -- sh | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ubuntu | |
labels: |
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
#!/bin/sh | |
MakeCert(){ | |
domain=$1 | |
openssl req -x509 -nodes -days 9000 -newkey rsa:2048 -keyout ${domain}.key -out ${domain}.crt \ | |
-subj "/C=IT/ST=Italy/L=Rimini/O=Acme srl/OU=IT Department/CN=${domain}" | |
} |
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
#!/usr/bin/env python | |
import requests | |
ip_ranges = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').json()['prefixes'] | |
amazon_ips = [item['ip_prefix'] for item in ip_ranges if item["region"] == "eu-west-1"] | |
#ec2_ips = [item['ip_prefix'] for item in ip_ranges if item["service"] == "EC2"] | |
#amazon_ips_less_ec2=[] |
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
#!/bin/sh | |
# nmon as a service | |
# installer script for red-hat 7.5 | |
yum install -y nmon | |
if [ $? -eq 1 ]; then | |
# Download NMON archive | |
cd /tmp | |
wget http://sourceforge.net/projects/nmon/files/nmon16e_mpginc.tar.gz |
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
#!/bin/sh | |
#export filename=$(date +%Y%m%d-%H%M%S) | |
export filename=backup-website | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import csv | |
from jira import JIRA | |
options = {'server': 'https://server.atlassian.net'} | |
jira = JIRA(options, basic_auth=('[email protected]', 'xxxxxx')) | |
size = 1000 | |
initial = 0 |
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
* https://www.ccworld.it/2015/10/retropie-stazione-di-emulazione-retrogaming-con-raspberry-pi/ | |
* https://romsmania.cc | |
* https://archive.org/details/MAME2003_Reference_Set_MAME0.78_ROMs_CHDs_Samples |
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
function displaytime { | |
local T=$1 | |
local D=$((T/60/60/24)) | |
local H=$((T/60/60%24)) | |
local M=$((T/60%60)) | |
local S=$((T%60)) | |
printf "%s days, %s hours, %s mins, %s secs" "$D" "$H" "$M" "$S" | |
} |
NewerOlder