Sunday, May 31, 2020

MacBook unplugged from external monitor thinks it's still the Secondary Desktop



Command + Brightness Up is the keyboard shortcut for Detect Displays


src: https://apple.stackexchange.com/a/58952


Wednesday, October 16, 2019

Faster Time Machine backups on macOS

This seems to speed up TimeMachine backups:

sudo sysctl debug.lowpri_throttle_enabled=0



To restore normal slow speed use:


sudo sysctl debug.lowpri_throttle_enabled=1

Wednesday, January 4, 2017

RVM and SSL certificates

When on Mac while 'bundle install' or 'bundle update' you get following error:

Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.



then try to use this
sudo rvm osx-ssl-certs update all 

Monday, November 14, 2016

Mac OS X Sierra and self signed certificates

For some reason after upgrading to Sierra some of self signed certificates stopped being trusted.
Keychain Access was hanging and guru meditating while trying to delete/reinstall certificate.

this helps to reinstall self signed certificate:


0. find your certificate among installed

security find-certificate -a -Z|grep -e "SHA\|alis"

1. remove cert with

security delete-certificate -Z certSha

2. install cert via command line

sudo security add-trusted-cert -d -r trustAsRoot -p ssl myCoolSelfSigned.cer

3. in Keychain Access in system keychain open certificate and select "Always Trust"


as well this tool does magick


sudo certtool i myCert.crt

Tuesday, November 1, 2016

Ruby Prime numbers

Ruby is the only language that has all the prime numbers in a set.

Prime
The set of all prime numbers.


it's like "Chuck Norris Has Counted To Infinity. Twice" 

Just kidding - basically, the class provides Enumerable type API to prime number generator with limitation to methods 'each' and 'first', but I like the Ruby Doc description :-)