Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

Supporting Multiple SSH Keys on macOS

April 3, 2020 by Rob Bazinet Leave a Comment

Tweet

If you’re a developer, on devops or a system admin you probably use an SSH key to log into remote servers.

I am typically on multiple projects at one time and some organizations require I generate a unique SSH key in order to work with them. I’ve been fortunate until recently that my personal SSH key was acceptable.

So, how can you have two or more SSH keys available on your system at any one time? I am running a Mac but I assume this would work on Linux as well.

It’s not hard and when setup, it works really well.

Getting Started

The first part is generate a new SSH key. Understand that the email you’re using here may be an email provided by you client or company. It may not be the email you normally use.

ssh-keygen -t rsa -b 4096 -C "[email protected]"

There are a few different types of keys you can generate. If you’re interested, GitHub has some good help with SSH keys.

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/rbazinet/.ssh/id_rsa): example_com_id_rsa

I use something specific to the company for who I’m adding the key. You can see here the new SSH key is example_com_id_rsa. Please be careful here, if you leave the default you may overwrite your existing key. You probably don’t want to do that.

The Key is the Config

Head on over to where your SSH keys are stored, probably in ~/.ssh directory. Edit the config file, simple called config. It probably looks like mine:

Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa

Add your additional host. I added mine above the original.

Host git.example.com
Preferredauthentications publickey
IdentityFile ~/.ssh/example_com_id_rsa
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa

The host is the system you need access to. It could be a git server or some other resource. Wildcards work here so if you need to access all resources on s particular domain, you would handle that here. There are a lot of things you can do in the config file and way you do them varies in complexity. If you want a more detailed explanation, Digital Ocean has a good resource.

I hope this helps.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: macOS, ssh keys

Using the Microsoft Ergonomic Keyboard on macOS

April 1, 2020 by Rob Bazinet Leave a Comment

Tweet

IMG 6167

I’ve been through a fair number of keyboards over the years, some expensive and some not. One of my favorites is still the CODE Keyboard, which I wrote about before. I still love this keyboard but I was starting to have pain in my forearms after a long day of typing. I keep coming back to the Microsoft Ergonomic Keyboard to on macOS. Why? Because it’s a tradeoff between being ergonomic and being inexpensive. I’ve seen some other customizable keyboards in the range of $350 but I haven’t found the large price tag necessary.

One annoyance when using many keyboards is the fact that they are setup for Windows operation system and not macOS. This means the Command key is not to the left of the space bar as Mac people expect. The Microsoft Ergonomic keyboard has the Alt key in that location. It’s a simple fix.

Go to System Preferences -> Keyboard -> Modifier Keys…

2020 03 31 10 47 16

Notice the Option Key and Command Key defaults. The Mac is recognizing the Alt key as the Option key. We need to make a change.

MicrosoftKeyboard Before

The easy fix is to swap the two keys in the modifier. Option becomes Command and Command switches to Option. Click OK and everything should work as expected.

MicrosoftKeyboard After

This saved the day with properly mapping the command key. If you need other keys mapped differently on this keyboard, there is another option. Karabiner is a powerful utility for the Mac that allows a wide variety of keyboard mapping. It was more than I needed.

I hope this helps.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: Ergonomic Keyboard, macOS, Microsoft

Fixing TextExpander on macOS 10.14

April 12, 2019 by Rob Bazinet Leave a Comment

Tweet

I use TextExpander from Smile Software every day and rely on it for so many helpful snippets. After upgrading my iMac to macOS Mojave, I realized that TextExpander was broken and nothing I tried worked. It seems TextExpander would no longer expand any snippets. Trying the menu option to “Enable Expansion” did nothing.

I sent a support request to Smile and was really happy to have a response in the matter of an hour. Not surprising, I was not the only one with the issue:

Hi Rob,

Thank you for contacting Smile Support. I’m sorry to hear that you’re having trouble. A few users have reported something similar and these instructions should get it working again:

https://smilesoftware.com/blog/entry/textexpander-macos-10-14-mojave-and-accessibility

After you complete those steps it may also be necessary to click on the TextExpander icon in the menu bar and choose ‘Enable Expansion’. Please let me know if you continue to have trouble.

Maybe this will help someone else with the same problem.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: macOS, textexpander

Speeding up Slow Time Machine Backups on macOS

November 6, 2018 by Rob Bazinet Leave a Comment

Tweet

I’ve been a long-Time Apple Time Machine for many years and it’s saved me many times.

I back up to a Synology NAS drive configured with Time Machine support. Time Machine has always been fast and efficient until I upgraded to macOS El Capitan (10.11). During that time, backups could be measure in hours instead of minutes previously. I initially thought the slowdown had to do with a recent software change in my Synology NAS.

I spent a bit of time in the Synology forums trying to solve the problem with various suggestions from users. Nothing worked.

I upgrade to macOS Sierra (10.12) and High Sierra (10.13) when they came out, hoping something had changed that fixed the agonizingly slow backups. No luck.

Disabling Throttling

I recently started to try to find a solution again since my backups recently went up in size and the slowness was really noticeable. Estimated backup times measured in days. After a bit of digging I found this suggestion, entered in a Terminal window:

sudo sysctl debug.lowpri_throttle_enabled=0

It worked beautifully. A very large backup went from days to hours. Subsequent backups now take minutes instead of hours.

Note: you can re-enable throttling with a similar command:

sudo sysctl debug.lowpri_throttle_enabled=1

I admit I don’t know the side effects of disabling throttling, so use at your own risk.

Making it Stick

If you want to have throttling turned off between Mac restarts, you have to do a bit more work.

Create a file under /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist with the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>fix-el-capitan-slow-time-machine-speed</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/sbin/sysctl</string>
      <string>debug.lowpri_throttle_enabled=0</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

Make it belong to root:

sudo chown root /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist

Make it load at startup:

sudo launchctl load /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist

Conclusion

I’ve also tested on macOS Mojave (10.14.1) and can confirm a nice speedup. Overall, everything works really well now. I can’t take credit for the solution as I did some searching and came across several places this was mentioned, including one from Apple. I just know that it works!

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: macOS, Synology, Time Machine

Recent Posts

  • Social Media Times Are Changing
  • It has certainly been a long time…
  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Everything I read these days mentions ChatGPT or AI as the answer to everything. So many red flags. I hate trends l… https://t.co/ITLxsfAvd9
    about 1 week ago
  • If anyone knows any projects looking for some dev help, mainly Rails, as a lead who can manage small teams…I’d love… https://t.co/u0ClZ8x5wB
    about 3 weeks ago
  • This is such the truth…Even Amazon can't make sense of serverless or microservices https://t.co/0zK9YVMdrj
    about 4 weeks ago
  • I’m not sure I’d subscribe to content on Twitter when I already follow someone. Maybe I’m missing something.
    about 1 month ago
  • This looks really cool and a great real world use of AI. https://t.co/DzX5BbgDdY
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon