Categories
Quotes Tech

The End of an Era

It is with a surreal sense of melancholy I announce that on July 15th, 2020, I will be shutting down the last of our user hosting. It has been a long, winding journey…

hon1nbo / https://hackingand.coffee/2020/07/the-end-of-an-era/

I am not in the same position as hon1nbo, but I feel like their story and mine do have many parallels.

For the past few years, I’ve physically set up and managed several web servers in my garage.

I am giving them up. Doing my own web hosting was a ton of fun! There was lots to learn, and it was engaging. However, I want to make room for other things in my life.

When I am administering the physical and software configuration of these machines, I am not journaling, working out, or connecting with friends.

Therefore, I’ve migrated this website, along with https://bethanyandvincent.com to a cloud provider.

This is the most recent step in my ongoing quest to spend my limited time in life wisely.

Categories
Open Source Tech

Bulk Resize Images for WordPress

Here’s a python script.

import os
import subprocess

# inspired by this post
# https://guides.wp-bullet.com/batch-resize-images-using-linux-command-line-and-imagemagick/

def main():
    # the maximum length in any direction (width or height)
    # setting at 1600 because full HD (1920x1080) seems larger than necessary
    # this will allow 1600x900 (or portrait 900x1600) images.
    MAX_LEN = "1600" 
    size_parm = MAX_LEN+'x'+MAX_LEN+'>' #https://legacy.imagemagick.org/Usage/resize/#shrink
    
    # files in the input directory will (at least SHOULD) remain untouched.
    # files with identical names will be created in the output directory.
    # files in the output directory are OVERWRITTEN (if they already exist and the names match)
    IN_DIR = '/home/vince/Pictures/WordPress'
    OUT_DIR = '/home/vince/Pictures/WordPressSmall'

    # show what is about to happen
    print ('Input: ', IN_DIR)
    print ('Output:', OUT_DIR)
    print ('Resize Geometry:', size_parm)

    for filename in os.listdir(IN_DIR):
        # get full file paths
        infile =  os.path.join(IN_DIR, filename)
        outfile = os.path.join(OUT_DIR, filename)

        # this is not necessary because the ImageMagick library supports shrinking only
        # AND maintaining aspect ratio. all the logic is basically done.
        # the '>' in size_parm prevents making the image larger.
        # #get width and height
        # width = subprocess.check_output(['identify', '-format', '%w', filepath])
        # width = int(width.decode())

        # convert and print output
        subprocess.check_output(['convert', infile, '-verbose', '-resize', size_parm, outfile])

         
if __name__ == '__main__':
    main()

Categories
Open Source

Multiple WordPress Blogs

I’ve effectively created multiple blogs by using post categories.

Full credit to this tutorial.

Categories
Open Source

I Have a Website

I am genuinely excited to have a page all about myself!

Look forward to updates on the underlying technologies and infrastructure that drive the site.

I also plan to post updates about anything interesting and fun going on in my life.