Skip to content

Instantly share code, notes, and snippets.

@AvverbioPronome
AvverbioPronome / 001_factorial.sh
Last active February 10, 2022 13:38
Challenges for Linux Users Group on fb
#!/bin/sh
# https://www.facebook.com/groups/LinuxUsersGroupOfficial/posts/4186776714756296/
error(){
>&2 echo "$@"
}
validate_and_calc(){
# https://stackoverflow.com/a/808740
if [ "$1" -eq "$1" ] 2>/dev/null
#!/bin/sh
cert_expiry(){
# cert_expiry host port
openssl s_client -connect "${1}:${2}" -servername "${1}" 2>/dev/null </dev/null | \
openssl x509 -noout -dates | grep notAfter | cut -d= -f 2
}
difference(){
# difference date date
@AvverbioPronome
AvverbioPronome / .gitignore
Last active January 17, 2026 12:12
Dragracing dotproducts
*
!*/
!*.*
![Mm]akefile
*.o
*.hi
>>> import itertools
>>> def factorials():
... i = 1
...
... for n in itertools.count(1):
... yield i
... i = i*n
...
>>> list(itertools.islice(factorials(), 10))