Skip to content

Instantly share code, notes, and snippets.

View btgoodwin's full-sized avatar

Thomas Goodwin btgoodwin

View GitHub Profile
@btgoodwin
btgoodwin / configure_nat_bridge.sh
Created July 23, 2020 13:23
CentOS 7 NAT configuration
#!/usr/bin/env bash
# In this configuration, there are two networks:
# eth0 -> a "WAN" into the office network
# eno1 -> a "LAN" of attached vendor hardware on network 192.168.0.0/24
# this interface's IP is 192.168.0.1, and attached hardware use
# that address as their GATEWAY.
WAN_INT="eth0"
LAN_INT="eno1"
LAN_NET="192.168.0.0/24"
@btgoodwin
btgoodwin / vivado-on-m1-mac.md
Created June 21, 2023 12:56 — forked from sohnryang/vivado-on-m1-mac.md
Vivado on ARM64 Mac using Rosetta 2

Running Vivado on ARM64 Mac using Rosetta 2

macOS Ventura supports running x86-64 binaries on Linux VMs. However, even with Rosetta installing Vivado is not a simple one-click process. This guide covers some workarounds and tricks to get Vivado up and running on ARM64 Mac.

  1. Make sure you're running macOS Ventura or higher.
  2. Install UTM and create a Debian VM with Rosetta according to their guide.
    • Other distributions should also work, but commands will be different.
  3. Install x86-64 version of java and libtinfo. Vivado depends on them.
@btgoodwin
btgoodwin / launch.json
Created October 17, 2023 12:57
VSCode GDB Launch Settings for GStreamer's "gcheck" test framework
{
"configurations": [
{
"name": "Debug GCheck Test",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/path/to/executable",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
@btgoodwin
btgoodwin / Example.md
Created August 8, 2024 13:40
How to: rebase feature branch off remote that is repeatedly force-pushed

Let's say you have a feature branch based off a different feature branch. Someone force-pushes against that branch and now your branch cannot be merely rebased or even merged against that branch because all those mismatched commits end up being treated as if they're actually yours (when they weren't). A potential recourse is this:

git fetch <remote>
git rebase --onto <remote>/<upstream branch> \
    <local feature branch>~N \
    <local feature branch>

The value of N is the number of commits in your local branch that are your extensions to that remote branch. So if you originally based off the remote branch and added 6 commits, N = 6.