Notes and Tips
A simple collection of tips, quotes, and other snippets of things I've learned and found interesting.
Tips
Send macOS to sleep immediately via the terminal
pmset sleepnow
List all devices available in Xcode
xcrun simctl list devices
Delete unavailable simulators in Xcode
xcrun simctl delete unavailable
Delete specific devices in Xcode
xcrun simctl delete
Replace strings
sed -i 's/Notes/Posts/g' *.html
Supporting dark theme via the use of meta. Not all browsers support this.
<meta name="color-scheme" content="light dark">
<meta name="theme-color" media="(prefers-colors-scheme: light)" content="#f8f8f8">
<meta name="theme-color" media="(prefers-colors-scheme: dark)" content="#030303">
Lock the screen on a Mac via the terminal
Bash
#!/bin/bash
open -a /System/Library/CoreServices/ScreenSaverEngine.app
Apple Script
tell application "/System/Library/CoreServices/ScreenSaverEngine.app"
activate
end tell
List the number of full battery charging cycles (on macOS)
system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'
Questions to ask when designing software and we need to keep it secure
- What am I trying to protect?
- What am I trying to protect it from?
- How do I want to protect it?
Camera setting for night shooting
- ISO 3,200 by default but will increase to 6,400+ when necessary
- Aperture priority (‘A’) mode
- Aperture value likely to be at the wider end of the scale – usually between F1.2 to F5.6, depending on the subject
- Exposure compensation (+/-) used occasionally for fine-tuning exposure
- Manual focusing (AF can be too slow). You’ll find that with practice this will become quick and easy, especially when using red focus peaking
Camera setting for urban photography
- Aperture priority (‘A’) mode
- Auto ISO
- Shutter speed min 1/250
Quotes
"If you aim at nothing, you hit nothing."
"There is nothing outside of yourself that can ever enable you to get better, stronger, richer, quicker, or smarter. Everything is within. Everything exists. Seek nothing outside of yourself."
"The more we detach from things that don’t add value to our lives, the calmer, the freer, and the lighter we feel."
"Reject what didn’t work for you and move on. You don’t need an adversary. You just need to change. Or, in the words of a dear friend, you shouldn’t 'give a shit about people who don’t give a shit.'"
"Opt for privacy and solitude. That doesn’t make you antisocial or cause you to reject the rest of the world. But you need to breathe. And you need to be."
“Less is more, more is lazy.”
"When you teach your son, you teach your son’s son."
"The mind commands the body and it obeys. The mind orders itself and meets resistance."
Last updated 06 Jun 2023