Skip to content

Instantly share code, notes, and snippets.

@TheBengineer
TheBengineer / conky.conf
Last active April 13, 2018 18:35
Conky config for laptops.
# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
@rdnetto
rdnetto / Writeup.md
Last active April 30, 2018 23:37
Multiseat PCIe Passthrough Writeup

A few people expressed interest in finding out how this went, so I thought I'd do a writeup of my experiences getting PCIe passthrough working with multiseat.

One of the more interesting things to note is that hot-plugging aside, it works fine with Vega, despite the card not being shown as resettable by the Arch wiki script.

I've mostly followed the Arch wiki, with additional sources linked throughout.

Why would you want to do this?

Multiseat enables multiple people to use the same computer simultaneously. This can reduce setup costs (you only need one motherboard, CPU, etc.) and improve resource utilization (if one seat is idle, the other can make full use of the CPU + memory). The only parts needed per seat are the screen, peripherals, graphics card and a USB soundcard (opt.)

PCIe passthrough allows you to connect on

@aswild
aswild / pacman-upgrades-graph.py
Created May 30, 2019 00:51
Script to visualize the most-upgraded packages on a pacman based system
#!/usr/bin/env python3
"""
pacman-upgrades-graph.py: a script to visualize the most-upgraded packages on an pacman-based system.
"""
import argparse, os, re, shutil, subprocess, sys
parser = argparse.ArgumentParser()
parser.add_argument('-w', '--width', type=int, default=-1,
help='Max total width of graph. Defaults to terminal size, ' +
@gnif
gnif / qemu-pcie-nasty.patch
Created October 7, 2018 00:11
Nasty/hacky QEMU patch to enable PCIe x 16 Gen 3.0 for Qemu VFIO
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 6c91bd44a0..f3c7b9d328 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -39,6 +39,166 @@
#define PCIE_DEV_PRINTF(dev, fmt, ...) \
PCIE_DPRINTF("%s:%x "fmt, (dev)->name, (dev)->devfn, ## __VA_ARGS__)
+static uint16_t pcie_link_max_width(PCIDevice *dev)
+{
@kolach
kolach / fix_zsh_history.sh
Created November 26, 2015 23:50
Fix for zsh: corrupt history file /home/marc/.zsh_history
#!/bin/sh
# Borrowed from http://marcparadise.com/blog/2013/09/21/how-to-fix-a-corrupt-history-file/
# If you ever see a message like this upon starting a new shell
# zsh: corrupt history file /home/marc/.zsh_history
# here is a quick fix
cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
# And reload history
fc -R .zsh_history
@Maddosaurus
Maddosaurus / Alternative_Keypad.md
Last active February 9, 2021 01:02
Binding Multimedia keys in i3

Alternative bindings for the 540p using pactl and i3 - Keyboard

 # set laptop display to lower res - thats better
 exec  xrandr --output eDP1 --mode 1920x1080
 
 # set Numlock to on at login time
 exec --no-startup-id numlockx on
 
 # start pidgin on launch
# Author: @chaignc
# Two commands in this script:
# record2discord => send all typed bash command to your discord channel, see bellow for the blacklist
# last2discord => send the last typed command to your discord channel.
DISCORD_WEBHOOK_URL="Your_Discord_WebHook_URL" # UPDATE this with your web hook (take 2 minutes and read about this online)
_send2discord() {
# Blacklist some commands
[[ ! $BASH_COMMAND =~ .*autojump.* ]] && \
@vivien
vivien / imgur
Last active January 27, 2022 19:46
Shell script to upload image(s) to imgur.com
#!/bin/sh
#
# Upload image(s) to imgur.com
# Copyright (C) 2014 Vivien Didelot <vivien@didelot.org>
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt
#
# Requires "jshon":
# http://kmkeen.com/jshon/
#
# Alternatives, which suck:
@heppu
heppu / ARCH_INSTALL.MD
Last active February 27, 2022 17:01
Installing Arch with GPT, dm-crypt, LUKS, LVM and systemd-boot

Create bootable USB

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

Boot from USB and set prepare system

loadkeys <your-keymap>
@wilbowma
wilbowma / jail.pl
Last active August 1, 2022 11:16
A perl script to create nginx chroot in arch linux.
#a/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
sub run{