Skip to content

Instantly share code, notes, and snippets.

View blisabda's full-sized avatar
🏠
Working from home

blisabda

🏠
Working from home
View GitHub Profile
@yodermk
yodermk / centos8-9.sh
Created February 13, 2022 19:08
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
@nitred
nitred / optimal_mtu.md
Last active July 16, 2024 11: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
@apollo13
apollo13 / traefik.nomad
Last active April 15, 2024 14:46
Traefik 2.5 with Consul Connect on Nomad
# Simple example to deploy traefik with consul connect enabled.
# For simplicity the job includes traefik as well as the backend service.
# Please note that traefik currently only supports connect for HTTP.
job "traefik-consul-connect-demo" {
datacenters = ["dc1"]
group "edge" {
network {
mode = "bridge"
@degitgitagitya
degitgitagitya / .env
Last active July 16, 2024 21:01
Next JS + Next Auth + Keycloak + AutoRefreshToken
# KEYCLOAK BASE URL
KEYCLOAK_BASE_URL=
# KEYCLOAK CLIENT SECRET
KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK CLIENT ID
KEYCLOAK_CLIENT_ID=
# BASE URL FOR NEXT AUTH
@davidteren
davidteren / nerd_fonts.md
Last active July 24, 2024 20:04
Install Nerd Fonts via Homebrew [updated & fixed]
@mando7
mando7 / gpu-list.md
Last active June 17, 2024 14:36
Nvidia graphics card sorted by Cuda cores.
# Source: https://gist.github.com/28e2adb5946ca366d7845780608591d7
###########################################################
# Argo Workflows & Pipelines #
# CI/CD, Machine Learning, and Other Kubernetes Workflows #
# https://youtu.be/UMaivwrAyTA #
###########################################################
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
@kaelzhang
kaelzhang / get_event_loop vs get_running_loop.py
Last active October 27, 2023 03:58
Show a demo the differences between Python `asyncio.get_event_loop()` and (vs) `asyncio.get_running_loop()`. And also explain the differences between `asyncio.run()` and `loop.run_until_complete()`
import asyncio
# Ref: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop
# > If there is no current event loop set in the current OS thread,
# > the OS thread is main, and set_event_loop() has not yet been called,
# > asyncio will create a new event loop and set it as the current one
loop = asyncio.get_event_loop()
# So, loop2 is loop
loop2 = asyncio.get_event_loop()
@D4R4
D4R4 / l2tp_vpn_client
Created June 10, 2020 15:45
L2TP VPN Client setup on CentOS 7
Go step-by-step through following instructions to set up L2TP/IPSec VPN on Centos 7.
To set up the VPN client on centos 7, first install the following packages:
yum -y install epel-release
yum -y install strongswan xl2tpd
Create VPN variables (replace with actual values):
VPN_SERVER_IP='your_vpn_server_ip'
@jmurphyau
jmurphyau / download.sh
Created February 9, 2020 22:47
Download HLS Stream with FFmpeg
#this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy project5.mp4
# or this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy -bsf:a aac_adtstoasc project3.mp4