09 Apr 2025
|
ssh
linux
When configuring SSH keys, it’s crucial to set the correct permissions on the .ssh
directory and its contents. Incorrect permissions can prevent SSH from working properly.
Here’s a handy command to check file permissions in numeric format (like 0700
, 0600
, etc.), which is especially useful when setting up your SSH directory:
stat -c "%a %n" ~/.ssh ~/.ssh/*
This may produce an output like the following if permissions have been set correctly.
700 /home/user/.ssh
644 /home/user/.ssh/authorized_keys
600 /home/user/.ssh/id
644 /home/user/.ssh/id.pub
07 Apr 2025
|
git
Need to see who contributed to a specific folder or module in your codebase? Here’s a quick Git command that gives you a clean, CSV-style output:
git log --pretty=format:'%h,%ad,%an,"%s"' --date=short -- path/to/module
For example:
git log --pretty=format:'%h,%ad,%an,"%s"' --date=short -- my_app/data_loader
This may yield something like,
a1b2c3d,2024-11-02,Alice Johnson,"Refactored batch loading logic"
d4e5f6g,2024-10-20,Bob Smith,"Added support for CSV files"
h7i8j9k,2024-09-10,Alice Johnson,"Initial commit for data_loader"
Quick, clean, and super helpful.
24 Mar 2025
|
git
If you’ve ever wanted to quickly measure how much code you or your team have written in a Git repository, there’s a neat little command-line trick that can help — without the need for manually downloading ZIPs or scanning the entire project history. Enter: cloc-git
.
The StackOverflow answer to “Can you get the number of lines of code from a GitHub repository?” shares a clever one-liner using cloc and Git:
git clone https://github.com/some/repo.git
cd repo
cloc .
Want to make this reusable? Wrap it into a script:
#!/usr/bin/env bash
git clone --depth 1 "$1" temp-linecount-repo &&
printf "('temp-linecount-repo' will be deleted automatically)\n\n\n" &&
cloc temp-linecount-repo &&
rm -rf temp-linecount-repo
23 Mar 2025
|
macos
chromium
Ungoogled Chromium is a privacy-focused alternative to Google Chrome. While it offers the speed and compatibility of Chromium, it removes all background connections to Google services. This means:
- No automatic sign-ins or telemetry.
- No Google sync or profile linking.
- A much cleaner privacy baseline out of the box.
If you’re concerned about data collection or want a browser that respects your independence from the Google ecosystem, Ungoogled Chromium is a strong alternative.
Installing Ungoogled Chromium on macOS
If you’re using Homebrew, installing Ungoogled Chromium is easy:
brew install eloston-chromium
The Problem with Extensions
Ungoogled Chromium doesn’t allow installing extensions directly from the Chrome Web Store by default. This is part of its design: no automatic connections to Google means no direct Web Store access.
For example, if you try to install the Strongbox Autofill extension, you’ll see something like this:
“Extension disabled” or “Apps, extensions, and user scripts cannot be added from this website.”
But don’t worry—you can still install extensions manually.
Steps to Manually Install Extensions
Step 1: Install the Chromium Web Store Extension
This lets you install extensions from the Chrome Web Store, bypassing the default block in Ungoogled Chromium.
- Visit this mirror of the Chromium Web Store extension:
https://github.com/NeverDecaf/chromium-web-store
- Click the green Code > Download ZIP button, then extract the ZIP file.
- In Ungoogled Chromium:
- Navigate to
chrome://extensions/
- Enable Developer mode (top right toggle).
- Click Load unpacked, and select the folder you just extracted.
Now you’ll see the “Add to Chromium” button enabled again on extension pages.
Step 2: Install the Desired Extension
Go to the Strongbox Autofill extension page. With the Chromium Web Store extension installed, the “Add to Chromium” button should now work.
Click it to install Strongbox Autofill just like on regular Chrome.
Step 3: Confirm and Pin the Extension
- Head back to
chrome://extensions/
to confirm it’s installed and enabled.
- Optionally, pin the extension to your toolbar for quick access.
22 Sep 2024
|
macos
rm2
Stream your reMarkable tablet’s screen directly to your Mac using a USB connection. This setup allows for real-time screen sharing without relying on Wi-Fi.
Setting Up SSH Access Over USB
- Connect reMarkable to Mac via USB
- Use your USB C cable to connect the reMarkable tablet to your Mac.
- SSH into reMarkable
- Open Terminal on your Mac.
- Run the following command:
- Password: Enter your SSH password. However, you can login without password by following the instructions here.
See detailed instructions here but the steps that I used are the following.
- Download the goMarkableStream Binary
- On your Mac, visit the goMarkableStream Releases page and download
goMarkableStream_0.18_linux_arm.tar.gz
. Change release numbers appropriately. At the time of writing it was 0.18
.
- Transfer the Binary to reMarkable
- In Terminal on your Mac, execute:
scp goMarkableStream_0.18_linux_arm.tar.gz root@10.11.99.1:/home/root/
- Extract the Package and Set Permissions
- SSH into reMarkable if not already connected:
- Extract the tarball:
tar xvzf goMarkableStream_0.18_linux_arm.tar.gz
- Set executable permissions:
chmod +x /home/root/goMarkableStream_0.18_linux_arm/goMarkableStream
Configuring goMarkableStream
- Create a Shell Script
pushd /etc/systemd/system
touch goMarkableStream.service
cat <<EOF>goMarkableStream.service
[Unit]
Description=Go Remarkable Stream Server
[Service]
ExecStart=/home/root/goMarkableStream_0.18_linux_arm/goMarkableStream
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable goMarkableStream.service
systemctl start goMarkableStream.service
systemctl status goMarkableStream.service
popd
- Run the Setup Script
- Execute the setup script:
sh setupGoMarkableStream.sh
- Service Status: Verify that the service is active:
systemctl status goMarkableStream
You should see:
- Change Default Credentials
- Reload systemd and Restart the Service
systemctl daemon-reload
systemctl restart goMarkableStream
Accessing the Stream on macOS
- Open a Web Browser on Your Mac
- Navigate to the Streaming URL: http://10.11.99.1:2001
- Enter the username and password you configured earlier.
Open any document notebook on the reMarkable and you should be able to view it in the URL above.