IOTOP: Shows real-time stats for disk. I attached a SC1 device and wanted to see how it ran on AWS root@jaws /]# yum install iotop Loaded plugins: priorities, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00 amzn-updates | 3.8 kB 00:00 Resolving Dependencies –> Running transaction check —> Package iotop.noarch 0:0.3.2-7.6.amzn1 will be installed –> Finished Dependency Resolution Dependencies Resolved ================================================================================ […]
Monitoring io performance with IOTOP
Graviton free trial extended until end of the year
tg4.micro trial continues. It has a lot of promise, but things need to come together. Free Trial: All new and existing AWS customers can try the t4g.micro instances free until December 31, 2021. During the free-trial period, customers who run a t4g.micro instance will automatically get 750 hours per month deducted from their monthly bill. Refer to the FAQ for additional […]
Fuzzy matching
Some interesting links on Fuzzy matching: https://en.wikipedia.org/wiki/Levenshtein_distance Python library that implements Levenshtein. https://github.com/seatgeek/fuzzywuzzy
Jupyter Notebook Markdown tutorial
Nice tutorial on markdown text capabilities. Brynmawr tutorial
Python – getting seconds since midnight
import datetime now = datetime.datetime.now() midnight = now.replace(hour=0, minute=0, second=0, microsecond=0) seconds = (now – midnight).seconds Can be made into an easy function. And conversion to minutes and hours easy.
High cpu use Google cloud
Run a top command user@ iowa-1$ top top – 14:18:43 up 160 days, 12:15, 1 user, load average: 0.25, 0.23, 0.14 Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie %Cpu(s): 3.5 us, 4.6 sy, 0.0 ni, 91.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 583.3 total, 86.6 free, 191.5 used, 305.2 buff/cache […]
Add versions to css and javascript.
If you change css or js files on a live webserver, change the versions. Symptoms: css not taking effect or when you look at the css in the browser the changes are not there. Work-around: Do a <ctrl> – <F5> or a <ctrl>-<shift> – <F5> to force a hard refresh on browser https://css-tricks.com/strategies-for-cache-busting-css/
List of mime types
This is for type= tag in htmls and other things https://www.iana.org/assignments/media-types/media-types.xhtml
How to check expiration dates for SSL certs
Installed on a webserver [ec2-user@aws ~]$ openssl s_client -connect www.jibsheet.net:443 2>/dev/null | openssl x509 -noout -dates notBefore=May 7 14:16:05 2021 GMT notAfter=Aug 5 14:16:05 2021 GMT Cert was generated on May 7th and expires August 5th. Cert download after generation Lines 10 and 11 have the expiration data [ec2-user@aws]$ openssl x509 -text -noout -in jibsheet.cert Certificate: Data: Version: […]
Python – how to use glob under windows
Trick is to use “r” before the string See error The “r” means it is a raw string https://docs.python.org/3/reference/lexical_analysis.html File “C:\Users\jonallen\Documents\github\wsgi\FlaskApp\FlaskApp\obs_utils.py”, line 13 obs_dir = “C:\Users\jonallen\Documents\github\weather_obs” ^ SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape import os import sys import glob from pathlib import Path def get_obs_csv_files( dir ): glob_path = Path(dir) […]