Was trying to copy a few sheets in the writing application Ulysses to the clipboard. I found what to do but it is confusing. You think the normal copy function would work by selecting multiple sheets:

Copy doesn't work like you would think here.
Copy doesn’t work like you would think here.

But it results in the following when pasting…

ulysses://x-callback-url/open?id=W3qZJyl-Npi55m4SlsCwHA
ulysses://x-callback-url/open?id=w2dUH4mafDX5PXWm0mKeqQ
ulysses://x-callback-url/open?id=eRznbiOJJOuj7RUgQKSNkA

Instead I found that if you try to share the sheets as if you were publishing them you have an option to copy to the clipboard:

The "A" graphic here stands for "Copy to Clipboard"
The “A” graphic here stands for “Copy to Clipboard”

The “A” icon in the above screen shot is the option you should use to get the contents of multiple Ulysses sheets in to the clipboard. You can choose the format in the format section so that you don’t have to take the text as Markdown.

After clicking the icon in the share sheet just switch to another app and paste the text.

The Hong Kong government needs to start to welcome these companies with arms more open than Singapore. It is embarrassing that Taxi’s in Shenzhen have eschewed cash for WeChat pay while in Hong Kong we are expected to pay in bills. How about some reform that helps balance the change to the taxi industry while giving it a kick in the pants so when the Chinese tourists come back Hong Kong meets their digital expectations.

Uber eyes headquarters move to Hong Kong – provided city first changes regulations to legalise service: source | South China Morning Post:

“There is a real demand for ride-hailing services. The government should relax the regulatory regime to allow Uber to legally operate in Hong Kong. But it should also find ways to assuage the discontent of the taxi sector. For example, it could require Uber to pay a tax and make other requirements ,while providing some form of subsidies for taxis to offset their loss of income.”

If you have a situation where your website is down or there is some problem, you can let the world know on every page by using a rewrite rule.

I had to enable mod_rewrite to get this to work. This meant in my version of apache I needed to move the file “rewrite.load” into the active module directory and restart apache.

sudo mv /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
sudo apache2ctl restart

Once the rewrite engine was working we could do more complex redirects with regular expressions like this.

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/websitedown.html
RewriteRule ^ /websitedown.html [R=302]

You can get a little more complex with regular expressions. This excludes everything under the bundles directory if you need a place to store some CSS or images for your Website down page.

RewriteCond %{REQUEST_URI} !/bundles/.+

The above code can be put in /etc/apache2/sites-available/000-default.conf which was the default on my new server. After saving run the command to restart apache:

 sudo apache2ctl restart

The above rule looks for all requests that are not going to websitedown.html and then sends a 302 redirect to the same file. This allows to pass thru the request for just that file. We use 302 because this is a temporary situation and we don’t want google to get confused.

Once we fix this situation we will remove this redirect.

Resources For Redirecting

Yesterday I gave a presentation at the online PyCon conference. This is an online conference for Python programmers. I am working on migrating ShenzhenParty.com content to WordPress.

Topics covered:

  • Useful Python Libraries for performing these tasks
  • Retrieving posts information from the old CMS with REST API
  • Writing Post data to a CSV
  • Setting up Python Google Sheets Access
  • Matching data in Google Sheets and Updating Google Sheets
  • Creating posts in WordPress with the Application Password Plugin
  • Searching WordPress posts by slug

Watch the video of the talk:

Video presentation of content migration tips with Python

PyCon Presentation Page and Slides Download

When I found some old CDs from college I tried to read them in Mac OS X Catalina and was shown an error message. You can read the investigation I went through on the previous linked post.

My friend suggested I try to mount the CDs in a virtual machine so that that started me down a new rabbit hole.

To sum up Apple dropped support for reading HFS in Catalina.

I knew that Parallels could do Mac OS X virtual machines so I thought it would be simple to create.

Turned out to be more complex than I thought and took a lot of google searches so let me try to summarize here.

First Parallels can install but it needs the original installer. Lots of articles tell you to get the older operating installer from your purchase history but if you are on a brand new MacBook Pro 16 inch those old installers won’t show up because your computer doesn’t support them.

It turns out that Apple has a TechNote for most of the older operating systems. I chose the TechNote for macOS Sierra: How to upgrade to macOS Sierra. You will find a download link for an installer around step 4.

Download the disk image using the download link on this step
Download the disk image using the download link on this step

Once you have this on your drive there is still more to do.

In Parallels go to File > New.. to bring up the installation assistant. Originally I tried to find this disk image from the option “Install Windows or another OS from a DVD or image file” but that didn’t work.

The image file you just downloaded can't be recognized with the middle option.
The image file you just downloaded can’t be recognized with the middle option.

Parallels had a support document on installing Mojave that for some reason I didn’t quite understand so one support email later I had clarity on what needed to be done.

You want to scroll all the way to the right on the below screen:

Start by installing macOS Catalina off a recovery partion.
Start by installing macOS Catalina off a recovery partion.

First you need to create a virtual machine based off of Catalina. This is just a temporary virtual machine that allows you to get to the older operating system installer.

Go through the motions of setting up the Catalina operating system.
Go through the motions of setting up the Catalina operating system.

Once you setup the Catalina virtual machine you have to install the “Parallels Tools” on the Catalina operating system. That takes place from the Actions menu. The VM will be restarted and you can then see shared folders between your real Mac and the VM.

