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/

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) […]