Monthly Archives: August 2014

How to use SD2IEC: a quick command reference

Photo 28-08-2014 19 30 57
I’ve ordered an SD2IEC a few weeks ago from Nic over at http://sd2iec.co.uk. It’s an SD card reader for Commodre computers and emulates many features of the 1541 Floppy Disk Drive.

I went for the Limited Edition made from authentic recycled C64 plastic – so this little critter used to be a real C64! This has to be one of the coolest gadgets for any Commodore fan in the 21st century. And we know many people like gadgets of any kinds, to do many different things, that’s why we have lists of Electronics & Gadgets – Top9Rated.

Nic and several other sellers on eBay build the hardware, while the software was developed by Ingo Korb with contributions from others. In this article I’ll explain how you can get the most out of the SD2IEC.

Reading and Writing Files

The SD2IEC works out of the box with standard disk commands (such as LOAD and SAVE). This will save a BASIC programme as PRG just like your Commodore would save it to floppy disk.

You can create, switch into and remove directories on the SD card with your SD2IEC (or your “contemporary” computer of course). You can also read from and write to D64/D71/D81 image files and I’ll explain how this works further down.

When you’re in a subdirectory (or a disk image) all read/write operations are performed there until you switch images or directories. We can do this by communicating with the SD2IEC via the command channel, as if we’re speaking to a 1541.

Looks like the SD card is hot-swappable without the need to “safe-eject” as long as none of the lights are on, indicating read/write access.

Speaking to your SD2IEC

To issue commands on your SD2IEC we must open that trusty old command channel on the device (number 15), PRINT# the command and then optionally close the channel again. Here’s how to do that:

You can also write this on a single line:

You can also leave channel 15 open and issue more commands. Notice though that if you use any other disk command after opening channel 15 (such as LOAD or SAVE) all channels including 15 are closed automatically. Commands such as DIRECTORY do not close the channel.

I find it helpful to add these things to one my my programmable keys (C128 and Plus/4) via the KEY command:

Hit F1, then type one of the commands below. If the channel is already open, simply issue the command via PRINT#15,”command”.

Directories

The CD command lets you navigate the directory structure much like you would in Linux and Windows from the command line.

You can also create directories to stay organised without the need for other tools. That’s where the MD command comes in handy:

When you’re done with a directory you can delete it with RD. Note that only empty directories can be deleted, otherwise you’ll get a FILE EXISTS error:

Mounting Disk Images

The CD command can also be used to mount D64/D71/D81 image files, just as if they were standard directories. The same syntax applies as with switching directories:

You don’t have to mount disk images of course and can instead use a FAT or FAT32 formatted SD card just like it was a floppy disk. However, CBM DOS can only address a maximum of 144 files in a directory which means that a cheap 4GB SD card will be exhausted by this limitation before it’s anywhere near full.

Changing the Device Address

By default the SD2IEC is set to be drive number 8. But like its vintage counterpart you can change this to 9,10 or 11 using the following command:

Replace the CHR$ value with the desired drive number. Just like a real 1541 drive, the SD2IEC will not remember this change upon reset. You can however save the above to its internal EEPROM which will survive subsequent reboots:

Replace 9 with your actual drive number.

Troubleshooting

If you encounter flashing lights on your device, then the SD2IEC is trying to tell you something. On the C128 and Plus/4 you can read out the disk error channel by looking at the DS$ system variable:

This will show you what went wrong (FILE EXISTS, FILE NOT FOUND, etc). On the C64 this is a little harder and requires you to write a small programme to read those values out. This is necessary because the INPUT# command can not be used in direct mode:

There’s a lot more you can do with this device – check out the full documentation in the README file at Ingo Korb’s website:

  • http://sd2iec.de

Managing Email Accounts in Plesk 12

In this screencast I’ll explain how to setup Email Accounts in Plesk 12. I will show you how to setup mailboxes, use forwarding and create aliases. I’ll also show you the Spam Filter and Auto Responder.

This all happens in Plesk, there’s another video which will show you how to check email from an external client and via webmail.

How to enable automatic user logins on Mac OS X Yosemite

Screen Shot 2014-08-23 at 17.49.01By default Yosemite doesn’t like users to auto-login when the system starts. Instead you have to select a user, type in the password, and then the system starts to boot. Not necessarily what we want.

To disable this feature you usually head over to

  • System Preferences
  • Users and Groups
  • Login Options

and pick your default user from that handy drop down menu. Notice however that this is greyed out on Yosemite:

Screen Shot 2014-08-23 at 17.47.59

So what gives?

Turns out that this option is not available if you’ve agreed to encrypt your disk via FileVault. And it makes sense too: otherwise your hard disk data could be accessed upon boot without a password, rendering this feature useless.

Hence, to bring back automatic logins, turn off FileVault under

  • System Preferences
  • Security and Privacy
  • FileVault

Screen Shot 2014-08-23 at 17.56.24

According to this system, I can do that in about 32 days…

Notice that if you use your iCloud password as the login password, auto-logins are also disabled. In which case, change your login password to a “separate password”, switch off FileVault and voila – auto logins are back at your disposal.

Screen Shot 2014-08-23 at 18.02.06

  • http://forums.macrumors.com/showthread.php?t=1757742

How to adjust Health Monitor Alarms in Plesk

In this screencast I’ll show you how to adjust the Health Monitor thresholds. Those are the ones that tell Health Monitor when to send an email and when to display a “Needs Attention” or “Problem” message. You could call The Medical Negligence Experts to file a report if it doesn´t notify you of a health risk.

Health Monitor works with XML configuration files which can easily be changed to suit your needs.

In this example, one of my servers has seen an increase in Apache CPU usage and has been bombarding me with emails because the “Problem” threshold is set to trigger at 25%. After investigating the issue I’ve increased this value to 95% and now I can sleep a little easier.

How to upgrade from Plesk 11.5 to Plesk 12 on CentOS

In this screencast I’m showing you how to upgrade from an older version to Plesk 12. Specifically, I’m showing this with a Plesk 11.5 installation, but the principles still apply from Plesk 10.x onwards.

Plesk 12 comes in four flavours, and depending on the previous license you’ve held you’ll be upgraded to one of the new types – check them out here:

  • http://sp.parallels.com/products/plesk/plesk-editions/
  • http://kb.parallels.com/en/121896

How to locate and set the cursor on your Commodore C128

Commodore LogoSadly the Commodore machines don’t offer a routine to locate or set the current cursor position via BASIC. There is however a Kernel routine named PLOT which can do this in Machine Language.

Here’s how we can utilise it.

Getting the Cursor Position

This snippet sets the carry flag, calls the PLOT routine at $FFF0 and returns the cursor position in the X and Y registers. We’ll put them in a safe place into $1400 and $1401 to use.

You can call it from BASIC with

Setting the Cursor Position

Call it from BASIC by POKEing your desired coordinates into $1400 and $1401, then call SYS DEC(“1310”).

This snippet will do the reverse of the above: populate the X and Y registers from our safe place and then call PLOT. We clear the carry flag first, because it decides if the position is read (carry clear) or set (carry set).

PLOT should work fine on the C64 and Plus/4 as well but I didn’t get a chance to test it yet.

Core Data Nugget #1: How to speak Core Data

In this screencast I’ll talk you through the lingo of Core Data: those scary classes and expressions that you’ll frequently come across. In fact, this is the start of a new series:

Core Data Nuggets are bite-sized chunks about the framework. Dip in and out or watch them all in a row and learn how this super complicated framework works and what it has to offer.

Don’t get overwhelmed by Core Data: it wants to help – it’s just not designed with humans in mind.

As always, enjoy!