Save My WordPress Blog locally

I don’t remember documenting this so I’m doing it now!
These steps may seem quirky, probably a better way do this, but they work for me right now!

Export WordPress site then convert to Markdown

  • Use WordPress Tools/export to export to a local XML directory
  • Convert the WordPress XML to something useful
    • The node.js tool I found actually found useful is…
    • Blogger to Markdown [Which I think I got here https://github.com/palaniraja/blog2md]
Note: There are other tools I tried but this is the one that actually worked for me!

Here is their description "Convert Blogger & WordPress backup blog posts to hugo compatible markdown documents"

from a terminal in the utility directory run the node.js program like so [remember to use quotes around file names with spaces]
    node index.js w WordPressExportedFile.xml markdownOutputDirectory
    node index.js w "/home/bill/Mystuff/Data/WordPress [Log]/Export/computerlog.WordPress.2021-02-14.xml" markdownOutputDirectory

This will create individual markdown files, for each WordPress blog post.
Wordpress images will be imbedded, otherwise a link will be shown.

Google Chrome…multiple tabs!

Another reason to dislike Google Chrome. I have a bad habit of keeping multiple tabs open, I always tell myself…I’ll get back to that article. It’s a bad habit…but one that I can break, just a little willpower is all it takes. Sorry that line from a song popped into my head! Anywho it seems that Chrome attempts to have as many tabs as possible on the page, resulting in the tabs becoming smaller and smaller, until you can’t even tell what they are. Firefox doesn’t shrink the tabs, you just scroll left/right to see them. Like I said it’s a bad habit on my part. I think I’ve had over a thousand in Firefox before. But even 50 in Chrome is unusable.

Birthday mySQL DB to SQLite

It’s been a while. And I forgot exact steps. So I had to review by looking at my SQLite notes. In addition to the data (from my, mySQL database on my remote web server) I like to keep a local SQLite version on my computer. I have some useful views that allow me to easily query the database. Especially with SQLite’s builtin date routines. So here are the key steps.

  • Export the data on the remote server, using phpMyAdmin, as a CSV using “|” as a seperator, use .txt for extention on save
  • From SQLite:
    • define the table if necessary
    • .separator |
    • .import Birthday.txt Birthday [.import much faster than .read]

Video issues

Started computer, but monitor didn’t come on, restarted but same thing. Opened computer case, crossed fingers, removed and re-seated video card. Came up OK. However while looking at screen which has a lot of white, I noticed it getting dimmer, actually the white was fluxuating between white and blueish. This makes me wonder if it’s the moniter? Up till now I haven’t had any video problems.

Pi-hole continued

One of the best features of the Pi-hole is, unlike browser ad-blockers, the sites don’t know they are being blocked!. So no “Please disable your ad-blocker” messages. So where did I place this massive server? Here it sits by the baseboard, about the size of a deck of cards. It is standing, which cooling wise is best, only because the cables are forcing it to. The back of the modem/router is in front of it. Yes, this area could stand some dusting/cleaning!

Pi-hole

Set-up Pi-hole today on a Pi that has basically done nothing for years. I had tested successfully my Radio Project , which I recently found, but never put it tn the radio. I am curious in the advances in Raspian, so much so that it no longer fits on a 8GB MicroSSD that the Pi came with, with room to spare.

Downloaded the latest raspian
but it was too large to fit on my 8GB MicroSD
Luckily I had viewed a Youtube video and the guy suggested Diet-Pi
Downloaded Diet-Pi [zip was 382K...extracted 1.1GB]

Used Etcher to burn to a MicroSD
Install MicroSD in Pi
Power on
In a few minutes the Pi should show up on your Main computer in this output
sudo nmap -sn 192.168.1.0/24
(base) bill@bill-MS-7B79:~$ sudo nmap -sn 192.168.1.0/24
[sudo] password for bill:          

Starting Nmap 7.60 ( https://nmap.org ) at 2021-01-30 10:04 EST
Nmap scan report for raspberrypi (192.168.1.71)
Host is up (0.00046s latency).
MAC Address: B8:27:EB:9D:6E:68 (Raspberry Pi Foundation)
(base) bill@bill-MS-7B79:~$ 

ssh root@192.168.1.71

Diet-Pi install will begin. When finished…
Get Pi-Hole “One-Step Automated Install” command from their github page
curl -sSL https://install.pi-hole.net | bash
There were a time or two where I wondered if it was stuck so I simply ssh’d into another terminal and ran top
At the time I could see it was running apt so I just waited!

At the end it will tell you to configure your devices to use Pi-hole as DNS server:
name_servers=192.168.1.71
name_servers=2600:1700:24e0:14a0:ba27:ebff:fe9d:6e68

You can see all kinds of cool stats, in a browser...
192.168.1.71/admin

Setting up Manjaro was easy, just changed /etc/resolve.cfg to use name_servers above

Linux Mint on the other hand...not so easy. Because /etc/resolve.cfg is over written at boot. I finally used the networking settings in the icon in the tray. Which after changing it seemed to work...for a while. Then out of the blue It couldn't find the admin pages. Typing sudo nmap -sn 192.168.1.0/24 found the IP address but it was no longer associating it as raspberrypi. I unplugged the Pi but the IP address still showed. I restarted Manjaro and it was still working. So I rebooted into Mint and it was magically working. I think I've determined that it is working, the dashboard though, seems to stop updating.

Doctor? Lawyer? LibreWolf? Brave?

Tried a new browser called LibreWolf. Was supposed to be a better Firefox. After I started it, the 1st setting I changed was “Restore Previous Session”. So I opened a few tabs I always want started, along with the signon. Well it didn’t restore them on a restart. And bonus it also forgot all my Firefox opened tabs too. I guess I didn’t need to read all those articles I meant to get back to. Maybe I should look at Brave?

Flask & Jinja

So Flask like Django also uses a templating language, called Jinja. Which from what I’ve read is similar to Django’s templating language. So maybe I should rethink my rethink? However in Flask’s favor, Jinja IMHO, based on very preliminary research, is to use their words, modeled after Django’s templates. A more powerful Django templating language? It’s starting to seem that a templating language is just a fact of life outside basic HTML. They say…

Features:

  • sandboxed execution
  • powerful automatic HTML escaping system for XSS prevention
  • template inheritance
  • compiles down to the optimal python code just in time
  • optional ahead-of-time template compilation
  • easy to debug. Line numbers of exceptions directly point to the correct line in the template.
  • configurable syntax

Also other projects such as Ansible uses Jinja2.

Raspberry Pi Radio Project

Found my old Raspberry Pi Radio Project. I attempted to recreate the 1960s AM radio experience. I wrote a simple Python program that only plays random 60s era music along with ads and radio jingles from that era. I guess the keyword is “era”, because realistically some 1950s songs would also be played. I had intended to mount the Pi inside a 60+ year old yellow Admiral Model 4L28A AM Tube Radio, which I believe was 1st manufactured in 1959.

The program isn’t complex. The most tedious part of the project was gathering and sometimes clipping ads, jingles, from that era. Also found PAMS (Production Advertising Merchandising Service) from WQAM the radio station popular in my hometown of Miami in the 1960s While testing the program I found a gem that I don’t remember hearing before…Release Me. The version I most remember was from Engelbert Humperdinck however I prefer this one from Little Esther Phillips. I’m sure there are probably other hidden gems in the 340 MP3’s I have from that era. If I remember correctly, I got the bulk of the music using streamtuner2 and streamripper. Wow this music really brings me back! And unlike oldies radio stations, it doesn’t play modern ads and jingles to spoil the mood.