Skip to content

Instantly share code, notes, and snippets.

@darwin
darwin / totalfinder-diagnostics.md
Last active November 14, 2020 20:47
TotalFinder diagnostics
  1. Please open /Applications/Utilities/Terminal.app
  2. In the Terminal prompt copy&paste this line and hit return:
curl -sL https://updates.binaryage.com/diagnose-totalfinder.sh > /tmp/dtf.sh && bash /tmp/dtf.sh
  1. Please send the resulting file totalfinder-diagnostics.tar.gz (on Desktop) to support@binaryage.com
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation
❯ nix-shell --show-trace controller/shell.nix --run 'python controller/main.py'
error: while evaluating the attribute 'buildInputs' of the derivation 'trezor-user-env-controller' at /Users/darwin/farm/trezor-user-env/controller/shell.nix:24:5:
while evaluating the attribute 'passAsFile' of the derivation 'python3-3.8.5-env' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating 'requiredPythonModules' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/top-level/python-packages.nix:64:27, called from /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/development/interpreters/python/wrapper.nix:15:13:
while evaluating 'unique' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/lib/lists.nix:643:12, called from /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/top-level/python-packages.nix:66:6:
while evaluating 'unique' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/lib/lists.nix:643:12, called from /nix/store/a4svi29pmh2q
❯ nix-shell --show-trace controller/shell.nix --run 'python controller/main.py'
error: while evaluating the attribute 'buildInputs' of the derivation 'trezor-user-env-controller' at /Users/darwin/farm/trezor-user-env/controller/shell.nix:23:5:
while evaluating the attribute 'passAsFile' of the derivation 'python3-3.8.5-env' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating 'requiredPythonModules' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/top-level/python-packages.nix:64:27, called from /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/development/interpreters/python/wrapper.nix:15:13:
while evaluating 'unique' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/lib/lists.nix:643:12, called from /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/pkgs/top-level/python-packages.nix:66:6:
while evaluating 'unique' at /nix/store/a4svi29pmh2qips8h6649vvzhk5nk5qd-source/lib/lists.nix:643:12, called from /nix/store/a4svi29pmh2q
@darwin
darwin / 00-readme.md
Last active June 18, 2020 05:21
[SOLVED] iMac sleep/wake issues caused by my USB mouse (Wake reason: XHC1)

Wake reason: XHC1

Since macOS High Sierra (maybe even Sierra) I started having trouble putting my iMac (mid 2015) to sleep. After installing clean Mojave system the problem didn't go away, even after jumping through various hoops and trying to disable every software which might be causing it.

The problem

After entering sleep mode the computer did DarkWake unexpectedly. Usually within one minute after sleeping. This was especially annoying because my external drives would spin up at that point.

The solution

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 / terminal.sh
Last active April 25, 2020 09:10
How to inject TotalFinder via a Terminal command under macOS 10.14 Mojave (B6). First install latest TotalFinder beta from https://totalfinder.binaryage.com/beta-changes#latest
sudo tccutil reset AppleEvents
osascript -e "tell application \"Finder\" to «event BATFinit»"
@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/)