-
Wow; the new Spatial Audio feature (AirPods) is cool - though rather disorienting in some situations; here’s how to control it: support.apple.com/guide/air…
-
Oh for the love of… Zoom on Mac may be recording you even when you’re not using it. How many “oops” does one org get?!
-
quick way to get notified that your other Mac (maybe a server?) has some software updates available: swupd_remote_check.sh
-
A Hack to Index Notes, for Quicksilver
First: A few presumptions; this is a hack:
- You have at least some grasp of operating at the (Mac) command-line; ex: in Terminal.
- For instance:
~
(tilde) is an abbreviation is for your homedir.
- For instance:
- You know what Quicksilver is.
- (Yes; Far as I know, it’s Mac only.)
- Debugging your setup is up to you; at the moment, I have extremely limited availability to help.
- Feel free to drop a note; on the off chance it’s possible, I will try to help.
How to set it up
- A (bash) script to list the Titles of your Notes:
- The code is in separate section below.
- Save the script to
~/dump-note-titles.sh
. chmod
it, to be executable:chmod u+x ~/dump-note-titles.sh
- Run it once, to seed the output file:
~/dump-note-titles.sh
- Open the
~/titles-from-notes-app.txt
file which it generated.- It should have a list of the Titles of your Notes.
- Keep this up-to-date, via cron:
- Edit your crontab:
crontab -e
- Add a line like this:
48 * * * * ~/dump-note-titles.sh
- Yes; cron can be a bear to debug. :/
- Edit your crontab:
- Config QuickSilver to use this new “index”:
- Add a Catalog entry, using
File & Folder Scanner
. - For the Path, select the
~/titles-from-notes-app.txt
file generated by the script above. - For the Include Contents setting, select
Text Lines
.
- Add a Catalog entry, using
- Config a new Quicksilver Action, to open Notes by title:
- Open
Script Editor.app
. - Paste the code in - see the separate section below.
- Save it, as
open note by title.scpt
(File format: Script
), to your Quicksilver Actions directory.- Which is usually here:
~/Library/Application Support/Quicksilver/Actions/
.
- Which is usually here:
- Open
How to use
- Fire up Quicksilver.
- Start typing some substring of a Note Title.
- Select the Title you want from the results.
- Select
open note by title
as the action.
bash Script
~/dump-note-titles.sh
#!/bin/bash osascript \ -e 'set outFilePath to (((path to home folder) as text) & "titles-from-notes-app.txt")' \ -e 'tell application "Notes"' \ -e 'set nameList to name of every note' \ -e 'end tell' \ -e 'set outFile to open for access file outFilePath with write permission' \ -e 'repeat with theName in nameList' \ -e 'write theName & return to outFile as «class utf8»' \ -e 'end repeat' \ -e 'close access outFile' \
Applescript
open note by title.scpt
using terms from application "Quicksilver" on process text ThisClipping tell application "Notes" show note ThisClipping end process text end using terms from
(Yes; I do intend to put this in a repo, where it belongs.)
- You have at least some grasp of operating at the (Mac) command-line; ex: in Terminal.
-
clean up sensitive (Mac) Preview files
It’s handy to print things to Preview - maybe you want to save the “security” questions and (random) answers from a new site registration, to a secure place (like 1Password) and now you’re wondering where that temporary file is - with that sensitive info.
So; fire up a terminal:
find $TMPDIR -type f -mmin -1440 -iname \*.pdf\* -print0 | xargs -0 -L1 -t -I% mv -i % ~/.Trash/; open ~/.Trash/
Notes:
- start
find
with these options / arguments:- in
$TMPDIR
- your own user’s dir for temporary files- (which will automatically get cleaned up - eventually)
-type f
- we want to find files only-mmin -1440
- files modified in the last 1440 minutes (1 day); tweak as you like-iname \*.pdf\*
- files of with an extension ofpdf*
-print0
- output results null-terminated (to handle “special” chars)
- in
|
- pipe results toxargs
, to process them using these options:-0
- handle null-terminated input-L1
- process one item at a time (if any)-t
- show commands as they’re executed-I%
- in the ensuing command, replace%
there, with the resulting filename/s
mv
- move these files, with the following options:-i
- interactive prompt (instead of overwrite)%
- the source filename, substituted by xargs~/.Trash/
- destination dir; put them here
open ~/.Trash/
- open (in Finder), for your review
- start
-
Quicksilver
I’m amazed how useful Quicksilver still is. I’ll be blogging more about it shortly.
In the mean time, here’s a quick description of how I use it (and there many features I don’t use).
- start typing the name of
thing
, and get itthing
can be a: file, app, command, function, …- the typing can be - in the middle of the name of what you’re looking for - multiple discontiguous parts of the name - great for getting to specific things quickly - it can even be a typo - which you define as what you meant; powerful - as you type, potential matches are shown for your selection - and it learns: as you make choices, those are rated higher than other potential matches
- it doesn’t matter where
thing
lives - you define what to do with
thing
; like:- search for
thing
; with DDG, in a local doc repository, … - send
thing
, to be processed bything2
- add
thing
as an argument to a command; in a shell/terminal, or AppleScript, or, …
- search for
Best part: It let’s me have a thought about
thing
, type that in, and move directly to what I want to do withthing
. All without remembering wherething
is, which app to open, and all that ancillary stuff - which often results in moving my thought process from what I intended to do, to how to do it. Or, sometimes, forgetting it altogether. - start typing the name of
-
log4j is not the problem
The central problem, is the enormous jenga tower that we’ve built:
- Full of dependencies that virtually no one understands.
- Dependencies generally chosen, for expedience.
- Chosen by coders at all levels of in/experience.
- Driven by “ship it now”, and “move fast and break things”.
- With management rarely caring about risks - until one becomes a public crisis, which can no longer be ignored.
Predictions:
- These crises will get both worse, and more frequent - bad actors (*), have noticed how vulnerable everything is.
- (* Bad actors of all stripes, not “just” in tech - and some have state-level resources.)
- Even still, there will be little fundamental change in how we write & deploy code - because most of the people making these decisions haven’t felt it. Yet.
- The “powers that be” think they’re insulated from the pain. It may not be long til they find out how wrong they are.
subscribe via RSS