Monday, March 30, 2026

Laptop battery level from Linux CLI

upower --enumerate
 
# note battery entry, i.e. /org/freedesktop/UPower/devices/battery_BAT0
 
upower -i /org/freedesktop/UPower/devices/battery_BAT0
 
or 
 
acpi -b
 
or
 
inxi -B

Monday, March 23, 2026

Clone gitlab repo with access token

 When cloning a repo, you may get an error like:

remote: HTTP Basic: Access denied. If a password was provided for Git authentication...

 Go to GitLab and create a Personal Access Token if you don't already have one.  Copy that token use it to clone the repo

git clone https://<user>:<token>@gitlab.com/<repo_name>.git

Where <token> is the token. 

If the token expires or is revoked, you will need to generate a new token and add a new remote for the repo

git remote add origin https://sbargabus:<token>@gitlab.com/<repo_name>.git

And set up remote tracking

git branch --set-upstream-to=origin/main main

 

Wednesday, February 25, 2026

MacOS: create a password encrypted zip file

 To create a password-protected ZIP file on macOS, open iTerm and use the command  

zip -er filename.zip ./path/to/folder

Replace filename.zip with your preferred name and ./path/to/folder with the path to the folder you want to compress, then enter a password when prompted.

Wednesday, October 15, 2025

MariaDB database location

 Location can be found in the database itself:

select @@datadir; 

Thursday, October 9, 2025

How to Fix 'No Matching Host Key Type Found' on Mac

Add the following to your .ssh/config with the appropriate IP address 

Host 123.123.123.123
HostKeyAlgorithms +ssh-rsa

 https://www.iclarified.com/87910/how-to-fix-no-matching-host-key-type-found-on-mac

Tuesday, September 16, 2025

Diff of two pdf files

 Install on MacOS

 brew install diff-pdf

I used the follow for a visual diff:

diff-pdf --view earthscope-org-chart-2025-09_03_posted.pdf earthscope-org-chart-2025-09_12_posted.pdf

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.