Posts
Category Archives: Uncategorized
Constel
Get constellation names from RA and DEC with Python #!/usr/bin/python3 import sys from astropy import units as u from astropy.coordinates import SkyCoord, get_constellation coord=sys.argv[1:] co=” “.join(coord) c=SkyCoord(co, unit=(u.hourangle,u.deg)) print(get_constellation(c,short_name=False))
Posted in Uncategorized
Leave a comment
Egyptian
Egyptian fractions with Python #!/usr/bin/env python3 import sys from sympy import Rational from sympy.ntheory.egyptian_fraction import egyptian_fraction r=Rational(*map(int,sys.argv[1].split(‘/’))) e=egyptian_fraction(r) print(r,”=”,” + “.join(f”1/{i}” for i in e))
Posted in Uncategorized
Leave a comment
Days
Days between two dates with Python #!/usr/bin/env python3 from datetime import date;import sys m1,d1,y1=map(int,sys.argv[1].split(‘/’));m2,d2,y2=map(int,sys.argv[2].split(‘/’)) print((date(y2,m2,d2)-date(y1,m1,d1)).days)
Posted in Uncategorized
Leave a comment
Lynx
Batch convert HTML to text: for i in *.html; do lynx –dump “$i” > “${i%%.*}.txt”;done
Posted in Uncategorized
Leave a comment
80 – Perl
Sort the Holy Bible by verse length with #Perl #80 perl -e ‘print sort {length $b <=> length $a} <>’ kjv.txt NEH.10:16 – Adonijah, Bigvai, Adin, NEH.10:18 – Hodijah, Hashum, Bezai, NEH.10:27 – Malluch, Harim, Baanah. NEH.12:5 – Miamin, Maadiah, … Continue reading
Posted in Uncategorized
Leave a comment
JB – Inflect
Number to words import inflect inflector=inflect.engine() print(inflector.number_to_words(8675309))
Posted in Uncategorized
Leave a comment
JU – Feh
Display an image without a border feh –borderless /home/teresita/Downloads/48773.jpg &
Posted in Uncategorized
Leave a comment