Tag: macos

iMac waked up regularly

iMac waked up regularly

My iMac keeps waking up, although this wasn't a problem for my Mac mini, it is an issue for my iMac. The difference between is, iMac got very annoying fan noise, even no activity.

Many factors

There are so many factors to wake iMac up according to Apple, but I think the may reason is Timemachine. The option of Wake for network access in Energy Saver is for the tasks to be taken during sleep, including Timemachine. But this option is related to wake up on LAN as well, then if I need WoL, I can not turn off this option.

There is also no Do not disturb option in my this iMac, it has older macOS High Sierra.

Issue

The actual issue caused annoying problem, is Timemachine has no scheduling.

Another issue

Unlike some other OS, iMac won't maintain ssh connection after sleeped. This is a huge issue to me because I use ssh heavily. Thinking to configure VPN, and use VPN to connect to other servers, maybe can maintain connection.

References

If your Mac sleeps or wakes unexpectedly

Turn off iMac Display Only

Turn off iMac Display Only

The iMac might not auto sleep sometimes, so what do you like to do before you go for quick snack? Turn off iMac display only. But there is not switch on monitor, luckily there are some ways to do.

Keyboard with Eject key

  • Control + Shift + Eject

Keyboard with Power key

  • Control + Shift + Power

Keyboard without Eject/Power

Go to login screen

  • Control + Command + Q

Then at the login screen

  • Escape

Keyboard with Touch Bar

Configure

  • Select System Preferences
  • Open Keyboard
  • Click Customize Control Strip...
  • Drag Screen Lock icon into the Touch Bar
  • Click Done.

Perform

Go to login screen

  • Tap the the Screen Lock icon on your Touch Bar

Then at the login screen

  • Escape to turn off the display immediately.

Mouse

Configure

  • Select System Preferences
  • Open Mission Control
  • Click Hot Corners
  • Choose Put Display to Sleep for one of the corner

Perform

  • Move your mouse to the corner configured

Terminal

Run the following command:

pmset displaysleepnow

References

