Skip to content

Instantly share code, notes, and snippets.

View uolter's full-sized avatar

Walter Traspadini uolter

View GitHub Profile
@uolter
uolter / tls_check.go
Created December 27, 2021 12:50
Check TLS (https) certificate
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"os"
"time"
)
@uolter
uolter / kv_exp_dates.sh
Created December 27, 2021 13:43
List certificate expire dates in azure key vault
#!/bin/bash
###############################
# pip install python-dateutil #
###############################
KEYVAULTS=$(az keyvault list --query "[].name" -o tsv)
# KEYVAULTS="<space_delimited_list_of_vault_names>"
for KEYVAULT in $KEYVAULTS; do
for CERT in $(az keyvault certificate list \
@uolter
uolter / main.go
Last active November 11, 2021 10:19
Go check SSL/TLS
package main
import (
"crypto/tls"
"fmt"
"time"
)
type target struct {
domain string
@uolter
uolter / iplookup.go
Created January 22, 2021 13:49
IP Lookup ... reads form a txt file a list of domains and gets their ip addresses
package main
import (
"bufio"
"fmt"
"net"
"os"
)
func readDomainsFromFile(filePath string) (domains []string, err error) {
@uolter
uolter / setup-web2py-ubuntu.sh
Created January 26, 2014 15:00
Set up web2py to run on Ubuntu with apache and mod_wsi
echo "This script will:
1) install all modules need to run web2py on Ubuntu/Debian
2) install web2py in /home/www-data/
3) create a self signed sll certificate
4) setup web2py with mod_wsgi
5) overwrite /etc/apache2/sites-available/default
6) restart apache.
You may want to read this script before running it.
@uolter
uolter / release-notes.sh
Last active August 5, 2020 08:37
Bash script to create a Release with updated CHANGELOG file
#!/bin/bash
latest_tags () {
echo "Latest tags!"
git describe --tags `git rev-list --tags --max-count=3`
echo "Status"
git status -uno
}
const https = require('https');
const fs = require('fs');
const hostname = 'Todo';
var outstanding_reqs = 0;
var got_continue = false;
function readTextFile() {
@uolter
uolter / terraform_terragrunt_aliases
Created June 3, 2020 12:02
Useful Terraform and Terrgagrunt aliases
# Terraform
alias trf='terraform'
## Terragrunt
alias trg='terragrunt'
alias trgfmt='terragrunt hclfmt'
alias trglint='find . -type f -not -path "*/\.*" | grep ".hcl" | terragrunt hclfmt'
alias trgcleancache='find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} \;'
function trginitall() {
@uolter
uolter / collaborative_filtering.py
Created June 30, 2013 09:31
Simple collaborative filtering in python
import numpy as np
from scipy.optimize import fmin_cg
def cost(p, Y, R, alpha):
"""
Calculates collaborative filtering cost function.
Arguments
----------
@uolter
uolter / hide_code.py
Created September 4, 2016 16:27
Hide code cells in Jupyter notebook
from IPython.display import HTML
def hide_code():
return HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$("div.input").hide();
} else {
$("div.input").show();