Skip to content

Instantly share code, notes, and snippets.

@skseth
skseth / commands.md
Created April 2, 2023 10:31
macos - network commands

Find process listening on port

sudo lsof -i -P | grep LISTEN | grep :$PORT

How to package / distribute / install a wheel

Packaging

The following command builds a wheel for your project.

poetry build

Dependencies are listed in the METADATA file inside the wheel. You can see the dependencies by extracting this file, as the wheel file is just a zip. See the references below.

@skseth
skseth / vm-create.md
Last active January 31, 2023 12:12
Setting up a Debian Bullseye GPU Dev Machine

Create a machine

Choose

  • GPU (T4)
  • image (Debian 11 Bulleye w/ 50 GB boot disk size)
  • add an extra 100 GB disk - choose to delete when vm is deleted, and give it a custom device name to make it easier to see
  • add an ssh key if you want - give user name that you want to login as
  • make this a spot instance to save money

Now, ssh in

@skseth
skseth / mono-repo.sh
Last active January 27, 2023 10:29
Merging repos into a monorepo
# SRC_REPO, TGT_REPO are relative to current directory
SRC_REPO=$1
TGT_REPO=$2
DIR_NAME=$3
BRANCH_NAME=$4
pushd $SRC_REPO
git filter-repo --to-subdirectory "$DIR_NAME" # replace w/ your dir name
popd
@skseth
skseth / servers.md
Last active May 16, 2022 07:36
Setup Docker, Postgres, Redis and NSQ on Mac

#Postgres

##Create Postgres Dockerfile

#create fresh postgres image  
docker build -t postgres .
# du -sh - disk usage in s - summary h - human readable format
# grep -E "\dG" - filter out items with a digit followed by G - gigabyte
du -sh * | grep -E "\dG"
@skseth
skseth / osx_setup.md
Last active January 13, 2021 07:05
os x setup

Setting up my OS X machine

First Things First

  • Enable FileVault (for encryption) - save recovery key in safe place
  • Sophos Anti-virus - update files
  • Office for Mac (if needed for project)

Setting Up a Profile

@skseth
skseth / linux_setup.md
Last active January 7, 2020 05:11
Setting up my linux machine

Setup linux

Currently covering ubuntu 18.04 64 bit

Installing Editors

Visual Studio Code

sudo apt update sudo apt install software-properties-common apt-transport-https wget

package main
import (
"bufio"
"fmt"
"io"
"os"
"syscall"
)
@skseth
skseth / PropMain.java
Created March 9, 2019 08:43
Java CompositeConfiguration usage
package test;
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.BaseConfiguration;
import java.util.Iterator;
class PropMain {