Android 10 rant

Got new cell phone. I guess technically it is a computer. It has Android 10. They removed navigation buttons at the bottom. IMHO, If you change something it’s use should be intuitive how to do the thing you changed…and it wasn’t. Supposedly you now use gestures for navigation. But if I have to stop and google how to do it it’s not intuitive. What a time waster. I found, I could get the buttons back with a settings change. I didn’t even bother to see the new way to navigate just more wasted time I don’t have. I saw some complaints that they were trying to copy Apple.

Master the Mainframe 2020

Interesting, I read “Through three interactive Levels, you will access a mainframe and get skilled up on the foundations of Mainframe, including JCL, Ansible, Python, Unix, COBOL, REXX, all through VS Code.” So now they include Python in the MTM course.

The 2019 course already included JCL, Unix, Cobol and REXX. Neither Python or VS Code was used in the 2019 course. In the above line in the first paragraph only Ansible, Python and VS Code were added. And out of those three I used two, Python & VS Code, not included in the course! That was what I was most proud of (combining technologies) while working on my final MTM project…all through VS Code.

I didn’t need to use Python (another language could have been chosen), but I used it because I was familiar with it. The point was to make mainframe development easier by not confining myself to the mainframe. I talked about it almost 4 months ago here where I specifically talk about my plans to parse data using Python and using VS Code to help accomplish this, and again here also here and finally (I think) here.

Remove flatpak

Completely remove flatpak from moms computer, regaining ~10GB of space. Started getting low disk space (~500/mb) warnings. This was on a 30GB root partition. Using the terrific Filelight disk space utility, I identified flatpak as the culprit! I only had installed 4 flatpack programs and found a non-flatpack install for Signal, nothing else was important to me. Removing these only made a small dent in disk space usage. So I used Software Manager to remove flatpack itself, which still didn’t help much. A lot of Flatpak related files, and hence space remained! So off to google where I found this solution How to completely remove flatpak. I decided on the following solution.

I would recommend reinstalling flatpak and running the following commands:

flatpak uninstall --unused

sudo apt-get remove --autoremove flatpak

sudo apt-get purge flatpak

The 1st step reclaimed a lot of space.
The 2nd step scared me because it looked like it was removing a lot of non-flatpak programs.
I was actually concerned that the computer would reboot…but it did!

Anaconda libraries in Python

Let me preface this by saying I’m not talking about Python in Jupyter notebooks. Because…duh, I know I can do that. I say this because I found a few YouTube videos that had titles about using Python in Anaconda with no mention of Jupyter notebooks in the title. But when you started watching them that’s what they meant. One used Spyder which is a browser based Python IDE included with Anaconda. I even saw an article titled “Anaconda Python Tutorial: Everything You Need to Know” and you know what? It didn’t have everything I needed to know. So no answer from them or soup for me! Anywho I had installed Anaconda which included many libraries. I wanted to run existing Python programs that used panda’s and numpy. I guess I had originally installed these libraries globally using pip. The existing python pandas programs were not finding pandas or numpy. The Anaconda download is > 500MB and includes those and many other libraries. So I didn’t want to re-download panda’s and numpy since they were already in Anaconda. Since my bash prompt was showing (base) and typing conda list showed those libraries, I wasn’t sure of the problem at first.

This problem may have been addressed somewhere on the Internet…but I never found an answer! But you know google results can vary drastically depending on how you construct the search. I could google on another day and construct a totally different search and find success! I saw the question asked in a way I assumed matched my question. But the answer didn’t seem to fit my goal.

So this seems maybe a little obvious in hind-site. The solution was revealed to me by seeing how VS Code successfully executed the program. So from the command line I can execute by proceeding the program name with the path of my anaconda bin file like so “~/anaconda3/bin/python program.py”. So in order to run it directly without the prefix I thought all I needed to do was add that to my program #! (shebang as it is called) in my Python program. However I found that, that didn’t work! To make a long story short the shebang didn’t work with the tilde ~, which designates your home directory! So I had to give the full path like #!/home/user/anaconda3/bin/python. Success at last!

Python SSG

Restructure final html name, to be sequenced by date/time. Because of the random way filenames can be returned. For example if you have 500 files then add one, it won’t necessarily be the 501st file python returns. This makes it hard for me to fix links. I decided it best to sequence (time wise) html file names 0001.html, 0002.html…0500.html oldest to most recent. For example before this change the oldest post was returned 456th and would have been named 0456.html the one before that was returned 66th. With this change the oldest post will always be 0001.html. This also helped me to easily separate the steps.

## (1) Reformat Hugo Markdown
## (2) Convert Markdown to HTML (Slow!)
## (3) Add HTML Formatting
## (4) Build Index

For 450+ posts…
All the steps where I/python does the work are fast! (< 1 sec)
Step #2 which calls an external program “md-to-html” is slow (>30sec)

Static site fixing some broken links

Well actually quite a few. Existing images in my image directory worked fine. But I didn’t want to link to a WordPress directory. What if I deleted WordPress. If you uploaded images using WordPress it put them in subdirectories within wp/wp-content/uploads/. There were 238 items in there. So instead I simply copied “wp/wp-content/uploads/” to my image directory maintaining that structure “image/wp/wp-content/uploads/” which works well with only minor link changes.

Next to look at some broken pdf links.

Static site, Python search #2

So I wrote the web search form form and python search program in Python 3 of course, because Python 2 no longer supported, for 8 months now. But currently I’m unable to run Python 3 on my web server. Python 2 however still works.