Skip to content

Instantly share code, notes, and snippets.

@darwin
darwin / readme.md
Created May 29, 2021 13:29
notes on migration to travis-ci.com

I successfully migrated canary repo under my travis-ci.com account. All seems to work for now. Didn't ask for any credits of OSS yet.

The api endpoint is hard-coded so all old travis-ci.org-associated projects started failing since I switched it to travis-ci.com.

How to migrate your projects:

  1. Use the magic "migrate" button to move them from travis-ci.org to travis-ci.com (If your repos are associated with travis-ci.org, you won't see them under travis-ci.com).
  2. Travis access token is different for travis-ci.com, so old tokens won't work. Please follow the readme and update your tokens in travis.yml in the jobs branch.
@darwin
darwin / 1_unexpected.txt
Last active February 14, 2023 13:27
TotalFinder: `csrutil enable --without debug --without fs` no longer works as expected under macOS 11.x
# in recovery mode
❯ csrutil enable --without debug
# note that prior macOS 11.0 this would disable "Debugging Restrictions"
# since macOS 11.0 it seems to be disabling "Apple Internal" and "Filesystem Protections"
❯ csrutil status
System Integrity Protection status: unknown (Custom Configuration).
Configuration:
@darwin
darwin / readme.md
Created November 16, 2020 21:59
APFS Container cloning/replicating under macOS 11.0 (Big Sur) - with a bootable system

It is the year 2020 and replicating APFS containers still sucks. One would expect it would be a simple copy and paste in the Disk Utility app but this is still far from reality.

Last year I wrote how I managed to clone my macOS system under Catalina. The main trick was to create a DMG file with multiple volumes, mount it on target machine and drop to command-line to do asr restore from synthetised disk while avoiding possible pitfalls.

The good news is that Apple devs definitely worked on improving this under Big Sur and added some documentation (see man asr). But I didn't understand it fully on first read. Maybe someone could explain how is this supposed to work?

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 / _readme.md
Last active October 7, 2024 11:38
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')