Aubrey Portwood
Senior WordPress Developer/Engineer, Stoic, Girl-Dad², Tennis Player, INTJ,
Enneagram 1, & Vintage Computer Tinkerer—based in Albuquerque, NM.

Posts

How to run commands in a sub-shell and suppress output in the background that’s ZSH & shellcheck compatible

TL;DR: This works:

( (
    bar
    foo
) 1>&2>& & )

So, basically, what this does is run a sub-shell then bury your commands in another sub-shell and closes all STDOUT being reported and is sent to the background. I honestly am still not sure how this works!


&!

Because I use shellcheck with my zsh scripts, the following flagged an unknown error in shellcheck (because shellcheck does not support zsh at the moment) and it wouldn’t lint the file:

() (
    foo
    bar
) &> /dev/null &!

Specifically, it was the &! that wasn’t working (but is a valid ZSH directive to suppress background output). I would always get job output at the least using most of the suggestions, e.g., on Stack Exchange. So, I went down a Googling rabbit hole with no answers until I landed on:

https://www.baeldung.com/linux/run-multiple-commands-in-background

After navigating the formatting issues, I came up with the above Bash-compatible solution to run commands in the background with no output!

🙌

How to show all subtasks in Asana

Okay, so the problem is simple, and if you’re reading this you already know what it is: when you open a task with lots of subtasks you have to click Load more subtasks… every time…

Screenshot

That’s annoying, and Asana should change that. But, in the meantime, here’s what you can do to beat the system.

First, download (and pay; it’s worth it) WebCatalog and install Asana.

Screenshot

Once you do that you can run asana.com in a WebApp you can launch from your Applications. Sweet.

Now, the next part is simple. Go to the settings once you load the WebApp and go to Developers > JS Code Injection…

Gif

Add the below to the code section:

/**
 * Automatically Open Subtasks in Asana
 *
 * Note, if you use WebCatalog, just add this to the JS code
 * injection, it works.
 *
 * Also, this version checks for links to click indefinitely, vs how
 * the original only ran for 10 seconds.
 *
 * @see   https://forum.asana.com/t/allow-to-load-all-sub-tasks-at-once/43620/12
 */
(function () {
    window.setInterval(() => {
        let links = document.querySelectorAll('.SubtaskGrid-loadMore');

        if (links.length === 0) {
            return;
        }

        Array.from(links).map((link) => {
            link.click();
        });
    }, 2000);
})();

Restart the app, and now, when you pull up a task, by the time you scroll down to the section for more sub-tasks, it will have been expanded for you.

Image description

I would advise you to take a look at the rest of the settings in the App too, and I personally use Choosy to open asana.com URLs in my Webapp.

How to run your system PHP at 8.x & Laravel Valet at 7.x

Please see comments for some important updates!

Screenshot

Valet, when told to use a specific version of PHP (using valet use) symlinks $HOME/.config/valet/valet.sock (on macOS) to a specific version of PHP installed on your system. If you use valet use, unfortunately, it switches this symlink and your system PHP version.

But all you need to do is (with Homebrew) use brew unlink php && brew link php@8.1 --force --overwrite to tell your system to use PHP 8.1.x. That does not tell Valet what version to use; valet use does.

If you use, for example, valet use php@7.4, you can simply use brew unlink php && brew link php@8.1 --force --overwrite to re-link your system back to using PHP 8. If you look at $HOME/.config/valet/valet.sock, you will notice it’s still symlinked to valet74.sock, and you can confirm with, e.g., phpinfo().

It’s a bit of a hack, but it works for me.

Take a look at some aliases I have set up to make this easy with valet@7, which ensures my system continues to run 8.1.

How web-app creators (that I’ve tried) fall short still…

I’ve been trying to get back to using web-apps as separate apps outside of my browsers for a few weeks. Each of them falls short of me moving away from browsers + profiles, and I thought sharing those would help someone else:

WebCatalog

  • Link handling UX is difficult to use and is REGEX based.
  • Userscripts UX is also hard to use.
  • Notifications do not always work.
  • No tabs (deal breaker for e.g., Github).

Unite

  • Sometimes new tabs do not work.
  • New tabs always show the toolbar permanently.
  • Uneven toolbar UI.
  • No custom User Agent configuration; Google stuff doesn’t work.

