“dotnet: command not found” after installing the Microsoft .NET Core SDK on a Mac

This content is 7 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Whilst installing the Microsoft .NET Core SDK on my MacBook earlier last week, I found that the instructions on the Microsoft website were not quite complete.

Microsoft tells us to run a few commands to install OpenSSL:

  1. Install Homebrew (it was already on my system)
  2. Then run:

brew update
brew install openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/

After this, you should be able to download and install the .NET Core SDK package (version 1.0.4 seems to be the latest version of the SDK at the time of writing, which includes .NET Core 1.0 and 1.1).

Then, in theory, running the dotnet command should be all that’s required but, for me, it resulted in an error:

-bash: dotnet: command not found

The fix, it seems, is to create another symbolic link:

ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

After that, dotnet ran as expected.

For reference, My MacBook is running MacOS Sierra version 0.12.5 (16F73).

Restoring Adobe Lightroom from backup (on a Mac)

This content is 8 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

For well over a year now, my digital photography workflow has been in tatters. The Mac that I use for photo editing had some defective memory which corrupted the file system and the “genius” at the Apple Store reinstalled OS X. Data and application re-installation relies on me though, and it just hasn’t risen high enough on my list of priorities… until now.

So, I needed to:

  1. Re-install Adobe Lightroom (and the various other tools that I use).
  2. Restore my Lightroom catalog.
  3. Repoint Lightroom to the new location of my images (I’ve given up trying to maintain enough space locally and they all now sit on a Synology NAS, backed up to Microsoft Azure).

This post may be more for my benefit than for readers of the blog but you never know… someone might find parts of it useful.

Re-installing Lightroom

Re-installing Lightroom is reasonably straightforward and these are the steps I took:

  1. Install Lightroom 5 from physical media (My Mac has no DVD drive, so I needed to use a USB-attached DVD drive).
  2. Launch Lightroom from the finder.
  3. When prompted, enter the serial number (or elect to use it in trial mode). My copy of Lightroom 5 is an upgrade, so I was prompted for the previous serial number too (from Lightroom 3 in my case).
  4. Lightroom needs to create a catalog. Let it get on with it.
  5. Lightroom then detected that an upgrade was available (5.0-5.7) and it directed me to the Adobe website, from where I downloaded 5.7.1. Incidentally, I have a feeling that these updates are the full product, and I could probably have used this for the original installation. That may be one to try next time… [Update: that’s confirmed by Lightroom Queen.]

Restore the Lightroom Catalog

Nex up, restoring the catalog. Amongst the many excellent posts from the Lightroom Queen is one titled “How do I move Lightroom to a new computer”, which is kind of what I wanted to do, except in my case it’s “How do I move Lightoom from a backup of my computer to the currently-running version of my computer”.

Starting Lightroom had created two files in ~/Pictures/Lightroom called:

  • Lightroom 5 Catalog.lrcat
  • Lightroom 5 Catalog Previews.lrdata

I made some backup copies of these, then tracked down the last versions on my backup disk and copied them to the folder.

The Lightroom Catalog Previews file can be pretty large (mine was around 37GB), so this took some time…

Ideally, I would also have restored the following:

  • Preferences, from ~/Library/Preferences/com.adobe.Lightroom5.plist
  • Presets, from ~/Library/Application Support/Adobe/Lightroom/ (there are more details about these in Lightroom Queen’s Lightroom 5 Default Locations post).

Unfortunately, these were missing from my backup (I’d had some issues backing up the Library in single-user mode), though I did find the presets on another machine and may be able to restore them later…

Helping Lightroom to find my images

Whilst I was waiting for the Lightroom catalog to copy, I started preparing for when I open Lightroom using the new (old) catalog. In my original installation, my images were in ~/Pictures/Digital Camera Photos but now the images are on my NAS. So, I created an alias for the folder on the NAS and moved that to ~/Pictures, hoping that this would look to Lightroom as though my images are in the same location…

Unfortunately, although Lightroom was able to follow this alias (symlink), it was smart enough to work out that the folders within it were at a different location – and not on Macintosh HD. Thankfully it wasn’t too big a task to select each orphaned folder in Lightroom (displaying a ? over the folder name), right click and select Find Missing Folder. Once the catalog was re-connected with the images, the ! on each preview went away and I could view the full-resolution image. More details can be found in the Lightroom Queen article I referenced earlier.

Wrap-Up

So, Lightroom is re-installed and my photos are back where I need them. Now all I need to do is sort out my workflow… and there’s the small matter of picking the best images from the 50000-odd that I’ve taken since I started using a digital camera so I can print some albums. Because, sometimes, analogue media is good.

