git ls-files | Measure-Object -line
There must be a very good reason why we complicated our lives with all these technologies ... arguably that is freedom for something. Freedom might be a right but it is never free; so let me demonstrate how I earned it.
Monday, June 27, 2022
Counting tracked files in a Git repo, in PowerShell
Tuesday, June 21, 2022
Android File Transfer and Multi-user macOS
I had some issue with Android File Transfer, which was related to specifically Galaxy S21. Later a similar issue - symptom wise anyway ("could not connect to device") - developed, but sporadically happened to all sorts of devices, from tablets to Oculus. Eventually I figured it out, and purely by luck and intuition, that it was due to multiple user (interactive UI) sessions ongoing at the same time. My theory is that upon connection, the app sends whatever signal to the UI/logged in user, it'd get multiple responses back, which confused the app and led it to refuse the connection. It's very much a personal app I guess...
Sunday, February 13, 2022
Unexpected behavior when using -p twice with sfdx (Salesforce CLI)
This is kind of a lesson about not assuming a program behavior.
I had 2 metadata items to deploy: one trigger, one custom metadata. I was working on the trigger first, and had been using this command to deploy it and bang it against different orgs.
sfdx force:source:deploy -u qa -p ./force-app/main/default/triggers/TaskTrigger.trigger -c -l RunSpecifiedTests -r TaskTriggerTest
When I decided to also add changes to the custom metadata, I just added the second file as an additional param instead of back cursor the command to modify it (lazy, I know), so the command became
sfdx force:source:deploy -u qa -p ./force-app/main/default/triggers/TaskTrigger.trigger -c -l RunSpecifiedTests -r TaskTriggerTest -p ./force-app/main/default/customMetadata/Feature_Setting.TaskTrigger.md-meta.xml
Here's where the trouble began. The command seemed to run just fine, but slowly I noticed the changes (which were simple) just didn't seem to stick and show up in the test run, after having a few puzzling run results and checking debug log. It was as if that the command deployed the files, and then decided to run the tests with the old file versions. When I switched to using -x and list the 2 files in a manifest file, and all was well as expected.
It seems to be a completely unexpected (and undocumented AFAIK) behavior, but, in the end, I only had myself to blame to stumble on it. 🤷
For the record, my sfdx was 7.137.1.
Friday, December 17, 2021
How to get rid of icons stuck on screen from macOS Launchpad
I think this happened to me the most with Zoom. If I accidentally dragged its icon when I tried to open it from Launchpad, the icon just oddly hung around on screen (and over all windows too). Goes without saying it's quite annoying. The solution here is to relaunch Dock by killing the process with this command.
killall Dock
Restarting of course also works, but that's much less convenient. Occasionally the Dock doesn't come back after being killed then I'd have to restart anyway, but that's quite rare thankfully.
Wednesday, October 20, 2021
"git pull" failed with "cannot lock ref"
This was the first time I ran into the issue.
Some search turned up a list of remedies, but only this command worked for me.
git gc --prune=now
which basically does a set of housecleaning tasks on the local repo.
Saturday, October 9, 2021
Winter '22 changed Salesforce app's default behavior
Winter '22 has changed the Salesforce mobile app's default behavior, but not exactly how you'd gather from reading the Release Notes, which states
"The
Salesforce mobile app now selects the first available Lightning app by
default—instead of Mobile Only—which results in a change to the app’s
bottom navigation bar. Users who don’t have access to any
phone-activated Lightning apps still default to Mobile Only."
Granted, I didn't read the Release Notes, but even if I had, that wouldn't have been what I expect to happen once Winter '22 hit and I opened the Salesforce app for the first time. This is what greeted me:
"You don't have access to any apps. Your admin can help with that."
The mobile app was happily showing me recent records and other goodies as you'd expect from a default mobile setup. After it donned on me that Winter '22 just hit the night before, some searching around landed me on the language in the Release Notes, but no matter how I read it, I understand it as that if I had no mobile (phone) enabled Lightning App (which is the situation with the test org), the mobile experience wouldn't have changed, because it should have still loaded the Mobile Only navigation. And Mobile Only hasn't been disabled as far as I can tell (documentation about it is also confusing as hell), which is something else that could cause this weird No Objects screen (reported as a Known Issue).
After figuring it out (hopefully that's all of it), I went ahead and enabled one of the Lightning App. I cleared the cache and restarted the app, and the familiar UI is back. Sigh of relief...
Update 10/11/21: the problem happened one more time. After checking all the settings to be fine, I cleared the app cache again, and it started working. Feels like there's some internal flakiness to the app...
Tuesday, September 14, 2021
VirtualBox: kernel driver not installed (rc=-1908)
This is deja vu - I'm sure of it.
By now I've seen the pattern behind this error, which prevents a VM (mine's an Ubuntu 20.04) from starting. It always happens after a macOS (host) upgrade, which would usually have a new kernel version I think, thus requiring the kernel extension for VirtualBox to be upgraded - at least that's my theory. So I downloaded and installed the up-to-date version of VirtualBox. The first time launching of the app after installation prompts an upgrade of the extension pack, which is handy! I finished that, and hit the Start button. Same error. 😢😢
What I forgot (not the first time) is this:
The OS automatically blocks the new extension until it's authorized here in the Security app. I vaguely remember the VBox upgrade installation would remind me, but not this time at least. Hopefully this has a better chance being committed to my memory after I write it down on a post.
Last thing to remember - restart the computer after the extension is allowed so it can take effect. Then I'll have the sweet moment of finally getting back into my VM!