Then it is best to quote directly from the tech support email because this is what gave me the lightbulb moment:

  1. Transfer the installmacosx.dmg to the new virtual machine that is created.
  2. Open installmacosx.dmg and run the .pkg file inside the virtual machine.
  3. Once the installation finishes, the app file will be generated in the virtual machine’s Applications folder.
  4. Move the .app file to the Documents folder of your Mac and run Parallels Desktop Installation Assistant. The installation .app will be recognized automatically and you will be able to proceed with creation of virtual machine.

To sum up the above you just want to use the temporary Catalina virtual Machine to run the installer. Once you get the OS installer application you can drag it back to your real Mac using the Parallels shared folders.

Installer extraction completed
Installer extraction completed

Now you create a new virtual machine all over again but this time you can choose the “Install Windows or another OS from a DVD or image file” and it will find the installer.

Parallels automatically recognizes the installer.
Parallels automatically recognizes the installer.

Now just go through the process of installing a Mac virtual machine.

Link your VM to the physical CD reader

Once I just made sure that the CD reader was linked to the Virtual Machine, I was able to copy my files to a folder and enjoy some old college memories of long forgotten documents.

I was trying to mount some old HFS formatted CDs from college and found out that they don’t mount on Mac OS Catalina from this thread.

I was getting the following error:

Could not mount CD. (com.apple.DiskManagement.disenter error 49153.)
Could not mount CD. (com.apple.DiskManagement.disenter error 49153.)

I opened terminal and ran the command

diskutil list

This confirmed the CD was formatted as HFS which is now deprecated in Mac OS Catalina.

Luckily I found an article that documents this very error. So it was off to try to install HomeBrew.

From that post I ran:

brew install hfsutils

Getting a list of disks in the CD-ROM drive went like this:

diskutil list

Then it was time to mount the disk. I had to make sure that I mounted “disk2s1s2”

Apple_HFS Disk 1 (System Folder) 666.2 MB disk2s1s2

Make sure to select the right partition on the CD:

sudo hmount /dev/disk2s1s2

This will give you a list of items on the disk:

sudo hls

I wanted to just copy everything so I created a new directory in my home folder to hold the contents of the disk

cd ~
mkdir "Disks"
cd Disks
mkdir "PB HD Disk 1"
cd "PB HD Disk 1"
sudo hcopy -r ":*" ./ 

After you copy files don’t forget to unmount

sudo humount

A big limitation: not able to copy directories

It turns out when you do this it doesn’t copy folders so I don’t see a way to copy everything off the disk onto another one. So these techniques all work for one or two files but not for slurping everything onto one of your hard drives.

If you know how to copy all the items from a disk mounted by hfsutils please tweet me.

In the meantime I think I am going to try to install Mavericks on my Mac mini and see if I can us HFS there.

Resources

Took a look at the best routes to get to Hike on Dragon’s Back because I wanted to end up in Shek-O beach. Turns out that the Hike actually ends up at Big Wave Bay. Still it is close enough to Shek-O.

The resources I used for my research turned out tho be an article on Hong Kong Cheapo. Some of the most beautiful photos and drone footage came from Drone and DSLR.

To really plan my route from my home I checked CityMapper from SaiyingPun to To Tei Wan.

Now I’m prepared and looking forward ot the hike.

I tried to create a Git repository in a new git hub organization. It was a private repository and when I tried to clone the repository to my local I got the error “remote: Repository not found.”

This happened in both the Git Tower client along with the command line client.

Trying to Google the error found a GitHub faq and an article. These seemed to be some of the reasons:

  • You did not authenticate
  • Your password has changed
  • You are not a collaborator
  • Incorrect case or a word misspelled
  • The git repository has been deleted

Jeff Geerling seemed to have a similar problem but his solution didn’t apply to me. There was also of course a question on StackOverflow.

Since I was copying and pasting the clone link from Github, the repository must be named correctly. I had not previously cloned this repository however I had linked it to Netlifly.

I created the repository and the team so I definitely was a collaborator but I added myself anyway again under managed access.

I have no problem logging into Github with 2FA and cloning repositories from my personal GitHub account so this was not the problem.

So the only one of the possibilities above seemed to be an authentication error. Based on the GitHub FAQ article I setup and verified my SSH keys.

The responses on StackOverflow suggested to remove my entries in my Mac Keychain related to GitHub and so I did. I even deleted my account from Tower and I deleted my Personal Access Token from Github.

After trying all the authentication suggestions in the stackoverflow article I am still stuck if you have an idea please tweet me.

Just bought a new MacBook Pro 16 inch and when I was trying to transfer files over from my previous Catalina MacBook Pro, I wanted to create a direct connection. There is a way to put your computer into Target disk mode if you have a thunderbolt 3 USB-C cable.

I held down the “T” key when I started up the old computer and then plugged in the Thunderbolt 3 USB-C cable.

You can also use the startup disk control panel to enable this.

No Permission to access my Documents folder

Though I was able to navigate to my home folder and documents folder on the other computer, I was denied access.

Tried reaching the internet for an answer but nothing came up so thought I would write this post on how to get yourself access to these folders.

My first instinct was to use the Get Info command on the folder. When I did that the obvious thing was to change the “everyone” name access to “Read & Write”.

This didn’t work nothing changed. Wanted to jump to the command line to fix this but after going for a walk I realized I hadn’t tried clicking the the plus button below the Sharing and Permissions section.

Once I authenticated as an admin user and then click the “+” button, a dialog box came up to ask me to assign a user.

Just select the user on your current computer. Another line will be created in the Sharing and Permissions section.

A new line will be created with your username of your computer and you can change the kind of access from read only to write access.

Now if you look at the screen shot above you will see the “Do Not Enter” visual is removed from the icon and if you double click on the folder you can open it no problem. Your access control lists (ACL) are all setup and you may copy any files you want.