A new lease of life for some of my old Macs

This content is 8 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Apple iMac G3For as long as I can remember, I’ve had a selection of PCs (Windows, Mac or Linux) in the house running a variety of operating systems. The Windows machines come and go – they are mostly laptops provided for work (either mine or my wife’s) – although we also have a Lenovo Flex 15 as “the family PC” (in reality, it’s difficult to get near it most of the time as the kids are using it!). Linux is normally for me to do something geeky on – whether that’s one of the Raspberry Pis or an old netbook running Ubuntu to easily update an Arduino, etc. The Mac purchases require a bit more consideration – their premium price means that it’s not something to go into without a great deal of thought and, although I still regret selling my Bondi Blue G3 iMac (one of the originals), I have 2006 and 2012 Mac Minis, and a late-2007 MacBook.

2006 Mac Mini running Windows 10!

Earlier this year, I brought the 2006 Mac Mini back to life with a SSD upgrade and, although it’s not “supported”, I managed to install Windows 10 on it (actually, I installed Windows 7 via BootCamp, then updated). It’s working a treat and, although it only has 2GB of RAM, it’s fine for a bit of web browsing, social media, scanning documents, etc. The only thing I haven’t been able to get Windows to recognise is my external iSight camera – which is a great device but has long since been discontinued.  I had some challenges along the way (and I can’t find all of the details for the process I used now) but some of the links I found useful include:

I also found that my aluminium Apple keyboard (wired) wouldn’t work for startup options; however, if I plugged in an older Apple White Pro keyboard, I was able to use startup options! I later found a forum post (when I was writing this blog post, but not when I originally had the issue) which suggests that a firmware update will fix the issue with the aluminium keyboard.

Once Windows 7 was installed on the Mac, it was just a case of following the Windows 10 upgrade process (back when Windows 10 was still a free upgrade).

Late 2007 MacBook destined for the scrap heap

The MacBook has been less successful. Not only has the keyboard rest broken yet again (for a third time) and the replacement battery that’s only had around 90 charges is completely dead after a couple of years of not being used, but it seems the latest supported Mac OS X version is 10.7.5 (Lion). I had hoped to bring it out of hibernation for use in the garage with Zwift but that needs at least OS X 10.8, leaving me waiting for an iOS app for Zwift (it’s on the way), or borrowing the family PC from the kids when I jump on the turbo trainer. Regardless, with no battery and an ancient OS, it looks like this MacBook is about to go to PC heaven…

2012 Mac Mini going strong but watch the updates…

The 2012 Mac Mini running OS X 10.10 (Yosemite) is still supported and I’m considering installing macOS 10.12 (Sierra) on it.  I say considering, because that looks likely to force me to spend money on a Lightroom 6 upgrade (with Lightroom 7 just around the corner, based on the fact that we’re up to 6.7 now). I also skipped OS X 10.11 (El Capitan) which I now regret, because that means it’s not in my purchase history so I can’t download it if I ever need an older MacOS version.

Short takes: pairing my headphones, firewalls and Exchange SMTP communications, tethered photos with a Mac

This content is 8 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Some more snippets that don’t quite make a blog post…

Because I always forget how to do this: how to pair a Plantronics BackBeat PRO headset with a mobile device.

And a little tip whilst troubleshooting connectivity to an Exchange Server server for hybrid connectivity with Office 365… if telnet ipaddress 25 gives a banner response from the SMTP server then that’s a good thing – if the firewall is interrupting transmission then I’ll get nothing back, or asterisks ********. Joe Palarchio (@JoePalarchio) writes about this (see issue 7) in his post on Common Exchange Online Hybrid Mail Flow Issues. Note that firewalls doing any form of blocking between Exchange servers are unsupported but that doesn’t stop customers from putting them between their email servers and anything running in the cloud (e.g. Hybrid server in Azure).  If you need to do this, then you should have any ANY/ANY rule (i.e. allow free flow of traffic) between the Exchange Server servers.

Take photos with OS X Image CaptureFinally, back in 2009, I  wrote about tethering a DLSR to a computer and taking pictures using Windows PowerShell (I think I’ve also written about using software to do this). Well, it turns out that the OS X Image Capture utility can also take a photo on a supported camera – either on a timed basis or by pressing a key.  Could be useful to know if setting up a time-lapse, or for studio work…

Short takes: file and folder management from the command line

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Turning more open tabs and notes into mini-blog posts…

Some Unix commands when working with directories

