Skip to content

Instantly share code, notes, and snippets.

@nbr23
nbr23 / aws_ecr_stats.sh
Last active November 18, 2024 05:06 — forked from RafaelWO/awc_ecr_stats.sh
AWS: Calculate the size of all ECR repositories
repos=""
sizes=""
name_lens=""
image_counts=""
# Check if user is logged in
if ! aws sts get-caller-identity &> /dev/null; then
echo "ERROR: Seems like your SSO session is invalid. Please run"
printf "\n $ aws sso login\n\n"
echo "before you run the script."
Image title:<br/>
<input type="text" id="title"/><br/>
Sender name:<br/>
<input type="text" id="from"/><br/>
Image:<br/>
<input type="file" id="blob"/><br/>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
function handleFileSelect(evt) {
var reader = new FileReader();
@nbr23
nbr23 / available_log.py
Last active June 22, 2018 19:39
Parse SAP's available.log file to create an SLA calculation Excel spreadsheet
#! /usr/bin/python3
import calendar
import re
import sys
import os
from dateutil.parser import parse
import datetime
def write_csv(downtimes, output, show_month=None):
with open(output, 'w+') as f:
@nbr23
nbr23 / httpsify.sh
Created October 10, 2017 22:55
s/http/https/g on github repo
#! /bin/bash
if [ $# -lt 3 ]; then
echo "Usage: ./$0 repository destination exclusions"
exit 1
fi
git clone $1 $2
find $2 -type f -exec ./replace_in_file.sh {} "$3" \;
cd $2 && git status
.\ImageJ.exe -eval "macfile=File.openAsString('batch_rg_channels_merge.macro'); eval(macfile);"
@nbr23
nbr23 / irregularverbs.py
Last active August 29, 2015 14:22
Irregular verbs list
#! /usr/bin/python3
import sqlite3
import urllib.request
from bs4 import BeautifulSoup
import sys
def get_verbs(page, verbslist):
baseurl = "http://pasttenses.com/irregular-verbs-list" + page
data = urllib.request.urlopen(baseurl)
@nbr23
nbr23 / suivi.py
Last active September 17, 2015 08:35
La poste tracking
#! /usr/bin/python3
import urllib.request
import urllib.parse
from bs4 import BeautifulSoup
def get_colissimo_info(colissimo_id):
data = urllib.parse.urlencode({'colispart': colissimo_id})
colissimo_baseurl = "http://www.colissimo.fr/portail_colissimo/suivre.do"
colissimo_data = urllib.request.urlopen(colissimo_baseurl, data.encode('utf-8'))