Skip to content

Instantly share code, notes, and snippets.

@nitred
nitred / optimal_mtu.md
Last active November 13, 2024 12:36
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@nitred
nitred / db_manager.py
Last active September 25, 2024 16:29
Creating thread safe and managed sessions using SQLAlchemy
"""Creating thread safe and managed sessions using SQLAlchemy.
The sessions that are created are expected to be:
- thread safe
- handle committing
- handle rolling back on errors
- handle session removal/releasing once context or thread is closed.
Author: Nitish Reddy Koripalli
License: MIT
@nitred
nitred / about.md
Last active May 4, 2018 15:00
Dataset Extraction Utilities

About

Dataset extraction utilities

Table of Contents

  • Script for changing directory of meta_df: Link
@nitred
nitred / about_ml.md
Last active May 15, 2018 17:48
Machine Learning Utils

About

Machine learning utilities

Table of Contents

@nitred
nitred / utils.md
Last active August 26, 2024 22:36
Common Utilities

About

Common Utility functions

Table of Contents

  • utils_argparse.py
  • utils_config.py
    • read_config
  • utils_datetime.py
  • get_month_start_date_from_date
@nitred
nitred / .bash_aliases_append
Last active August 26, 2024 22:36
Anaconda Conda bashrc Aliases
alias anaconda2='bash --rcfile ~/.conda_bashrc2'
alias anaconda3='bash --rcfile ~/.conda_bashrc3'
@nitred
nitred / about_python_release_protocol.md
Last active April 2, 2018 16:45
Release Protocol for Python Projects

About

This is the protocol to follow when either initializing a Python Package for the first time or when making a release of a Python Package.

Python Package Structure

Ideally use Protemplates to create a Python package. Link to Protemplates.

Installing Protemplates

  • Download the appropriate binary for your system.
  • Copy paste the protemplates binary into your /usr/local/bin directory.
@nitred
nitred / jupyter-notebook-headers.md
Last active March 24, 2022 09:09
Common jupyter notebook headers and imports for convenience.

Expand Width of Cell

from IPython.core.display import display, HTML
# Expand to 90% of screen width
display(HTML("<style>.container { width:90% !important; }</style>"))

Set max rows for pandas to display

import pandas as pd
@nitred
nitred / about_web_utils.md
Last active April 12, 2018 17:43
Web Utils

About

Utility function and snippets for the web

Table of Contents

  • Flask PNG snippet
  • Simple drawingboard
@nitred
nitred / encryption.md
Last active August 26, 2024 22:38
Encryption and Decryption Algorithms & Implementations

About

Easily accessible encryption & decryption algorithms, implementations and commands.

Index