Bulk Rename on SSH (FTP)

Really simple one, I need to bulk ‘find and replace’ a number of files within a folder, SSH connection with Terminal.app on OSX.

Example below searches for ‘that’ and replaces all instances with ‘this’.

for file in file_is_something_like_that*.jpg; do
mv "$file" "${file//that/this}"
done

Run that command and immediately the files are renamed.

Hardy Brothers of Alnwick – List of Fishing Rods

‘Principle Rivers of Scotland’, via world-of-art-prints.com

I’ve been looking into buying my first split cane fishing rod. During the research I found this handy list (down the back of the internet’s sofa). Thought it worth sharing as its not currently available elsewhere.

It lists a number of fishing rods produced between 1885-1984 by Hardy of Alnwick. Maybe this will be helpful to someone out there.

Download the PDF list here. Or continue to This Page to view the list in your browser. I’m afraid I don’t know the original source of this list, I cannot vouch for its integrity. Though the rod I am keen to own ‘The Fairy Rod’ is correctly listed along with some others I have seen listed online.

(more…)

Google Product Feed : Featured

Here’s a script for ‘Google Product Feed‘ by Ademti Software which allows you to subdivide a large feed (for later use in Google Ads) by the ‘featured’ option in Woocommerce. If the product is ‘featured’ then ‘custom_label_0’ will be populated with: ‘featured’. I thought it was worth sharing.

function lw_woocommerce_gpf_edit_custom_label_featured( $elements, $product_id, $variation_id = null ) {
if ( ! is_null( $variation_id ) ) {
$id = $variation_id;
} else {
$id = $product_id;
}
$featured_product_ids = wc_get_featured_product_ids();
if ( in_array( $id, $featured_product_ids ) ) {
$elements['custom_label_0'] = array( 'featured' );
} else {
$elements['custom_label_0'] = array( 'not_featured' );
}
return $elements;
}
add_filter( 'woocommerce_gpf_elements', 'lw_woocommerce_gpf_edit_custom_label_featured', 11, 3 );

Skye Ferry BBQ & Fundraiser

On behalf of my fellow trustees of the Glenachulish Preservation Trust I would like to invite everyone to a fundraising BBQ on September 25th at 1PM.

At the Christopher Main Shore Station, The Original Glenelg-Skye Ferry.

Where the National Transport Trust will unveil a ‘Red Wheel’ in recognition of the importance of the Kylerhea Narrows crossing and the last manually operated turntable ferry IN THE WORLD – the M.V. Glenachulish. You’ll also have the opportunity to see our new information boards describing the history of the crossing and the importance of the Skye Ferry. Designed (with love) by yours truly!

Drop-Print.com } Update Etsy from CSV

Today, I want to introduce a nifty tool that’s been a game-changer for my Etsy shop: Drop-Edit. Picture this: managing your Etsy listings as effortlessly as tweaking a spreadsheet. That’s the magic of Drop-Edit. With just a CSV file, I can now oversee hundreds, theoretically thousands, of listings in my Etsy Shop. It’s like having a command center where I can tweak details, bulk edit, upload images, or switch up tags. It now handles bulk editing Etsy Listings for digital downloads.

The process is straightforward and efficient – a simple ‘Update on Etsy’ button links the tool to the Etsy API and, bingo, with my permission, it syncs with my Etsy shop. The instant updates are a huge time-saver.

And there’s more! This weekend, Drop-Edit (which is a subscription service) rolled out a brilliant new feature. Not only does it support Etsy>CSV, which is a lifesaver in itself, but now it also allows for bulk updating of digital downloads. Imagine the hassle saved! I managed to create and organize over 200 digital download listings on Etsy, seamlessly placing each digital item in its listing. Without Drop-Edit, this would have been a Herculean task, devouring time and patience.

Drop-Edit: drop-print.com/etsy/

(more…)

Move WordPress Uploads Out of WordPress Directory

Here’s a simple one (which took me many hours to correctly configure). This little script, inserted into a custom plugin or functions.php in a child-theme will allow you to move your uploads folder out of the WordPress directory. Keeps things neat and tidy for my purposes.

Currently I have wordpress in its own directory, ie. website.com/wordpress/

Now assume publicly facing url is website.com, that makes my uploads website.com/wordpress/wp-content/uploads – a terribly unprofessional looking URL.

With this code you can move the uploads directory to the top folder. Be sure to move the files, or use Better Search and Replace to change your DB if required.

add_filter(
'upload_dir',
function ($dirs) {
$new_upload_dir = '/home/domains/website.com/public_html/uploads';
$new_baseurl = 'https://website.com/uploads';
$dirs['path'] = $new_upload_dir . $dirs['subdir'];
$dirs['basedir'] = $new_upload_dir;
$dirs['baseurl'] = $new_baseurl;
$dirs['url'] = $new_baseurl;
return $dirs;
},
15 // default is usually 10
);

Note: you’ll need to work out where ‘$new_upload_dir’ with some detective work of your own. Good luck!

Filter Insta Results by tag w/ Social Feed Gallery

