Skip to main content

Posts

Showing posts from June, 2020

Quickly create a gallery of images from a list in vim

This is something I run into pretty often, so I thought I'd share how I handle it, in case it's helpful. Sometimes you have a list of image files, and you need to create the html formatting to make them into a gallery of some sort. Imagine each file has two versions, a full size and a thumbnail image. Pretty common scenario. The URL for the files will look like /images/gallery/full/[filename] and /images/gallery/thumb/[filename] There's lots of ways to do this, here's what works well for me. First I grab a list of the files from the command line, ending up with something like this ls -l -rwxrwxrwx 1 user group 388044 May 25 11:16 IMG_20161205_120541.jpg -rwxrwxrwx 1 user group 451788 May 25 11:16 IMG_20161215_114201.jpg -rwxrwxrwx 1 user group 298125 May 25 11:16 IMG_20161216_121618.jpg -rwxrwxrwx 1 user group 369981 May 25 11:16 IMG_20161216_125940.jpg -rwxrwxrwx 1 user group 479464 May 25 11:16 IMG_20161216_131010.jpg -rwxrwxrwx 1 user group 664528 May 25 11:16 IMG_20...

Setting up a simple LAMP stack in WSL/Ubuntu

As I've mentioned before, I've been running WSL (Windows Subsystem for Linux) for roughly a year now. It's still a little mind-blowing to me - when I got started Microsoft was about as anti-linux as can be. Weird times! Anyways, I have a fairly simple setup right now that's been working well for me. I'm using an older version of WSL right now, and apparently the newer version is much faster - but this works well enough for my needs right now. This guide assumes you already have WSL set up and working, and can get a bash command line... Install Apache and MySQL This is easy, just run: sudo apt install apache2 and sudo apt install mysql-server and while you're at it, you can start them up: sudo service apache2 start sudo service mysql start You may run into some weird issues - I used this guide if you need any other info. Now you have the most basic bits set up, it's time to get your actual sites up and running locally! Setting up your projec...