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 sh | |
usage() { | |
cat "Usage: $(basename "$0") <giallozafferano.it URL>" | |
exit 0 | |
} | |
[ -z "$1" ] && { usage; } | |
if ! command -v pup > /dev/null | |
then |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>rcastellotti - boilerplate</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css" /> | |
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script> | |
<script> |
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
import subprocess | |
def run_fio_test(machine, filename, iodepth, rw, bs, numjobs): | |
name = f"{machine}-{rw}-{bs}-{numjobs}-{iodepth}" | |
command = [ | |
"fio", | |
"--name=" + name, | |
"--filename=" + filename, | |
"--iodepth=" + str(iodepth), | |
"--rw=" + rw, |
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
from urllib.request import urlopen | |
import subprocess | |
import json | |
import argparse | |
def download(url): | |
with urlopen(url.replace(".html", ".json")) as response: | |
body = response.read() | |
payload = json.loads(body) |
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
@app.route("/orders", methods=["GET", "POST"]) | |
def orders(): | |
orders = Order.query.all() | |
return render_template("orders.html", orders=orders) |
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
// ==UserScript== | |
// @name RCS sane rankings | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show full rankings on RCS websites | |
// @author @rcastellotti | |
// @match https://www.milanosanremo.it/* | |
// @match https://www.ilombardia.it/* | |
// @match https://www.strade-bianche.it/* | |
// @match https://www.tirrenoadriatico.it/* |
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/bash | |
url="https://cacr.uwaterloo.ca/hac/about/" | |
mkdir hac | |
cd hac | |
wget -O "00 TOC.pdf" "${url}toc3.pdf" | |
wget -O "01 Overview of cryptograpy.pdf" "${url}chap1.pdf" | |
wget -O "02 Mathematics Background.pdf" "${url}chap2.pdf" | |
wget -O "03 Number-Theoretic Reference Problems.pdf" "${url}chap3.pdf" |
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
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} | |
body { | |
color: #444; | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; |
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 bash | |
if [ $# == 0 ]; then | |
echo "Usage: $0 param1 [param2]" | |
echo "* param1: png image (best 512x512)" | |
echo "* param2: folder for images, default: static/" | |
exit | |
fi | |
#check if imagemagick is installed and fail otherwise |
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/bash | |
url="http://pages.cs.wisc.edu/~remzi/OSTEP/" | |
mkdir ostep | |
cd ostep | |
wget -O "00a Preface.pdf" "${url}preface.pdf" | |
wget -O "00b TOC.pdf" "${url}toc.pdf" | |
wget -O "01 Dialogue.pdf" "${url}dialogue-threeeasy.pdf" | |
wget -O "02 Introduction.pdf" "${url}intro.pdf" |
NewerOlder