Wednesday, April 9, 2025

rsync screensaver pics

 Commands to rsync pics to my private server and back.

rsync -avz --checksum --dry-run --ignore-existing saver/ sbargy@bargabus.com:~/saver 

  • -a archive (lots of things including recursive)
  • -v verbose
  • -z compress on sync
  • --checksum use checksum for file comparison, not just size/date
The trailing / in first directory indicates use all files in that directory. 

Wednesday, April 2, 2025

Key-repeat suddenly stopped working in VSCode

 I had just fired up copilot and thought that was the cause.  I was editing a file in VSCode and had the Vim extension installed.  I use HJKL to move around a file, often holding down the key to move multiple lines.  It stopped working.  The K key would also pop up an Apple press and hold autocomplete suggestion that just contained a single k.

I removed the CoPilot extension and this behavior continued.  After much search, found this SO question.

This command turns off ApplePressAndHold for the VSCode application...

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

Set True to re-enable.

UPDATE:

Had the same issue with Windsurf/Codeium.  Tried the following

defaults write --app Windsurf.app ApplePressAndHoldEnabled -bool false

 The --app flag threw an error.  To find the Bundle ID of an application:

codesign -dr - /Applications/Windsurf.app

Executable=/Applications/Windsurf.app/Contents/MacOS/Electron
designated => identifier "com.exafunction.windsurf" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "83Z2LHX6XW"


So, the following worked for Windsurf...

defaults write com.exafunction.windsurf ApplePressAndHoldEnabled -bool false

Monday, November 28, 2022

vi style line editing in csh

 This is the csh version of the "set -o vi" in bash...

bindkey -v

Thursday, July 7, 2022

Search for a filename in GitHub

 Search for a filename in GitHub (all repos in an account or a single repo) with:

filename:user.rb

Wednesday, February 9, 2022

Ignore whitespace in vimdiff

 Add the following to the vimdiff command line...

-c 'set diffopt+=iwhite'

Sunday, May 17, 2020

Mount OS/X samba share on Linux

sudo mount.cifs --verbose //192.168.1.11/scott bargamac/ -o user=scott,rw,vers=1.0

Thursday, April 23, 2020

datediff bash function

Datediff function to return the number of days between two dates.  It's not too robust, but I got it working on MacOS and Linux, mostly to accommodate the differences between GNU Util date and HomeBrew BSD date...

datediff() {
    date --version >> /dev/null 2>&1
    RETVAL=$?
    if [ -e /usr/local/bin/gdate ] && [ $RETVAL -ne 0 ] ;
    then
        DATEBIN=/usr/local/bin/gdate
    else
        DATEBIN=`which date`
    fi

    d1=$($DATEBIN -d "$1" +%s)
    d2=$($DATEBIN -d "$2" +%s)
    echo $(( (d1 - d2) / 86400 )) days
}