Occasionally I build websites for folks. Recently I’ve been replacing stale old static galleries with a slim WordPress plugin that sync’s a users’ feed to a local cache and formats it in a nice way for the visitor. Its easier to update for the client (if they have a smartphone) and the visitor doesn’t need to be ab Instagram user or have any knowledge of that site to view.

The plugin I use is Social Feed Gallery by Quadlayers. It breaks less than other plugins I’ve used in the past, most of the time it isn’t their fault. Instagram’s API seems to chop-and-change.

Anyway- this isn’t an advert. If you want to display a selection of your Instagram images on your WordPress website but you’d like to filter out certain images (I do this by way of a hashtag #nosync ) then add this script to your CSS:

[data-item*="no-sync"] {display: none!important;}

Remember to tag the relevant items #no-sync, then hit the ‘Cache’ refresh button in your Social Feed Gallery dashboard panel. As Steve would have said *boom*. Discovered this solution at Stack Exchange, full of helpful humans who still beat AI!

Snow falling heavily on the sea, the broom and my Volvo. Glenelg, Highlands. March 2023.

FTP Transfer using SSH

Yesterday I learned how to migrate to a new web host in a very satisfyingly geeky way. If you are on Mac OS open up Terminal (enable the Homebrew theme) dim the lights, or block them out if possible, stick on the Matrix Soundtrack from 1998 and prepare to login to SSH! Its command line and slightly overwhelming.

SSH gives a user access to a remote machine so you can run commands on that server… as if you were in the room. Like scren sharing in the command line. When migrating loads of files from one remote place to another this is great as it saves us a step. Rather than transferring gigabytes of data from one remote server to our local machine to then forward on to another remote machine we just login and get the two remote machines to sort it out between themselves. Up here in the Scottish Highlands I’m on a community owned broadband network and I’m almost certain our local internet guru would have something to say about 100’s of gigabytes flying around so that was my reason for stumbling upon this magic code.
(more…)

Introduction

Part of my first iBlog from twenty years ago.

Hello. It has been a while. I’m sitting at my screen waiting for files to migrate to a new server. Snow is falling outside and its covered the garden and the fields immediately opposite, a few hungry sheep are staring in the front. I can’t do ‘work’ as everything is metaphorically up in the air. What a good opportunity, I thought, to reinstate my blog. My name is Callum and I’m an internet user like you.

I made my first webpage using Microsoft FrontPage in 1998 with help from our formidable music teacher Mr. Carr. He was the first real life computer geek I ever met and although I had an inkling that I might like meddling with the internet he was instrumental in actually showing me how to log-on and get with it. I was 12 years old and it was during our School‘s ‘three day event’ when classmates could opt for mountaineering, horse riding, extra rugby or an educative trip that I chose to sit in front of a computer screen. Mr. Carr gave us a basic introduction to FrontPage’s WYSIWYG interface and then in a very hands-off way, let us get to it. He quietly sat behind a bank of monitors and punched away at the keyboard, no doubt updating the school’s website, offering limited design advise from time-to-time and outlining the process of publishing to a server. At the end of 72 hours I had published my first webpage online. The webpage was #ca0000 red and had a visit counter, that’s all I remember.

It was that summer that our family upgraded from a Macintosh IIGS to an internet-ready windows desktop. It was shaped like a stumpy, beige rocket. I cried real tears in the computer shop as they also stocked the brand new iMac in its delicious semi-transparent flavours, the sales person advised my parents’ that Apple was obsolete, where is he now? Nevertheless I was obviously very lucky that my parents splashed out on a multimedia PC, built in speakers, CD-ROM and wonderful dial-up capability. Wonderfully annoying dial-up; I can still hear my mother screaming from down the stairs, finding time-and-time-again the line engaged as I’d logged-on to update Encarta, download 4MB film trailers or surf altavista.com. I would continue to update my website too, picking up a little CSS and HTML along the way for the next five years. With my second paycheque I would buy a (already a modern classic) Bondi Blue iMac. My introduction to blogging was in 2003 with the software iBlog, later WordPress and the wonderful Kubrick theme by the ever helpful Michael Heilemann. His own blog was an inspiration and seemed to lead me into an internet of nice folk, people who cared and shared (mainly code and star wars). I sat in my bedroom in Aberdeenshire behind a bank of monitors, still living with my parents, published a plugin for WordPress (Starred Review), wrote film reviews and posted hundreds of photographs of me and my pals doing silly things. Now I feel nostalgic. 

Back to today, migration complete. I’ve been using SSH to connect to my old host via FTP and despite occasional network outages today in the frozen Highlands of Scotland it has been a success. Back to work. I’ll just write a quick introduction here. The snowing has ceased here, its a winter wonderland outside. Across on Skye I can almost distinguish the mountains behind more incoming white.

With this new iteration of my weblog I intend to write in a personal way about where my real life intersects with things I do here at the computer. The title of my previous blog was Meta Comment, expect more of the same. Here I’ll occasionally dump some code, link to something I think is clever, share some photography (which I create but ironically never print) and talk about myself. Welcome to my website.