Skip to content

Instantly share code, notes, and snippets.

View Skenvy's full-sized avatar

Nathan Levett Skenvy

View GitHub Profile
@Skenvy
Skenvy / ABOUT.md
Last active November 10, 2022 03:43
Using dependabot's file_fetchers offline

The context for this example is wanting to parse an already existing local clone of a repository, without additional network traffic and without providing configuration to access a potentially private repository, if we already have a clone of it and want to use the functionality that dependabot provides of parsing for the files its ecosystems expect.

This provides an example of how to monkey patch the gem dependabot-common@0.212.0 to enable the result of the below example that wraps fetcher.files.map(&:name), provided in the file_fetchers README;

puts "Fetched #{fetcher.files.map(&:name)}, at commit SHA-1 '#{fetcher.commit}'"

A quick bundle install should set you up

@Skenvy
Skenvy / README.md
Created March 5, 2022 11:46
Initial Headless Setup with RPi3B+ OS (Buster)

Initial Headless Setup with RPi3B+ OS (Buster)

  1. Download the latest version of Raspberry Pi OS
    • with the caveat that there was a change to camera utility between buster and bullseye.
    • This was tested on an older Buster image
  2. Download the Imager and use it to impact the downloaded zip's .img onto the MicroSD
  3. touch ssh in the boot drive's /, to enable one-time ssh if headless
  4. ssh -vvv pi@raspberrypi.local when connected by ethernet and powered on. (Which includes approving the ECDSA fingerprint)
  5. Enable the ssh server perpetually, rather than the one-time start up.
    • sudo raspi-config, select Interface Options, then select SSH, then confirm with Yes, OK, Finish
  6. Change the [password](https://www.raspberrypi.com/documentation/computers/configuration.html#s
@Skenvy
Skenvy / README.md
Last active June 20, 2024 15:24
SSH for multiple GH accounts

SSH for multiple GH accounts

While a proper ~/.ssh/config can be great, this should be a minimal way to set up new keys for using multiple accounts on Mac, Windows, and WSL, and covers some of the traps in simultaneous use of Windows AND WSL.

Creating a new key

To connect from "this machine" to a new GH account. While ~ will be different from your windows and WSL's perspective, WSL's ~/.ssh should be a soft link to your window's ~/.ssh, so it's ok to use either

# Make the soft link, if it doesn't yet exist.
# Might need to mkdir if this is your first key.
YOUR_WINDOWS_USERNAME=example
mkdir -p /mnt/c/Users/$YOUR_WINDOWS_USERNAME/.ssh
ln -s /mnt/c/Users/$YOUR_WINDOWS_USERNAME/.ssh ~/.ssh