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
alias draw="/Applications/draw.io.app/Contents/MacOS/draw.io" | |
# Export all pages of a diagram to PNG | |
# Based on: https://stackoverflow.com/q/65404843/2530295 | |
draw-export-all-pages-to-png () { | |
if [ "$#" -eq 0 ]; then | |
echo 2>&1 "No input file entered" | |
return 1 | |
fi | |
if [[ ! "$1" == *.drawio ]]; then |
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
#!/usr/bin/env python3 | |
# TODO - Possible improvements | |
# | |
# - Optionally add timestamp (events.timestamp) in a human readable format | |
# to the output. Useful if the date/time is not in the message itself. | |
# - Use filter_log_events instead of get_log_events, accepts a log stream | |
# pattern, and add log stream name to the output. Useful when we want to | |
# download logs from multiple log streams. | |
# |
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/sh | |
# vim: et colorcolumn=80 | |
set -e | |
# Mount helper for mounting AWS EFS filesystems on AWS EC2 hosts | |
# | |
# AWS EFS filesystems must be mounted as NFS4 filesystems using URLs (called | |
# "mount target DNS") that are different for each available zone. | |
# An EFS URL has the following format: | |
# |
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
""" Module for working with fractional/rational numbers | |
""" | |
from functools import total_ordering | |
def gcd(a, b): | |
""" Greast common divisor between two numbers | |
It uses the Euclidean algorithm. |
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
-- AppleScript to create a new file in Finder | |
-- | |
-- Use it in Automator, with the following configuration: | |
-- - Service receives: no input | |
-- - In: Finder.app | |
-- | |
-- References: | |
-- - http://apple.stackexchange.com/a/129702 | |
-- - http://stackoverflow.com/a/6125252/2530295 | |
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript |
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/sh | |
# | |
# $Id$ | |
# | |
# this shell script is designed to add new SNMPv3 users | |
# to Net-SNMP config file. | |
prefix=/usr | |
exec_prefix=/usr | |
includedir=/usr/include |
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/sh | |
set -e | |
# grub-mkconfig helper script. | |
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. | |
# | |
# GRUB is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |