Categories
Ireland

The Glorious Twelfth

Tim and Naomi of the Irish Passport Podcast visited Northern Ireland in July to experience the marching season in all it’s “glory” for their latest episode.

It’s a great episode, showing the stark contrast between the neighbourly and friendly people they met during the day on the 11th, and the hate fuelled crowd who descended on the area that night for the bonfire.

You’ll find lots of images of the bonfires that night on Google Images but this Dailymail article (yes, yes, I know) has lots of images and reporting.

I visited Northern Ireland in the summer and really enjoyed myself there. The people we met were friendly and welcoming but it was well past the marching season. Hopefully I’ll write a post about that sometime.

Categories
C64

Jedininja

Sometimes you accidentally dive down a rabbit hole of your own making.
I came across the Retro Computer Scene search engine a few days ago and  accidentally clicked on a link to a Commodore 64 disk image. Those files are small at 175KB so I decided to keep it and look at it later.

This morning I did and found Noice Driver v3.0a, a music disk for the Commodore 64 released in 1993. There are some great tunes on there but the name JEDININJA leapt out at me. It’s a good tune too!

The filename of the disk image is sb130978-1fbef9.d64 so I guessed it might have something to do with Scene Base. I downloaded their metadata list and found it there in the c64disk set!

You can find JEDININJA on csdb and a later version of the music disk there too: Noice Driver V3.8c.

It’s quite amazing the amount of digital history that’s out there. I’m only scratching the surface.

Categories
Apple

High Sierra and coreutils

Since MacOS High Sierra has been out for a long time this is probably old news to the tiny minority using coreutils. When you upgrade you might find that “df” and other commands don’t work properly.

Every time I opened a terminal after upgrading I saw errors saying commands had been aborted. When I ran “df” it would abort immediately.

I thought the upgrade had damaged my filesystem, especially since it introduced APFS. I ran “First Aid” in Disk Utility several times, both live and in recovery.

It then occurred to me to try the MacOS df in /bin/. It worked!

Coreutils is the package that includes lots of command line tools like “df”. I installed it using brew so the following fixed the problem:

brew reinstall coreutils

I noticed it put everything in /usr/local where my original commands were in /opt/ so changing the PATH in my .zshrc was necessary too. Everything was back to normal again! 🙂

EDIT: Some other commands were messed up. “find” had changed, but then I realised it probably isn’t in coreutils and I was using the MacOS version. This page led me to the right package names and the following command line:

brew reinstall coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt --with-default-names

The “–with-default-names” parameter restores the original filenames, removing the “g” prefix. Everything outside of the coreutils went in /usr/local/bin/ which I made sure was added to the path too.

Categories
C64

My Favourite C64 Intro Music

The version of Super Snake Simulator I used to play on the C64 was a cracked version by The Wanderer Group. I loved the game but the music in the intro was an infectious tune.

Listening to it in a Youtube video doesn’t have quite the same impact. It cuts off a bit too early as well. Perhaps rose tinted glasses and all that? It does  bring back memories of typing “left arrow” L to load games from a tape and “Turbo Tape by Jeff”, the tape loader used to pack more games on to one cassette. Piracy was rife on the C64, but I still have a box of (original) game cassettes and disks in the attic.

Want to hear the original “Wanderer”? It was originally recorded in 1961 and reached no 2 in the US charts!

Super Snake Simulator itself was a lot of fun too. It’s still worth checking out!

Lots of C64 Intros

Categories
C64

Vice – autostart with a directory

Vice, the Commodore 64 emulator is a cross platform emulator that works on Windows, Linux, MacOS and other operating systems. It also allows you to emulate the Vic 20, C128 and other early Commodore machines.

Double clicking on a Commodore d64 disk image file will load x64, the Commodore 64 emulator and load the first programme on the disk image.

LOAD”*”,8,1

Quite often I want to look at a D64 image directory listing instead of running the first programme on the disk.

You can do this by unchecking the “autostart” box on the file open box of course but it’s not as convenient.

So, last Friday I asked on Twitter if it was possible to drag and drop a D64 image onto Vice to display the disk contents. Logiker replied and helped me by DM to handle double clicking on a C64 disk image.

What I needed to do was load the disk image and then feed the directory listing command to the C64.

LOAD"$",8
LIST
LOAD”$”,8

Getting MacOS to accept the command line was harder to achieve. In Windows you can change the start up parameters for a programme. In MacOS it should be possible to modify the emulator “package” with a script that calls the real executable but I couldn’t get that working.
In Linux I would have just created a shell script that called the emulator. 🙂

What did work in MacOS was using Automator. I created a “Run Shell Script” action and filled it in with the following. If you want to follow along at home you’ll have to change the path to x64.


/Applications/Vice64/x64.app/Contents/MacOS/x64 -8 "$@" -keybuf load\\"$\\",8\\nlist\\n

I saved that as a new app in ~/bin/ called “Vice64”, and associated all D64 images with that application. Now double clicking on a disk image shows me a directory listing!

It doesn’t work unfortunately when I have an Action Replay cartridge loaded. Maybe I need to add F3 or F7 to the keyboard buffer?

One of the advantages of looking at the directory structure is the directory art some demos have. Here’s one from Pearls for Pigs, a D64 I happened to use while testing this but there are loads of them. I saw that Logiker has a page dedicated to directory art!

Happy times! 🙂

Categories
WordPress

WP Super Cache 1.6.3

WP Super Cache is a full page caching plugin for WordPress. When a page is cached almost all of WordPress is skipped and the page is sent to the browser with the minimum amount of code executed. This makes the page load much faster.

1.6.3 is the latest release and is mostly a bugfix release but it also adds some new features.

  • Added cookie helper functions (#580)
  • Added plugin helper functions (#574)
  • Added actions to modify cookie and plugin lists. (#582)
  • Really disable garbage collection when timeout = 0 (#571)
  • Added warnings about DISABLE_WP_CRON (#575)
  • Don’t clean expired cache files after preload if garbage collection is disabled (#572)
  • On preload, if deleting a post don’t delete the sub directories if it’s the homepage. (#573)
  • Fix generation of semaphores when using WP CLI (#576)
  • Fix deleting from the admin bar (#578)
  • Avoid a strpos() warning. (#579)
  • Improve deleting of cache in edit/delete/publish actions (#577)
  • Fixes to headers code (#496)

This release makes it much easier for plugin developers to interact with WP Super Cache. In the past a file had to be placed in the “WP Super Cache plugins directory” so that it would be loaded correctly but in this release I’ve added new actions that will allow you to load code from other directories too.

Use the wpsc_add_plugin action to add your plugin to a list loaded by WP Super Cache. Use it like this:

do_action( 'wpsc_add_plugin', WP_PLUGIN_DIR . '/wpsc.php' )

You can give it the full path, with or without ABSPATH. Use it after “init”. It only needs to be called once, but duplicates will not be stored.

In a similar fashion, use wpsc_delete_plugin to remove a plugin.

The release also makes it much simpler to modify the cookies used by WP Super Cache to identify “known users”. This is useful to identify particular types of pages such as translated pages that should only be shown to certain users. For example, visitors who have the English cookie will be shown cached pages in English. The German cookie will fetch German cached pages. The action wpsc_add_cookie makes this possible.

do_action( 'wpsc_add_cookie', 'language' );

Execute that in your plugin and WP Super Cache will watch out for the language cookie. The plugin will use the cookie name and value in determining what cached page to display. So “language = irish” will show a different page to “language = french”.

Use wpsc_delete_cookie to remove a cookie. Cache files won’t be deleted. It’s doubtful they’d be served however because of the hashed key used to name the filenames.

do_action( 'wpsc_delete_cookie', 'language' );

If you’re going to use either of the plugin or cookie actions here I recommend using Simple Caching. While the plugin will attempt to update mod_rewrite rules, it is much simpler to have PHP serve the files. Apart from that, any plugins loaded by WP Super Cache will be completely skipped if Expert mode is enabled.

Categories
tv

Remember when Miley and Fidelma rolled in the hay?

That was 1998!

The Reeling in the Years for 2016 will be an eye-opener, but I bet 2019 will be even crazier.

Categories
WordPress

WP Super Cache and Cookie Banners

EDIT: Updated for WP Super Cache 1.6.3 and newer.

More sites use cookie banners now that the GDPR is active but some are finding that their banners are misbehaving once they enable caching.

This is a similar issue to the one that happened to some page counter plugins in the past. The page counter wouldn’t increment.

When a cookie banner is clicked a cookie is set in the browser so the website knows this visitor has agreed to accept cookies. If the cookie is set then the cookie banner html is not sent to the browser.

I suspect the main issue is that the code that sets and checks if the cookie is set is PHP. Unfortunately because the page is cached then no PHP code is executed, and the cookie banner is displayed because it was originally cached that way.

Since WP Super Cache only knows about certain WordPress cookies it assumes everyone who doesn’t have those cookies is a first time “anonymous” visitor. It doesn’t know about your cookie banner cookie.

You have two options:

  1. Rewrite your cookie banner so it’s completely in Javascript. Do the cookie detection in Javascript and also set the cookie in Javascript. If the cookie banner has been clicked then you need to trigger an action, and other Javascript that is hooked on to that trigger will run and load the tracking cookies.
  2. Modify WP Super Cache so it knows about the cookie your cookie banner uses. Caching won’t work quite as well as before as it’ll be split between visitors who have clicked the cookie banner and those that haven’t. One cached file will display the cookie banner, and the other will not but it will have ad tracking Javascript.

Using Javascript completely is a better solution because it runs in the browser on every page load but that might not be possible every time.

Otherwise, use PHP to get WP Super Cache to play nicely with your existing code. You basically need to run do_action( 'wpsc_add_cookie', 'cookie_name' ); after init so WP Super Cache adds the cookie name to it’s cookie list. This only needs to be done once but you can leave it run all the time because it will only ever add the cookie name once. This also ensures the name is added again if the WP Super Cache configuration file is ever reset or deleted.

  1. Create a PHP script in wp-content/mu-plugins/ (or in to your own plugin).
  2. Add the cookie by using the wpsc_add_cookie action in a function that loads on “init”.
  3. Reload any uncached page and the cookie name will be added to the cookie list.
  4. Caching can only be performed by simple caching now, unless you’re willing to edit mod_rewrite rules in your .htaccess file.
/*
 * Tell WP Super Cache to cache requests with the cookie "eucookie" separately
 * from other visitors.
 */
function add_wpsc_cookie_banner() {
    do_action( 'wpsc_add_cookie', 'eucookie' );
}
add_action( 'init', 'add_wpsc_cookie_banner' );

Substitute the name of the cookie (eucookie) for your cookie name.

When your plugin is uninstalled it should remove your cookie with the following:

do_action( 'wpsc_delete_cookie', 'eucookie' );

For future reference, since cookie banners will hopefully not be around forever, here’s what they looked like in the deep, distant past of 2018. 🙂

The LA Times just gave up and don’t show anything to EU visitors.
Categories
Podcasts

The Supernova in the East

The latest episode of Hardcore History is another amazing audio tour through history, even if Dan Carlin himself says he is unqualified and it might not be completely accurate. He’s a great story teller. This one covers the rise of Japan in the early twentieth century and beyond.

Dan’s coverage of the Manchurian Incident reminded me I have to re-read the Tintin story, “The Blue Lotus“. Hergé definitely applied his imagination when recounting how the train track was blown up but I’d never have known about that period of time if I had never read that book.

And similarly, I wouldn’t have known the railway track was barely damaged if I hadn’t listened to Hardcore History!

Categories
Android

My S7Edge gets the April Update

My Samsung Galaxy S7 Edge is now installing the April 1st update. It got Oreo a few months back and a few updates since. Going by Samsung’s track record I expect those updates to dry up any time soon but it’s good to see them still handing out any sort of updates.

In case you’re wondering, this is the unlocked international variant.

Version installed: G935FXXU2EREM/G935FOXA2EREM/G935FXXU2ERD6