Fluid

  • Old, hasn’t been updated in a long time!
  • JavaScript that opens new tabs to URLs not in your whitelist do not get thrown to the external default browser, but instead a new tab is opened.

Right now I’m still using Google Chrome profiles for most of the things. For Asana (because I feel it needs to be a separate app, and I have a few custom userscripts), I’m using WebCatalog so it throws new link clicks (handled by JavaScript) to my default browser (Choosy).

Fluid is probably the best of the bunch right now, and I can use tabs (though the UI looks outdated and clunky) for Github, which I feel tabbed browsing is a must.

WebCatalog has the most potential, if only they would find a way to allow tabs!

How to fix Mail.app on Mac taking long time to load

The answer is here, but I wanted to post with something that would catch Google searches, since none of mine today worked until I was trying to delete Mail.app all-together to re-install it (which you can’t really do).

But, just run:

killall Mail &> /dev/null; mv ~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist ~/Desktop && open -a Mail

If it works, delete the com.apple.mail.plist file on your Desktop!

…it worked on my machine 😉

I did have to re-set all my Mail.app settings again, but worth it!

In Process.php line 441: The process has been signaled with signal “6” when running composer on Mac

As you can see, I’ve been through some hell this morning. First of all, you’re only going to get presented with:

In Process.php line 441:

  The process has been signaled with signal "6".

…if there is a composer.json file in the current working directory, so if you run composer right now in, say, $HOME you’re going to think it’s working, but if you’re here you likely have figured this out…

I did so much googling this morning. But I eventually landed on this, which gave me a clue…

Running composer -vvv I saw the same thing, and running svn --version I was presented with a new error:

dyld[92827]: Symbol not found: aprcryptoblockcleanup
  Referenced from: /opt/homebrew/Cellar/subversion/1.14.2/lib/libsvn_subr-1.0.dylib
  Expected in: /usr/lib/libaprutil-1.0.dylib

So I reinstalled svn, php, and composer a bazillion times, no effect. But then I landed on this in my googling and figured, what the hell and ran the suggested fix on that seemingly unrelated issue:

brew reinstall apr-util

And…it worked! I don’t really know what apr-util is, but it seems to have at least fixed my problem for now, and hopefully yours!

WP-CLI LocalWP without “Open Site Shell” (redux)

This is going to be short (I’ve been meaning to write it for a while), but first go read this post by my good friend Sal Ferrarello as a precursor to this one, then come back and read this.


Now that you’ve read Sal’s post, you can actually do this easier now using Local:

You don’t need to create a wp-cli.local.yml or wp-cli.local.php file; all you need to do is edit your current wp-config.php and find this section:

CleanShot 2022-04-11 at 11.24.10@2x.jpg

Now change the part where you have define( 'DB_HOST', 'localhost' ); and change it to:

defined( 'WP_CLI' ) && WP_CLI
    ? define( 'DB_HOST', 'localhost:/Users/aubreypwd/Library/Application Support/Local/run/do55POv0/mysql/mysqld.sock' )
    : define( 'DB_HOST', 'localhost' );

…and replace /Users/aubreypwd/Library/Application Support/Local/run/do55POv0/mysql/mysqld.sock with your sock file from Local:

CleanShot 2022-04-11 at 11.19.14@2x.jpg

…and that’s all you need to do now!

CleanShot 2022-04-11 at 11.26.42@2x.jpg

My naive idea to replace my iPhone 📱 with my Apple Watch ⌚️

Last Thursday, I had an idea I was surprised I hadn’t had before. The idea was could I replace my iPhone with an Apple Watch? I already own the SE model Apple ⌚️, and I find my iPhone to be extremely distracting to keep around. I especially get sucked into apps that deliver content you don’t ask for and loath anything that resembles reels, tiktoks, or YouTube stories. I just can’t stand those kinds of apps and how they suck you in. Kind of hard to do on a ⌚️ screen though! Right!?

I’m not sure why this didn’t dawn on me earlier, but when it did, I set out to use just my ⌚️ for the weekend (plus Thursday & Friday) as a test.

