Skip to content

Instantly share code, notes, and snippets.

View jdiamond's full-sized avatar

Jason Diamond jdiamond

  • 04:50 (UTC -07:00)
View GitHub Profile
@jdiamond
jdiamond / oui.md
Last active November 15, 2016 21:32
systemd OUI service

This unit file changes the OUI in the MAC addresses for enabled interfaces. It leaves the remaining bytes as is.

Copy oui@.service to /etc/systemd/system.

Enable it for each interface like this:

sudo systemctl enable oui@eth0
sudo systemctl enable oui@wlan0
@jdiamond
jdiamond / notes.md
Created August 16, 2017 21:55
Testing React apps and components

"Injecting" configuration into a create-react-app is done with environmental variables. I always have at least one for the root of my REST API or GraphQL endpoint.

When running in development, I set that variable to point at a local version of the backend server I have running on my laptop. That's some other project that I do whatever I need to in order to get it running and available to accept requests from my React app.

If I wanted to start simple with static JSON files, maybe I would use something

@jdiamond
jdiamond / Dockerfile
Created November 16, 2017 02:24
SSH certificates
FROM alpine
# Install OpenSSH:
RUN apk -U add openssh
# Generate host keys:
RUN ssh-keygen -A
# Create users:
RUN adduser -D user1
@jdiamond
jdiamond / package.json
Created September 11, 2020 03:12
top-level await
{
"type": "module"
}