A couple of months back, I wrote about having to hurriedly back up my Mac after the file system got corrupted

Along the way I had to pick up some Unix commands that were previously outside my vocabulary… worth noting here for future reference:

Force deleting a folder on Windows

I’ve been cleaning down a PC that is no longer needed for regular use, but we’re hanging onto as a spare PC. I figured the quickest way would be to remove some user profiles but Windows Explorer was having difficulty with some temporary files in the AppData folder structure.  After a while, I fell back to a trusty cmd prompt…

rd /s /q foldername

The equvalent for a file is del /f /q /a filename.

Thanks to Techverse for pointing me in the right direction.

fscked-up Mac: creating a backup in OS X single user mode

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

11 months and 3 weeks after I bought it, my Mac Mini started playing up… I suppose I should be grateful that it’s just before the Apple warranty ends, not just after (although I did buy from Solutions Inc., who offer a 2 year warranty as standard… although they’ve told me it could take a month for repairs, so to try Apple first!).

First up, I noticed issues when copying files to a folder. It said the files already existed but they weren’t in the directory listing.  Then, I noticed that the Mac was switched off when it shouldn’t be. I powered it back on, only to find it got part way through booting (black screen with an Apple logo) and powered itself down. A corrupted file system and potentially flaky hard disk was my first thought… swiftly followed by “when was my last backup?”.

I started to work through Lex Freidman (@lexfri)’s Macworld tutorial on when good Macs go bad: steps to take when your Mac won’t start up, only to find that my Bluetooth keyboard wasn’t much help for Command-key combinations at bootup time (thankfully I had an Apple USB keyboard in the loft). Using Disk Utility to verify the disk confirmed some file system errors but a repair failed to fix them… so on to booting into single user mode and fsck -fy.

My problems only started after I upgraded OS X (the article is written for Mountain Lion) – I’m running Yosemite/10.10.5 (by the way, sw_vers -productVersion helped with that) – and I have a feeling all Disk Utility had been running under the covers was fsck but, regardless, it couldn’t fix my file system either…

** /dev/rdisk0s2
** Root file system
Executing fsck_hfs (version hfs-285).
** Checking Journaled HFS Plus volume.
The volume name is Macintosh HD
** Checking extents overflow file.
** Checking catalog file.
Incorrect block count for file coreduetd.db-wal
(It should be 698 instead of 587)
Missing thread record (id = 2396638)
Invalid extent entry
(4, 16638)
Missing thread record (id = 2539257)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Incorrect block count for file 2015-05-29 18.44.00.jpg
(It should be 1939 instead of 134219675)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Invalid extent entry
(4, 22174)
Incorrect block count for file 2015-05-29 19.04.41.jpg
(It should be 2448 instead of 526736)
Invalid extent entry
(4, 53125)
Invalid extent entry
(4, 53125)
Missing thread record (id = 136756985)
Incorrect number of thread records
(4, 21015)
** Checking multi-linked files.
** Checking catalog hierarchy.
Missing thread record (id = 2539257)
Missing thread record (id = 2585438)
Invalid volume file count
(It should be 1144777 instead of 1144780)
** Checking extended attributes file.
Incorrect number of extended attributes
(It should be 875596 instead of 875596)
Incorrect number of Access Control Lists
(It should be 1619 instead of 1620)
Overlapped extent allocation (id = 1479061, /private/var/db/CoreDuet/coreduetd.db-wal)
** Checking volume bitmap.
Volume bitmap needs minor repair for under-allocation
** Checking volume information.
Invalid volume free block count
(It should be 43923570 instead of 47674177)
Volume header needs minor repair
(2, 0)
** Repairing volume.
GetCatalogRecord: No matching catalog record found
FixBadExtent: Could not get catalog record for fileID 2924329
** The volume Macintosh HD could not be repaired.

So, onto that backup…

This is where Nestor Urquiza’s post (Mac OSX not booting? Make a backup from single user mode first) helped enormously. I decided not to touch my normal backups for this job and bought a new disk instead (a 1TB Seagate Backup Plus Slim was £50 in Currys – only a fraction more expensive than in the usual online locations) but the drive is pre-formatted using NTFS so I shrunk the volume in Windows Disk Management, then created a new simple volume in the free space with a single partition. This was formatted as exFAT (as ExFAT and NTFS were the only available options) and I ejected the disk from my PC and plugged it into the Mac (still in single-user mode), which responded with:

USBMSC Identifier (non-unique): 0x00000000 0xbc2 0xab24 0x100, 3