[How to Turn Off Your Mac's Display Without Putting Your Computer to Sleep}(https://www.iclarified.com/76166/how-to-turn-off-your-macs-display-without-putting-your-computer-to-sleep)

Reconfigure iCloud in MacOS

Reconfigure iCloud in MacOS

Many days headache was fixed this morning...

Story

The problem with iCloud on my newly installed MacOS, which is High Sierra, 10.13.6, out of support by Apple.

The machine was installed via Internet, and the MacOS was Mountain Lion, then upgraded to High Sierra, the lastest can be installed in this 2011 iMac.

Issue

When connecting to iCloud at beginning, the iCloud can not sync Keychains, it is quite an issue for me, because I need to register all credentials to this iMac separately.

Then I decided to reconfigure iCloud by re-login to iCloud again.

But iCloud could not be registered any more after logout, I thought it could be issue with my unsupported OS.

Symptom

The symptom was repeating asking for iCloud user and password, no matter which iCloud I like to use. In the email account list, the account is just appear in very short period, then closed immediately.

Fix

This morning I tried to send email, found out that I could not add iCloud account, I decided to search solution in Internet.

The solution works for delete all files related to iCloud and system configuration. It is works for my newly configured iMac, because I have nothing in it.

Steps

Run following commands in terminal

rm ~/Library/Application Support/iCloud
rm ~/Library/Preferences/com.apple.systempreferences.plist01
rm ~/Library/Keychains

Then reboot

sudo reboot

References

Mac Can’t Connect to iCloud? Here Are 7 Ways to Fix It

Remap Windows keyboard to Mac layout

Remap Windows keyboard to Mac layout

MacOS keyboard preference can remap keys for individual keyboard. This is not a global key remapping, it will not impact other keyboards except the one selected.

Steps

  • Go to System Preferences
  • Click on Keyboard
  • Click on Modifier Keys
  • Select keyboard to be modified in Select keyboard option
  • Map Option key to Command key, and Command key to Option key

How-To: Remap Windows keyboards to match the Mac keyboard layout

Add root certificate to MacOS

Add root certificate to MacOS

If you have your own root certificate like I do, the follow the steps below to add it in MacOS.

Browser vs OS level installation

When accessing a server which signed using your own root certificate, if it isn't installed locally, browser will prompt the warning. Then need to select trust the certifcate in order to continue.

This action only trust that machine certificate in the browser, it only does

  • Trust the machine certificate, not the root certificate
  • Only trust in the browser currently used

The benefit of installing root certificate OS level are

  • All applications will trust certificate
  • Only one time installation required
  • Trusted for all users in the system (Not Firefox Browser)

Download certificate

Provide by issuer

Go to issuer software, such as Synology NAS, download from certificate store, and extract CA certificate, such as example-ca-cert.pem.

From browser with root certificate

The root certificate can be downloaded from browser if the brower has been installed. For example, in Firefox,

  • Click on lock icon besides URL => connection secure => more information, then Page Info window appears
  • Click on View Certificate in Security tab, then certificate information page is displayed as a new browser tab.
  • Look for chain certificate. In Firefox, it is under Miscellaneous => Download PEM (chain)
  • Click on chain certificate and save it locally.

Note: The downloaded certificate file contains both server certificate and root certificate. Delete server certificate using text editor if possible. If the server certificate had been installed in keychain, it can be removed from keychain later too

Install certificate

Use following steps to install CA certificate into keychain

  • Double click the certificate file (with ".pem" or ".cer" extension)
  • Choose "System" from the keychain option. Then press "Add" to install after password provided

Set certificate "Always Trust"

To set system wide trust, use following steps.

  • Open Keychain Access application
  • Look for root certificate, double click it
  • Expand Trust section
  • Select "Always Trust" from list of When using this certificate.

Delete server certificate if needed

If the server certificate was also installed, suggest to delete it from keychain and browser certificate store. This is to avoid false information about successful installation.

  • Open Keychain Access application
  • Look for server certificate
  • Right click on it, then select delete certificate

Firefox Only

In Firefox, which has its own certificate store, the system certificates are not accepted. So use following steps to enable system certificates to be used for current user.

  • Open new tab, and type about:config
  • Search for security.enterprise_roots.enabled
  • Change it to true by double click the line.

Note: This only enable trust for current user

Reboot

Verify

Use browser to access another website which has the same root certificate, the certificate not trusted page should not appear.

References

FAQ: How to add root certificate to Mac OS X

Hot swapable Keychron keyboard issues

Hot swapable Keychron keyboard issues

Just got Keychron keyboard, with hot swap, which can easily switch between two Mac machines easily. Some issues struggle me for a while.

No eject button

The major difference between normal Mac keyboard and Keychron keyboard is reject button, so need to use another combination of keys for sleep instead, which uses power button. But my old iMac power button has issue as well.

Then when I put iMac to sleep, then try to switch to Mac Mini, the keyboard wakes iMac up. To overcome this issue, I tried to use mouse, but I can not move the mouse as well, it also wakes iMac up.

After search internet, people give a solution, that is using mouse to sleep, then lift it up, after that make it upside down. Then I did the same thing, except switch it off, because my mouse got light.

Switch between MacOS and Windows or Linux

Because of the switching between MacOS and Windows or Linux via a physical button, it isn't that easy, and the manual mentions do not do it often, otherwise, can cause issue.

References

Shortcut key to make my macbook sleep?

Network filesystem timeout settings

Network filesystem timeout settings

Network disruptions are always happening, network filesystems on different OS have different behaviors.

NFS

During Synology disk migration and SSD cache reconfiguration, my Fedora 34 on iSCSI mounted NFS disk kept hanging, I checked the default NFS mount options, then found that it was using hard option with out intr as below,

192.168.1.10:/volume1/kvm on /kvm type nfs4 (rw,nosuid,nodev,noexec,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.9,local_lock=none,addr=192.168.1.10)

I think maybe this is giving the factor of hanging.

iSCSI

After I changed NFS setting to soft, I suddenly realized that my iSCSI used by Fedora OS might not able to handle interupt as well, not sure whether iSCSI got similar options.

Samba on MacOS

My MacOS also got issue on samba filesystem, always disconnected after communication dropped, but my Windows machine has no such issue.

References

What are the differences between hard mount and soft mount?

iMac 27″ Mid 2011 OS reinstallation

iMac 27" Mid 2011 OS reinstallation

In order to reinstall OS, I searched Internet, and no one tell the truth, let me spent a few hours. I'm also not sure my method will work later or not. Need to think a way to create local bootable disk.

Keyboard and Mouse

I don't have wired apple keyboard and mouse, so used Windows keyboard. It doesn't have Command key, but searching internet, found the Intel iMac can use Command or Alt. Yes, Alt works, can display boot option.

Installation Method

Missing installation CD (Failed)

After a few relocation, I could not find the installation CD, it is at least hard to find, decided to create an installation USB.

Installation USB (Failed)

My new iMac mini has OS Big Sur, I tried methods given by Apple, none of them can work.

I created Big Sur bootable USB, but when tried to install, gave me stop sign.

I tried to click the links to download old MacOS from Apple, they don't work at all.

I tried to download OS image from other website, they can not be executed and run Apple given command, because they are for different OS.

I tried use Daemon Tools to create bootable USB from dmg file, in fact, not working.

Internet (Good)

When I kept finding methods to create bootable image, suddenly, the iMac display installation utilities after boot, which means installation can be continue without installation media, this is good feature of iMac.

Disk to be installed

Got funny issue, can not detect my SSD, I thought the SATA connection issue. Open it and reconnected it, tested on external USB, suddenly found the disk can be detected by Disk Utility. Then thought again, noticed that the disk needs to be erased.

OS upgrade and patching

After installation completed, it is running Mount Lion, very old OS, then App Store update got issue, can not update software patch.

After search internet, found High Sierra can be installed, then clicked on Apple OS installation link which was work before, it works.

Not completed, there are quite number of patches to be installed, although take long time, the actual installation time reported by installation process is much longer, about 15 mintues reduced to two or three minutes, this is the benefit of SSD disk.

Backup

To avoid spending too much time next time, I decided to create installation media image and perform backup.

After opened time machine disk selection window, the AFP enabled NAS immediately appear, but not the SMB only NAS. Manual mapping/accessing of disk is required before Time machine could see it.

El Capitan:

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia -

Appendices

Media Creation

The commands are given by Apple as below for media creation.

Beware: They can not work with OS which is different than current.

Big Sur:*

sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Catalina:*

sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Mojave:*

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

High Sierra:*

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

References

How to create a bootable installer for macOS

Switch between Screens, Apps, Windows and Tabs in MacOS

Switch between Screens, Apps, Windows and Tabs in MacOS

This is not a complete list, I'm not a normal person who can remember all methods defined by others nowadays. In fact, I also don't read all words in other posts as well.

Instant switch

Screen Apps Windows Tabs
Keyboard Cmd-` Ctrl-Tab
Magic Mouse Double Finger Swipe
Magic Pad Triple Finger Swipe

Display icons before switch

Screen Apps Windows Tabs
Keyboard Cmd-Tab
Magic Mouse
Magic Pad

Display Windows before switch

Screen Apps Windows Tabs
Keyboard Ctrl-Left/Right Ctrl-Down Ctrl-Up
Magic Mouse Double Finger Tap
Magic Pad Triple Finger Tap

References

How To Switch Between Windows On Mac?

Automator in MacOS Basic

Automator in MacOS Basic

To automate tasks in MacOS, Automator can be used. For example, convert selected images to JPG format, the steps as below

Create new task

Run Automator

Select Quick Action

Select action

Find out action Change Type of Images

Set actions' options

Select Show this action when workflow runs

Save

Run in Finder

In Finder, select images, then select Services menu can be found after clicked following icon, then follow steps.

Services Menu

Rename Action

Right click on Action name in Automator, select Services, then rename the action.

Delete Action

Right click on Action name in Automator, select Services, then delete the action.

Screen Capture

Screen Capture