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

3 Basic Apache2 commands to find more about webserver

Version Information [ec2-user@asw-host]$ sudo apachectl -v Server version: Apache/2.4.46 (Amazon) Server built: Aug 24 2020 18:40:26 Modules loaded [ec2-user@aws host]$ sudo apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) access_compat_module (shared) actions_module (shared) alias_module (shared) Running Config [ec2-user@aws host]$ sudo apachectl -S VirtualHost configuration: *:80 myhost (/etc/httpd/conf/httpd.conf:45) *:8443 myhost (/etc/httpd/conf.d/nss.conf:83) *:443 is a NameVirtualHost default server myhost (/etc/httpd/conf/httpd.conf:54) […]

Python Logging – how to have 2 loggers to same rotating logfile

Here is an example using app with “Schedule” This is using the Schedule Python module Docs for Schedule Module – has own logger Solution – is just to add the same handler instance to the 2nd logger. logger = logging.getLogger(‘weather_obs_f’) ch = logging.StreamHandler(stream=sys.stdout) ch_format = logging.Formatter(‘weather_obs – %(message)s’ ch.setFormatter(ch_format) ch.setLevel(logging.INFO) pid = os.getpid() fhandler = TimedRotatingFileHandler(‘weather_obs.’ + str(pid) + ‘.log’, […]

Graviton – getting python pandas to work

Procedure  I reviewed the packages available – yum list – output of ‘yum list’ see numpy and scipy but no pandas – means we might have to compile. 2.   Install  development packages root@graviton~]# sudo yum install “@Development tools” python3-pip python3-devel blas-devel gcc-gfortran lapack-devel …. Installed: autoconf.noarch 0:2.69-11.amzn2 automake.noarch 0:1.13.4-3.1.amzn2 bison.aarch64 0:3.0.4-6.amzn2.0.2 byacc.aarch64 0:1.9.20130304-3.amzn2.0.2 cscope.aarch64 0:15.8-10.amzn2.0.2 ctags.aarch64 0:5.8-13.amzn2.0.2 diffstat.aarch64 0:1.57-4.amzn2.0.2 doxygen.aarch64 […]

AWS – Graviton ( ARM64 )

Some links to get started. https://github.com/aws/aws-graviton-getting-started/tree/master https://aws.amazon.com/ec2/instance-types/a1/   working on getting pandas installed.  

loading 3 day weather data using pandas

Notes   In [1]: import pandas as pd import numpy as np import lxml In [2]: df = pd.read_html(‘https://w1.weather.gov/data/obhistory/KDCA.html’) In [7]: type(df) Out[7]: list In [11]: df[3] Out[11]: Date Time(edt) Wind(mph) Vis.(mi.) Weather Sky Cond. Temperature (ºF) RelativeHumidity WindChill(°F) HeatIndex(°F) Pressure Precipitation (in.) Date Time(edt) Wind(mph) Vis.(mi.) Weather Sky Cond. Air Dwpt 6 hour RelativeHumidity WindChill(°F) HeatIndex(°F) altimeter(in) sea level(mb) 1 hr 3 hr […]

Adding a partition – AWS EBS

You have attached a new EBS volume Use ‘fdisk -l’ to find. first disk is the boot disk of your EC2 subsequent disks are the ones you have attached. root@host ]# fdisk -l WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own Disk /dev/xvda: 8589 MB, 8589934592 bytes, 16777216 sectors Units = […]

Google cloud debian – nslookup is missing

nslookup missing Have to install it. user @iowa_f1:~$ sudo apt-get install dnsutils -y Reading package lists… Done Building dependency tree Reading state information… Done dnsutils is already the newest version (1:9.11.5.P4+dfsg-5.1+deb10u3). 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. This will install nslookup and dig. Dig is a dns inquire program, that is a bit more […]