Skip to content

Instantly share code, notes, and snippets.

@Brainz22
Brainz22 / pipdeptree.md
Created July 18, 2025 19:22
Using pipdeptree

The package pipdeptree can be used to show a tree of all package dependencies in your environment. Install and use it as:

pip install pipdeptree
pipdeptree > pipdeptree.log

Then, open the pipdeptree.log file to see the tree.

@Brainz22
Brainz22 / vncserver-instructions.md
Created April 21, 2025 20:22
How to use vncserver on Fermilab correlator 4.

VNCserver on Mac

  1. You should be able to ssh into correlator 4 with something like: ssh -L 5908:localhost:5907 <LPCusername>@correlator4.fnal.gov. This ssh command will tunnel from a local port 5908 into remote the port 5907 on correlator4.

  2. Once in correlator 4, check for an existing vncserver with: vncserver -list. If there is one, you will see some output and the port for your server, e.g. you will that a port :01 exists. We shuld kill this port and create a new with vncserver -kill :01. Like check to see with vncserver -list.

  3. Create the new port with: vncserver :07 -geometry 2000x1800 and set a password if you are prompted. You can use your kinit password. Check that port :07 has been created. You can try another geometry to see what looks better on your screen.

  4. Exit correlator 4.

@Brainz22
Brainz22 / modelTest.ipynb
Created April 16, 2024 23:50
SepConv2D tests using tracing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Brainz22
Brainz22 / ManuallyInstallJupyterKernel.md
Last active July 21, 2025 22:33
Explicitly install a Jupyter kernel that points to my new virtual env to use Jupyter notebooks on VS code.

We can't simply activate Jupyter-lab or Notebook from the virtual environment, or in this case, select it on VS code. We need to explicitly install a Jupyter kernel that points to the new Python virtual environment. For that, we run the following:

python3 -m ipykernel install --user --name=projectname

project name is the name of our environment, which contains all of the packages we need. After this is done, we must restart VS code, then click select kernel on top right corner and select jupyter kernel when promted. The name of your environment should appear, thus select that for it to work.

Uninstall the kernel

  1. jupyter kernelspec list lists which kernels you installed.
@Brainz22
Brainz22 / switch-local-git-repo-to-fork.md
Last active December 9, 2023 00:22 — forked from ElectricRCAircraftGuy/switch-local-git-repo-to-fork.md
How to move to a fork after cloning. Then, next file is in case you want a new branch in your fork.

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step).

    git clone git@github...some-repo.git
@Brainz22
Brainz22 / PkgInstallFromBranch.md
Last active October 2, 2024 23:26
Clone Single Branch and pip install it
conda activate your_environment_name
git clone --single-branch --branch split_pointwise_conv_by_rf_rebase_latest https://github.com/jmduarte/hls4ml.git
cd hls4ml
git branch --all #shows you are on your desired branch
pip install -e .
@Brainz22
Brainz22 / FirstGist.txt
Created July 17, 2023 13:19
First Gist
The very first gist