Skip to content

Instantly share code, notes, and snippets.

View mtompkins's full-sized avatar
💭
So Long, and Thanks for All the 🐠

Mark Tompkins mtompkins

💭
So Long, and Thanks for All the 🐠
View GitHub Profile
@lionep
lionep / 97-offline_backup.rules
Created June 15, 2024 14:21
Systemd / udev offline backup script
ACTION=="add", ENV{ID_PART_ENTRY_UUID}=="0b8e6986-ec09-8e44-b31f-38e944220a66", TAG+="systemd", ENV{SYSTEMD_WANTS}="offline-backup-connected.service"
@ThoNohT
ThoNohT / dehaskell.md
Last active April 24, 2024 23:30
Cleaning haskell packages from pacman

Cleaning up haskell packages on Arch Linux

In Arch Linux, all haskell packages are dynamically linked. This can be a headache for the user, since it results in a large amount of haskell-* packages being installed on your system, and the possibility for version conflicts. A way around this is to not depend on pacman at all for haskell packages, but manually install them. In this document I explain how I switched from a lot of haskell packages installed with pacman, to a few manually installed packages.

Finding packages to uninstall

To determine which packages to uninstall (and replace), a few tools are useful:

  • pacman itself
  • pacgraph
@rishitells
rishitells / Jest_GitLab_CI.md
Last active August 27, 2024 07:42
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@plembo
plembo / nmbrnetkvm.md
Last active August 22, 2024 01:54
NetworkManager bridged network for KVM guests

Setting up a bridged network for KVM guests

This will work with either networkd or NetworkManager as a resolver. In fact, this is the only way to do bridged KVM (libvirtd) networking with NetworkManager.

If you're using NetworkManager (on a desktop or laptop, for example) on your KVM host, follow these instructions to set up a bridge interface.

Once you have the host bridge set up, proceed as follows:

  1. Create a bridge network device inside KVM. Edit and save the below text as file host-bridge.xml:
@plembo
plembo / addbr0ubunmcli.md
Last active August 14, 2024 04:23
Add br0 to Ubuntu desktop using nmcli

Add a bridge interface to Ubuntu desktop using nmcli

Had to do this for some advanced networking with KVM, and couldn't figure out how to do it using the Nework Manager gui. Did find an article later that showed how to do it with nmtui, but it's so much easier to record what you did when using the cli.

In the examples below "eth0" is the name of my physical interface. By default on Ubuntu and most distributions that will almost certainly be different, for example: "eno1", "ens1", or "enp2s0".

To see what everything looks like before starting:

@Strykar
Strykar / update_sqm.sh
Last active January 23, 2023 02:23
Update SQM limits in openwrt 4 times a day
#!/bin/sh
# v0.1 Avinash H. Duduskar <strykar@live.com>
# This adjusts OpenWRT SQM settings by re-calculating up/down bandwidth
# Needs the Speedtest.net CLI binary - https://www.speedtest.net/apps/cli
# Call this script every 4 or 6 hours via cron
set -euf -o pipefail
_sqm_int="queue" # Your actual wan interface: ifstatus wan | grep -e l3_device
_pul="90" # Percentage of wan upload speed to set, 90-95 is good
_pdl="95" # Percentage of wan download speed to set, 90-95 is good
@PhilipSchmid
PhilipSchmid / kvm-windows-10-guest-ultrawide-resolution.md
Last active August 10, 2024 06:32
3440x1440 resolution for Windows 10 KVM VM

Configure a Windows 10 KVM Guest to use an ultrawide display resolution (3440x1440)

  1. virsh edit Windows10
  2. Navigate to the <video> section and change it to the following one:
    <video>
      <model type='qxl' ram='131072' vram='131072' vgamem='32768' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
adservers=newDS()
permitted=newDS()
function preresolve(dq)
if permitted:check(dq.qname) or (not adservers:check(dq.qname)) then
return false
end
if(dq.qtype == pdns.A) then
dq:addAnswer(dq.qtype, "127.0.0.1")
@ulkeshkosh
ulkeshkosh / pci-passthrough.md
Last active February 2, 2024 07:05
PCI-Passthrough Rig, OS, and Setup

Introduction

This is my guide for a successful PCI-Passthrough from Linux (Arch Linux) to QEMU/KVM via virt-manager and libvirtd into a Windows 10 Home guest.

NOTE: This is a guide for Intel only. I do not own an AMD machine, and will not add AMD information this guide until such time that I do, which could be never.

Hardware

Device Type Device
CPU Intel Core i7 7700K Quad-Core, Hyperthreading
Motherboard Gigabyte Z270X-Gaming 5
@zoilomora
zoilomora / README.md
Last active August 30, 2024 01:40
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf: