Skip to content

Instantly share code, notes, and snippets.

View gryan11's full-sized avatar

Gabriel Ryan gryan11

View GitHub Profile
@gryan11
gryan11 / progbar_gzip.md
Created November 2, 2021 16:24
progressbar compress decompress

To compress/decompress large datasets with tar/gzip:

compress script:

#!/bin/bash

indir=$1

tar cf - ${indir}  | pv -s $(du -sb ${indir} | awk '{print $1}') | gzip > ${indir}.tar.gz
@gryan11
gryan11 / zsh_bell.md
Created June 24, 2021 12:51
Turn off zsh bell

Turn off zsh bell

Add following to ~/.zshrc:

unsetopt BEEP
@gryan11
gryan11 / wsl_jupyter_connection_fix.md
Created June 23, 2021 19:16
Fix 'unable to connect' error for wsl2 and jupyter.

Fix connection error for wsl2 and jupyter

This is caused by network bridge for wsl2 getting messed up. Note that shutting down/rebooting may not fix issue. Instead, open powershell and run:

wsl --shutdown

Then reopen wsl2 instance.

@gryan11
gryan11 / windows_terminal_bell.md
Created June 22, 2021 15:16
Turn off windows terminal bell

Turn off Windows Terminal Bell

Add the following to settings.json under defaults:

"bellstyle": "none"
@gryan11
gryan11 / jupyter_theme.md
Last active April 7, 2021 17:17
Jupyter Theme configuration

Jupyter Theme Configuration

Install:

pip install jupyterthemes

Apply configuration:

@gryan11
gryan11 / pandas_show_full_dataframe.md
Last active April 7, 2021 15:15
How to show a full pandas dataframe.

Show a full dataframe in Pandas

import pandas as pd
pd.set_option("display.max_rows", None)
pd.set_option("display.max_columns", None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', None)
@gryan11
gryan11 / colab_figures_example.md
Last active February 19, 2021 13:15
How to generate figures in colab, and avoiding type3 font errors on latex submissions.

import plotting libs

import numpy as np
import pandas as pd
import seaborn as sns

import matplotlib.font_manager as fm

import matplotlib
@gryan11
gryan11 / drive_downloads.md
Last active December 22, 2020 01:55
Downloading folders + large files from google drive
@gryan11
gryan11 / windows_linux_subsystem.md
Last active August 1, 2020 11:41
Windows Linux Subsystem Setup

Windows Linux Subsystem Setup

  1. Install Linux Subystem following directions from https://docs.microsoft.com/en-us/windows/wsl/install-win10
  2. Install wsl-2 https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel
  3. Install preferred font (here Noto Sans font) from https://github.com/powerline/fonts/blob/master/NotoMono/Noto%20Mono%20for%20Powerline.ttf Install from powerline repo, for some reason installing from google does not show up as an option.
    • Update: now prefer cascadia mono font, also prefer using windows terminal (modify for default ubuntu when opening)
  4. Set use ctrl+shift+c/v as copy/paste, solid box cursor
  5. Turn off console sounds in Windows Advanced Sound Options
  • optionally turn off all alert noises under Sound Control Panel -> Sounds and setting Sound Scheme to 'No Sounds'
  1. Install any other preferred configs.

Snort install on mac

  • install homebrew first if not installed
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"\
  < /dev/null 2> /dev/null
  • install snort brew install snort

  • make bpf readable for snort