Skip to content

Instantly share code, notes, and snippets.

@N1addict
N1addict / get-edid.py
Created February 4, 2025 22:25 — forked from mvollrath/get-edid.py
Write monitor EDID to stdout with xrandr
#!/usr/bin/env python
import re
import subprocess
def get_edid_for_output(connector: str) -> bytes:
xrandr = subprocess.run(
['xrandr', '--props'],
check=True,
#!/bin/bash
# Check for current power save state
cat /sys/module/snd_hda_intel/parameters/power_save
cat /sys/module/snd_hda_intel/parameters/power_save_controller
# Immediately disable session power save
echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save_controller
# Disable power save forever
@N1addict
N1addict / interfaces
Created September 14, 2023 23:00 — forked from mrvdb/interfaces
Linux network /etc/network/interfaces file to bond eth0 and wlan0 into one virtual interface bond0
# Regardless of how our topology looks, we'll need the local interface
auto lo
iface lo inet loopback
# Configuration basics taken from:
# http://www.kernel.org/doc/Documentation/networking/bonding.txt
# Define the bonding master, which is ideally our only interface to the outside world
# - define slaves as none initially, this helps with booting faster
# - the primary line makes most sense here, but is not enough
# - set the interface check interval to 100ms
@N1addict
N1addict / osxtweaks
Created August 10, 2023 10:02 — forked from vividvilla/osxtweaks
Brian's List of OSX Tweaks for web developers
#OSX Tweaks:
===========
- Most need reboot to show changes
- Most of these tweaks are just for speed, but some are specific for development
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign.
- I'm not responsible for any adverse effects to your computer, at all.
##Increase the speed of OS X dialogs boxes:
@N1addict
N1addict / tp-link-ac600-ac1300-drivers-linux.md
Created July 15, 2023 12:46 — forked from julianlam/tp-link-ac600-ac1300-drivers-linux.md
Installing drivers for the TP-Link T2U/T3U Plus (AC600 or AC1300) Wireless Adapter #blog
@N1addict
N1addict / build_guide.md
Created January 30, 2023 20:55 — forked from cwgem/build_guide.md
Building `dockerd` and `docker-cli` from source

Introduction

This guide looks at what it will take to build dockerd and docker-cli from source with Ubuntu. Ubuntu was chosen as the OS as it uses the same apt-get calls the standard Dockerfile method uses making the experience a bit more seamless. While the official method is building docker in a container, here are some reasons why you may want to build this way:

  • Custom source modifications for testing
  • System that does not yet have a docker(d) binary release
  • You want to test things on a non-standard toolchain
  • You just want to deep dive

As you can probably tell using this method means you're delving away from support. Please don't file issues/PRs unless you can reproduce in the official build environment. In fact unless you really have one of the strong needs above you're better off building off a container since this guide is mostly a lot of copy/paste from the Dockerfile used in the official build system.

@N1addict
N1addict / install_anaconda.md
Created December 15, 2022 07:33 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@N1addict
N1addict / main.py
Created December 13, 2022 09:47 — forked from kumaraditya303/main.py
MultiThreaded Playwright with ThreadPoolExecutor
import threading
from playwright.sync_api import sync_playwright
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
class Tls(threading.local):
def __init__(self) -> None:
self.playwright = sync_playwright().start()
print("Create playwright instance in Thread", threading.current_thread().name)
@N1addict
N1addict / iso8601_duration.py
Created November 2, 2022 04:40 — forked from spatialtime/iso8601_duration.py
Python and ISO 8601 durations
# This snippet demonstrates Pythonic formatting and parsing of
# ISO 8601 durations.
# A little work is required to navigate between Python's
# timedelta syntax and ISO 8601 duration syntax.
import re
from datetime import datetime
from datetime import timedelta
@N1addict
N1addict / lxc_install_mongodb
Created October 31, 2022 02:43 — forked from erangaeb/lxc_install_mongodb
Install mongodb in lxc container
# GPG keys
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
# list file for MongoDB
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
# install
sudo apt-get update
sudo apt-get install -y mongodb-org