Updates

Serving Pier with HTTPS

For reading this wiki, I'm fine to use unencrypted HTTP, however for logging in and editing pages, it seems better to use HTTPS. For making this change, I've done the following:


Open Connectivity

For security, I use security groups in AWS. To prevent issues with the next steps, an entry was added to allow incoming traffic on port 443.

Request SSL Certificates from Let's Encrypt

The site https://letsencrypt.org provides the files, installed with:

ubuntu@ip-172-31-43-26:~$ sudo snap install --classic certbot
certbot 1.11.0 from Certbot Project (certbot-eff✓) installed

After reading and aggreeing to the subscriber agreement, the script had errors with my NGinX config:

Account registered.
No names were found in your configuration files. Please enter in your domain

This did setup the certs in the proper directory despite the error.

NGinX Configuration Updates

These are described on NGinX in Front of Pier, specifically:

  • turning off server_tokens should help with security
  • adding a listener for SSL on port 443
  • really large pages can take Pier more than one minute to bring up. The proxy timeout of 300 prevent NGiNX from displaying a gateway error
Posted by John Borden at 3 February 2021, 10:26 pm link

Remove Chrome

Based on https://chromeisbad.com/, I removed Chrome and Keystone from several of my Apple computers. The performance is somewhat better on an older iMac. While freeing up space isn't the main intention, this freed up 20G of space where it was almost full.

Since I prefer the command line, this generates a list of directories:

ls -adl /Library/* /Library/LaunchAgents/* /Library/LaunchDaemons/* /Library/Application\ Support/* /Library/Caches/* /Library/Preferences/* | grep -i -e google -e keystone
ls -adl ~/Library/* ~/Library/LaunchAgents/* ~/Library/Application\ Support/* ~/Library/Caches/* ~/Library/Preferences/* | grep -i -e google -e keystone
Posted by John Borden at 24 December 2020, 3:32 pm link

HP Printers and Apple

Recently I was unable to print from my Apple computer, it report a certificate problem. These printer problems are well documented by Mr. Macintosh. Deleting a directory allowed the driver to be reinstalled from the terminal:

sudo rm -Rf /Library/Printers/hp
Posted by John Borden at 19 November 2020, 2:08 am link

Gilded Rose Kata

In the process of teaching my oldest daughter Smalltalk, we finished working through the Gilded Rose Code Kata, for now the code can be found on Smalltalkhub .

The given code is a D&D inventory system, the task is to change the update method so conjured items degrade twice as quickly as normal items. For this we wrote a simple test that degraded a conjured vest by 1 day and compared its value to a normal vest degraded by two days.

One problem which threw us off was GildedRoseImaginaryTest>>#nextDay: takes an argument, but this item must be the same item which is most-recently created by #givenItem:sellIn:quality:. Each time this is sent replaces the inventory.

Its clear that the creators wanted the task to modify GildedRose>>#updateInventory based on the comment that Item should not be modified. An interesting exercise is to support the same functionality by modifying Item and adding subclasses. This means adding a message to express how items lose value:

  • Item
    • AgedItem
    • TicketItem
    • ConjuredItem
    • LegendaryItem

Several advantages are provided by this:

  • The original inventory update method hard-coded the names of the items, the new code changes this to invoking #nextDay on each item. The message Item>>named:... is now a factory for choosing a subclass
  • The original inventory update had two variables to manage, and for some items these had an interconnected relationship (for example tickets to events that have passed have no quality)
Posted by John Borden at 14 October 2020, 1:52 am link

Todo Annotations

Previously, it seemed like a good idea to create a todo annotation similar to the note annotation, which looks like this:

This is a note annotation which starts with two at-signs, the word note, then this text.

This would make make it easy to add a task at the end of page:

@@todo Task that wasn’t finished when editing this page

Unfortunately, the CSS for this also affects tasks lists, like Todo, so it shows up with a bright yellow background.

Bright yellow todo background
Since using HTML works already, it seems like a better idea:

{{{html: <span class="TODO">This is a task that needs work</span>}}}

While working on this, I had issues with browsers caching the style sheet. One method that worked well was changing the port with each test - an example is on Loading Pier 3.2 into Pharo 7.

Posted by John Borden at 28 September 2020, 2:56 am link
<< 1 2 3 4 5 6 7 8 9 10 >>