What I’ve been doing

Not blogging at all, apparently. Not to say that I haven’t been keeping busy. Here’s a brain dump, quick, before I lose the will to write…

Scripting my own xbar plugins

I’m leaning hard into my work Macbook, combined with Emacs (Org mode ftw), Aerospace and Qutebrowser for an optimized, keyboard-driven workflow.

I don’t need many screens anymore, at home I’m content with one: I switch between application-focused screens/workspaces with Aerospace (think ‘E’ for Emacs, ‘T’ for Microsoft Teams, ‘Q’ for Qutebrowser), fly around my web apps with Qutebrowser and managed to sync my Outlook calendar and Jira tickets to my Emacs Org agenda (I should really blog on that sometime…👀).

Lately I added xbar to use the omnipresent MacOS menu bar for actually useful information and found myself scripting and reworking xbar plugins. What I have so far:

Current Wi-Fi SSID name (simple)

#!/bin/bash
# <xbar.title>Current wifi name</xbar.title>
 
current_wifi=$(networksetup -getairportnetwork en0)
 
if [ "$current_wifi" = "You are not associated with an AirPort network." ]; then
echo "No wifi"
else
    echo "$current_wifi"
fi

Upcoming item in an Emacs custom Org agenda (a little longer)

#!/bin/bash
# <xbar.title>Org Agenda next scheduled item and calendar>
 
emacsclient --eval "(org-store-agenda-views)" &> /dev/null
 
 
current_hour=$(date +"%-H")
# current_hour=$((10#$current_hour))
# current_hour=$(date +"%l")
# echo "current_hour is: $current_hour"
upcoming_hour=$((current_hour+1))
# echo "upcoming_hour is: $upcoming_hour"
 
filename_sanitized="<path-to-an-org-agenda-views-output-file>"
 
 
until [[ $upcoming_hour -eq 23 ]]
do
 
# echo "current_hour is: $current_hour"    
emacs_scheduled_current_hour=$current_hour":"
# echo "emacs_scheduled_current_hour is: $emacs_scheduled_current_hour"
# current_meeting=$(grep -h ^$emacs_scheduled_current_hour $filename_sanitized)
current_meeting=$(grep -h -E "$emacs_scheduled_current_hour[0-9]{2}-" $filename_sanitized)
# echo "current_meeting after grep is: $current_meeting"
 
# echo "upcoming_hour is: $upcoming_hour"    
emacs_scheduled_upcoming_hour=$upcoming_hour":"
# echo $emacs_scheduled_upcoming_hour
# echo "emacs_scheduled_upcoming_hour is: $emacs_scheduled_upcoming_hour"
# upcoming_meeting=$(grep -h ^$emacs_scheduled_upcoming_hour $filename_sanitized)
upcoming_meeting=$(grep -h -E "$emacs_scheduled_upcoming_hour[0-9]{2}-" $filename_sanitized)
# echo "upcoming_meeting after grep is: $upcoming_meeting"
  
if [ -n "$current_meeting" ]; then
        if [[ $current_meeting == *$'\n'* ]]; then
             readarray -t current_multiple_meetings <<<"$current_meeting"
             printf "%s," "Current meetings are: ${current_multiple_meetings[@]}"
             # for meeting in ${current_multiple_meetings[@]};
             # do
             # echo "Current meeting: $meeting"
             # done
        else
            echo "Current meeting: $current_meeting"
        fi
   break 
fi
 
if [ -n "$upcoming_meeting" ]; then
    if [[ $upcoming_meeting == *$'\n'* ]]; then
        readarray -t upcoming_multiple_meetings <<<"$upcoming_meeting"
        printf "%s," "${upcoming_multiple_meetings[@]}"
        # for meeting in ${upcoming_multiple_meetings[@]};
        # do
        # echo "Upcoming meeting: $meeting"
        # done
    else
        echo "Upcoming meeting: $upcoming_meeting"
    fi
   break 
fi
 
((upcoming_hour++))
 
done
 
if [ -z "$current_meeting" ] && [ -z "$upcoming_meeting" ]; then
echo "No (upcoming) meetings"
fi

Maldev Academy

About a month ago I discovered the ‘objectives’ button in the wonderful ‘Malware Development Course’ offered by Maldev Academy I’ve been following (check out my mess of notes). I’ve been doing these diligently and learned a lot so far. Some examples:

  • Don’t try to use for example NTAllocateVirtualMemory directly (without syscalls) and try to somehow find a missing header file (ntifs.h) in other Windows SDK-folders and try to link to them (or be prepared for about a million other errors)
  • Pass by reference and pass by value (yes, I know, fundamental, but still important to remember)
  • Different ways to allocate and free memory (malloc, free, HeapAlloc, etc.)

Progress feels slow (I basically picked this course back up I don’t know how many times) but doing the objectives makes it feel more targeted and useful. I’ll stay at it! Currently at Module 6 ‘Windows Memory Management’.

Music!

My band Through the Trees in the past few months have had a few fun gigs, an actual radio performance (on a local band program hosted by a regional station) and I have been singing more (which felt absolutely terrifying at first doing live, but I’ve been getting used to it).

And I remembered how much I love singing: playing bass feels good, but singing really takes me out of my head and in the moment.

We do some covers, so far they are:

  • Wasted years (Iron Maiden, in an acoustic version, of course)
  • Still haven’t found what I’m looking for (U2)
  • Bleed to love her (Fleetwood Mac, wonderful song, fun harmonies)
  • Folsom Prison (Johnny Cash, a personal favorite, was wonderful to sing at a Dutch western shop and bar recently)
  • Wicked Game (Chris Isaak, love that album Blue Hotel, I sing this song as well)
  • And more to come!

See you soon 👋