Skip to content

Instantly share code, notes, and snippets.

@darwin
darwin / _readme.md
Last active March 6, 2026 03:15
Gmail issue: 535 5.7.8 Username and Password not accepted.

The problem

I'm using web-based gmail as my primary email client. I want to use anoter SMTP server to send emails using secondary email address which is managed by GSuite.

GMail offers "Send emails from a different address or alias" feature[1].

Historically it has been possible to use smtp.gmail.com with my GSuite credentials to enable the feature and send emails via my secondary email without problems.

Running ui-main on thread:main[1]
Color management: using fallback mode for management
Color management: Error could not find role data role.
BLT_lang_init: 'locale' data path for translations not found, continuing
Color management: scene view "Filmic" not found, setting default "Standard".
blf_load_font_default: 'fonts' data path not found for 'droidsans.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'bmonofont-i18n.ttf', will not be able to display text
2020-06-11 13:10:45.674 java[12724:343425] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
❯ ./build-blender-mac.sh repl
++ dirname ./build-blender-mac.sh
+ cd .
++ pwd
+ ROOT_DIR=/Users/darwin/lab/blender-clj
+ OUR_LIB_DIR=/Users/darwin/lab/blender-clj/lib
+ BLENDER_GIT_DIR=/Users/darwin/lab/blender
+ BLENDER_LIB_DIR=/Users/darwin/lab/blender/../lib
+ BLENDER_BUILD_DIR=/Users/darwin/lab/blender/../build_darwin
+ JNA_VERSION=5.5.0
@darwin
darwin / touch_them.sh
Last active April 2, 2020 13:54
This scripts finds all files in given directory tree, reads their com.apple.metadata:kMDItemDownloadedDate xattr and changes last modification date to that value if exists.
#!/usr/bin/env bash
set -e
set_date_attr() {
local hex
hex=$(xattr -px "com.apple.metadata:kMDItemDownloadedDate" "$1")
if [[ $? = 0 ]]; then
local date_xml
date_xml=$(xxd -r -p <<< "$hex" | plutil -extract 0 xml1 -o - - | sed '4q;d' | sed -e 's/<[^>]*>//g')
> rm -rf ~/.m2/repository/binaryage/dirac/1.5.8
> clojure -Srepro -Sdeps '{:deps {binaryage/dirac {:mvn/version "1.5.8"} org.clojure/clojurescript {:mvn/version "RELEASE"} clj-logging-config {:mvn/version "1.9.12"}}}' -m dirac.main
Error building classpath. Could not find artifact binaryage:dirac:jar:1.5.8 in central (https://repo1.maven.org/maven2/)
> lein publish
All version strings are consistent: '1.5.9'
WARNING: You have $CLASSPATH set, probably by accident.
It is strongly recommended to unset this before proceeding.
Created /Users/darwin/code/dirac-ws/dirac/target/dirac-1.5.9.jar
Archive: dirac-1.5.9.jar
Length Date Time Name
--------- ---------- ----- ----
238 03-08-2020 20:04 META-INF/MANIFEST.MF
6767 03-08-2020 20:04 META-INF/maven/binaryage/dirac/pom.xml
SHADOW_ENV.evalLoad("goog.debug.error.js", false, "goog.provide(\x22goog.debug.Error\x22);\n/**\n * @constructor\n * @extends {Error}\n * @param {*\x3d} opt_msg\n */\ngoog.debug.Error \x3d function(opt_msg) {\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, goog.debug.Error);\n } else {\n /** @const */ var stack \x3d (new Error).stack;\n if (stack) {\n /** @override */ this.stack \x3d stack;\n }\n }\n if (opt_msg) {\n /** @override */ this.message \x3d String(opt_msg);\n }\n /** @type {boolean} */ this.reportErrorToServer \x3d true;\n};\ngoog.inherits(goog.debug.Error, Error);\n/** @override */ goog.debug.Error.prototype.name \x3d \x22CustomError\x22;\n
//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewoidmVyc2lvbiI6MywKImZpbGUiOiJnb29nLmRlYnVnLmVycm9yLmpzIiwKImxpbmVDb3VudCI6MjMsCiJtYXBwaW5ncyI6IkFBdUJBQSxJQUFBQyxRQUFBLENBQWEsa0JBQWIsQ0FBQTtBQVVBOzs7OztBQUFBRCxJQUFBRSxNQUFBQyxNQUFBLEdBQW1CQyxRQUFRLENBQUNDLE9BQUQsQ0FBVTtBQUduQyxNQUFJRixLQUFBRyxrQkFBSjtB
diff --git a/src/main/shadow/build/output.clj b/src/main/shadow/build/output.clj
index 7218596c..481287d0 100644
--- a/src/main/shadow/build/output.clj
+++ b/src/main/shadow/build/output.clj
@@ -185,8 +185,11 @@
(let [sm-suffix
(get-in state [:compiler-options :source-map-suffix] ".map")
+ sm-prefix
+ (get-in state [:compiler-options :source-map-prefix] "")
@darwin
darwin / automate-totalfinder-tabs.applescript
Created February 3, 2020 15:34
This is a simple automation script to open two extra tabs and switch them to custom paths. Tested on macOS 10.15.3 (Catalina) and TotalFinder 1.12.3
set paths to {"/Users/darwin/Music", "/Users/darwin/Desktop"}
-- open all paths as new tabs
repeat with path in paths
set applePath to POSIX file path
tell application "Finder" to activate
tell application "System Events"
keystroke "t" using command down
end tell
delay 1
@darwin
darwin / readme.md
Last active January 15, 2026 20:19
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).