ls -l /dev/disk* told me that this was disk1

brw-r—– 1 root operator 1, 0 Oct 30 18:02 /dev/disk0
brw-r—– 1 root operator 1, 3 Oct 30 18:02 /dev/disk0s1
brw-r—– 1 root operator 1, 2 Oct 30 18:02 /dev/disk0s2
brw-r—– 1 root operator 1, 1 Oct 30 18:02 /dev/disk0s3
brw-r—– 1 root operator 1, 4 Oct 30 22:31 /dev/disk1
brw-r—– 1 root operator 1, 5 Oct 30 22:31 /dev/disk1s1
brw-r—– 1 root operator 1, 6 Oct 30 22:31 /dev/disk1s2

fstyp /dev/disk1d1 confirmed the NTFS partition:

ntfs

whilst fstyp /dev/disk1d2 returned:

msdos

That’s the ticket! A couple more commands and I had a read/write file system and a directory to mount the external disk in

mount -uw /
mkdir /extdrive

but then it all ground to a halt:

mount -t msdos /dev/disk1s2 /extdrive

mount_msdos: Unsupported sector size (0)

I had a suspicion that ExFAT was the issue here so, as Windows 2000 and later will only format FAT32 up to 32GB (although the file system supports larger volumes), I used a third party utility (the GUI version of FAT32Format created by Ridgecrop Consultants and as described by Matthew Nawrocki). Once the drive was reformatted as FAT32 instead of ExFAT, it mounted without any issues on the Mac.

I wrote a couple of test files… then started the bulk copies…

cp -r /Users/mark/Downloads /extdrive/
cp -r /Users/mark/Desktop /extdrive/
etc.

Finally, when all files were copied, I unmounted the USB drive (and checked I could read the files on another PC):

umount /extdrive

At the time of writing, I still need to get my Mac fixed. I guess I’ll be making an appointment to see a “genius” at my local Apple Store but at least I have a backup if the disk is swapped out or wiped. Actually, I got nervous about using FAT32 for my Mac backups, so I’m currently re-running the process with an HFS-formatted disk (using my old MacBook to create the volume)… and using a slightly-amended cp command for a verbose output and to preserve the file metadata:

cp -pRv /Users/mark/Pictures/2015 /extdrive/

I suspect there may be more blog posts to follow as this story develops…

Short takes: missing keys, closing apps and taking screen grabs

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Another post with a few things I’ve collected in my browser tabs over the last few weeks…

Locating the hash (#) key on a Mac keyboard

I love the Apple wireless keyboard that I use with my Mac Mini but tweeting without a hash key can be challenging at times…

So much for the Mac’s simplicity when I have to Google to find the hash key (it’s at Alt+3, BTW)!

Closing Windows 8 apps with the Surface/Surface Pro touch/type covers

And, talking of missing keys… the Surface/Surface Pro touch/type covers have function keys that double up as media keys so, if you want to Alt-F4 to close an app, remember that’s Alt+Fn+F4.

Snipping from “Metro” apps in Windows 8.1

If you want to snip a portion of the screen in Windows 8.x and you’re running a full-screen (“Metro”) app, then you’re out of luck – the Snipping Tool only works in desktop mode. The workaround is to take a screenshot with PrtSc and then edit the resulting clipboard contents. Hopefully this gets better in Windows 10?

So where is the PrtSc key for the Surface/Surface Pro touch/type covers?

There isn’t a PrtSc key, but Fn+space will grab the whole screen (as PrtSc does on a normal PC keyboard) and Alt+Fn+space will grab the current window and copy it to the clipboard (as Alt+PrtSc does normally).

 

Short takes: Lync/Skype and browsers; Bitlocker without TPM; OS X Finder preferences; and MyFitnessPal streaks

This content is 10 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

A few more short mini-posts from the items that have been cluttering my browser tabs this week…

Lync/Skype for Business meetings start in the Web App

A few days ago, a colleague highlighted to me that, whenever she joined a Lync meeting from our company, it opened in Lync Web App, rather than using the full client. Yesterday I noticed the same – I tried to join a call hosted by Microsoft and the Skype for Business Web App launched, rather that the Lync client installed on my PC. It turns out that this behaviour is driven by the default browser: mine is Chrome and my colleague was also using something that’s not IE. Quite why I’d not seen this before, I don’t know (unless it’s related to a recent update) but for internal Lync meetings I do tend to use the Join Online button in the meeting reminder – that doesn’t seem to appear for external meetings. Of course, you can also control which client is used by editing the URL

Using Bitlocker on drives without TPM

When my wife asked me to encrypt the hard drive on her PC, I was pleased to be able to say “no need to buy anything, we can use Bitlocker – it’s built into Windows”. Unfortunately, when I tried to enable it, I found that her PC doesn’t have a trusted platform module (TPM) chip. I was pretty sure I’d worked around that in the past, with a netbook that I used to run Windows 7 on and, sure enough, found a How To Geek article on How To Use BitLocker on Drives without TPM. It’s been a while since I had to dive into the Local Computer Policy but a simple tweak to the “Require additional authentication at startup” item under Computer Configuration\Administrative Templates\Windows Components\Bit Locker Drive Encryption\Operating System Drives was all it took to let Windows encrypt the drive.

Finding my files in Finder

One of the challenges I have with the Mac I bought a few months ago, is that modern versions of OS X seem to want to hide things from me. I’m a “browse the hard drive to find my files” kind of guy, and it took a tweak to the Finder preferences to show my Hard Disk and bring back the shortcut to Pictures.

MyFitnessPal streak ends – counter reset

Last weekend some connectivity issues, combined with staying away with friends meant I missed the cut-off for logging my food/exercise with MyFitnessPal and my “streak” was reset (i.e. the login counter). Knowing that I’ve been logging activity for a certain number of days is a surprisingly motivational piece of information but it turns out you can get it reset using the counter reset tool (which even predicted how many days the value should be – 81 in my case).

Short takes: Unicode characters in Windows; OS X Remote Disc goes AWOL

This content is 10 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

More micro-posts from the collection of open tabs in my browser…

Unicode characters in Windows

Sometimes, when tweeting, it’s useful to be able to type the unicode horizontal ellipsis (…) rather than three full stops (…). It might look similar, but that’s two less characters out of 140.  I remember back in early days of Windows I could enter special characters using the numeric keypad but it seems that still works (sort of): FireFormat.Info has some useful information on entering Unicode characters in Microsoft Windows.

Mac OS X Remote Disc goes AWOL whilst installing Adobe Lightroom

My new Mac Mini doesn’t have an optical drive. That’s not generally a problem except I needed to install Lightroom on it, so I used OS X’s Remote Disc technology to share the DVD drive from my old MacBook across the network.  The software installation was progressing nicely until, right at the end, the Adobe installer wanted me to insert the disc! As I was already connected to a logical disc, I had no way forward but to abandon the installation, connect a USB DVD drive and try again.  Seems it’s not the universal solution to accessing optical media that I had hoped…

To add insult to injury, I then found (thanks to the Lightroom Queen) that the Lightroom downloads on the Adobe website are the full programme, so I could have downloaded the software and installed it locally – all I really needed was my license key!

Tweaking the display on a Samsung TV for use as a computer monitor

This content is 12 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Samsung UE37ES6300A few weeks ago, I bought my first flat screen TV. The old (c1998) Sony Trinitron still works, but it was starting to lose the colour a little around the edges and was, frankly, taking up a huge chunk of living room so I splashed out and bought a Samsung UE37ES6300 from John Lewis.

I’m not bothered about 3D pictures but the Smart TV (Internet-connected) functionality is a huge bonus. Meanwhile, the availability of HDMI ports (no VGA on this year’s model) led me to hook up my old Mac Mini as a permanently connected place for Internet access in the living room (although the requirement is rapidly dropping as more and more Samsung Apps become available – Spotify appeared last night!).

Using a DVI to HDMI cable, the Mac was able to detect the 1080p display but it did enable overscan which meant I was losing the edge of the picture. Turning off overscan helped, but didn’t use the whole display (and was also a bit fuzzy).  With a bit of help from a friend (who, conincidentally, had come over and hooked his Linux machine up to the display), I worked out that the solution is to leave overscan enabled on the computer but to set the TV Picture Size to Screen Fit.  I’m not sure if I can see much difference betwen 50Hz PAL and 60Hz NTSC but, seeing as this is a European model, I left the computer set to 50Hz PAL.

This resolved the display size but it was still not as sharp as I would expect for a native resolution display. Switching the Picture Mode from Standard to Movie made a big difference (although the colours were a little muted and there was a slight magenta cast) so I started to look at the differences between the two profiles.  Now I’ve tweaked the Standard profile to bring down the sharpness from the default of 50 to 20 and turned off the Dynamic Contrast in the TV’s Advanced Settings and I think I’m pretty much there.

So, there you have it. I haven’t tried a Windows PC yet, but those settings seem to work well with the Mac – and the result is a much improved digital display output.