….And…. I can’t just get rid of my iPhone, namely because of these main issues I found during my four day experiment:

  • Can’t Google things on-the-fly on a ⌚️
  • Banking not really possible on a ⌚️
  • Some apps just don’t work on a ⌚️ or on a 💻
  • Can’t tweet on the go!
  • Can’t take a picture of a thing on a ⌚️
  • Can’t edit calendar entries on the go!
  • Can’t read books (audiobooks are great) on a ⌚️
  • Can’t setup your ⌚️ or configure it w/out a 📱 anyways

..and probably many more I can’t remember right now.

These are things I could live without if I had to, but it just wouldn’t be worth it. But, having to keep my phone in my pocked for four days helped me learn that most of the things I do on my 📱 I can do on my :watch:, like:

  • Audiobooks
  • Note-taking (Voice Memos)
  • Messaging
  • Calling
  • Music
  • Reminders
  • Set timers
  • View my account balances (some banking)
  • Pay for things (Apple Pay/Starbucks)
  • Two-factor Authenticate
  • Even look things up on Yelp

…and so, even though I can’t just sell my iPhone and use my Apple Watch 100% of the time I did learn I could probably use my ⌚️ 80% of the time to do most things. And so 80% of the time I’m at home my phone will likely live in my office or bedroom and I will just keep my ⌚️ on me. If I need to Google something, I’ll go get it. My 📱 will likely go with me when I’m out and about though, but for most things (including navigation, music, podcasts, etc) I’m just going to keep it in my pocket and try do do as much with my ⌚️ as I can.

I might even invest in a cellular version of my ⌚️ so I can leave it at home when I’m out and about and I know I won’t have to e.g. do some banking or something (e.g. I’m out hiking, walking, or something). I want to use my ⌚️ more, and I think that’s worth failing at this experiment!

But… I still think the ⌚️ is going to eventually become the new 📱 (e.g. you won’t have a 📱, you’ll just have a ⌚️)…but that’s a little farther in the future.

Discipline of Desire: Value Valuation

The idea below is a tool I use to help me valuate my judgements of things using the Discipline of Desire formatted into a scoring system. I just write something down, score it, compare it to other things on my list.

It uses 4 points to measure:

  • Excellence in Character: Are you doing the right thing?
  • Social Value: Does everyone enjoy it?
  • Helpfulness: Does it help along your path towards an excellent character?
  • Naturalness: Is this something found regularly in nature, or is it un-natural?

It’s not perfect, but it’s quick and mostly in-line with the Discipline of Desire.

Below you will see kindness, above all, is most valuable (especially your own), good weather is only slightly preferred over bad weather, and racism is strongly in the negative, mostly because it’s also un-natural, for example, compared to stealing.

It’s just a helpful (and quick) mechanism that helps me put my value of things into a easy to call-upon system.

The Point System

  • Excellence (virtue)
    • It is excellent character +1
    • It is not excellent character -1
    • Not an act of character 0
  • Nature (universal harmony)
    • Natural +1
    • Un-natural -1
  • Socially Valueable (it serves everyone)
    • Socially valuable +1
    • Socially invaluable -1
    • Socially neutural 0
  • Helpfulness (indifference)
    • Helpful to excellent character +1
    • Unhelpful towards excellent character -1
    • Neutural effect on excellent character 0

Examples

Kindness +4

  • It is excellent character +1
  • Socially valuable +1
  • Helpful to excellent character +1
  • Natural +1

Kindness (from others) +3

  • Not an act of (your) character 0
  • Socially valuable +1
  • Helpful to excellent character +1
  • Natural +1

*Yes, I chose to place kindness (from others) as helpful towards developing good character (preferred), but out own kindness is obviously more important!

Sex +2

  • Not an act of character 0
  • Socially valuable +1
  • Neutural effect on excellent character 0
  • Natural +1

Good Weather +2

  • Not an act of character 0
  • Socially valuable +1
  • Neutural effect on excellent character 0
  • Natural +1

Bad Weather +1

  • Not an act of character 0
  • Socially invaluable -1
  • Helpful to excellent character +1
  • Natural +1

Stealing -2

  • It is not excellent character -1
  • Socially invaluable -1
  • Unhelpful towards excellent character -1
  • Natural +1

*Note, the reason stealing can be seen as natural, is because even in the animal kingdom stealing happens normally.

Racism -4

  • It is not excellent character -1
  • Socially invaluable -1
  • Unhelpful towards excellent character -1
  • Un-natural -1

*Note, here, how racisim, though, is un-natural, as it is not something seen elsewhere in nature