Skip to content

Instantly share code, notes, and snippets.

@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 {
package main
import (
"bufio"
"fmt"
"io"
"os"
"syscall"
)
@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

# 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 / 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 / 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

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 / commands.md
Created April 2, 2023 10:31
macos - network commands

Find process listening on port

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