Skip to content

Instantly share code, notes, and snippets.

@nitred
nitred / optimal_mtu.md
Last active May 7, 2024 01:51
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
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 7, 2024 01:48
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@projectoperations
projectoperations / Vagrantfile
Created May 4, 2024 20:30 — forked from mike-hearn/Vagrantfile
Multi-machine Vagrant config with private networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
:name => "server1",
:eth1 => "192.168.205.10",
:mem => "1024",
:cpu => "1"
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 7, 2024 01:46 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@mort3za
mort3za / git-auto-sign-commits.sh
Last active May 7, 2024 01:45
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@JBGruber
JBGruber / docker-compose.yml
Last active May 7, 2024 01:43
My compose file to run ollama and ollama-webui
services:
# ollama and API
ollama:
image: ollama/ollama:latest
container_name: ollama
pull_policy: missing
tty: true
restart: unless-stopped
# Expose Ollama API outside the container stack
@JotaRata
JotaRata / ztf_utils.py
Last active May 7, 2024 01:42
ZTF Forced Photometry service utilities
from typing import Literal
import numpy as np
import pandas as pd
import requests
import multiprocessing
from multiprocessing.pool import ThreadPool
import os
'''
# ZTF Forced photometry utilities
@glowinthedark
glowinthedark / pyqt5_pdf_viewer.py
Last active May 7, 2024 01:41
Python simple PDF viewer using PyQt5 and mozilla's pdf.js
#!/usr/bin/env python3
import sys
from pathlib import Path
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import *
# REQUIREMENTS
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active May 7, 2024 01:41
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@LazyMammal
LazyMammal / hide_live_chat.js
Created September 20, 2017 11:54
Hide live chat by default on YouTube live streams
// ==UserScript==
// @name YouTube - Hide Live Chat
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide live chat by default on live streams
// @author LM
// @match https://www.youtube.com/watch*
// @run-at document-end
// @grant none
// ==/UserScript==