Skip to content

Instantly share code, notes, and snippets.

View tmplt's full-sized avatar

Viktor Vilhelm Sonesten tmplt

View GitHub Profile
@sorki
sorki / configuration.nix
Created August 25, 2020 14:13
rpi cross
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix>
];
nixpkgs = {
crossSystem.system = "armv7l-linux";
};
@WhittlesJr
WhittlesJr / Readme.md
Last active April 24, 2024 21:09 — forked from techhazard/Readme.md
NixOS: PCI Passthrough

PCI Passthrough

Warning: unfinished (but successfull!)

I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).

This is my attempt at doing the same on Nixos.

Requirements

Xft.dpi: 150
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintslight
rofi.color-enabled: true
rofi.font: Hack Bold 16
rofi.modi: window,run,ssh
rofi.opacity: 90
@cryzed
cryzed / fix-infinality.md
Last active June 24, 2024 02:24
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@dasJ
dasJ / qemu_frozendroid
Created November 3, 2015 18:38
Qemu FrozenDroid
qemu-system-x86_64 \
-enable-kvm -M q35 -localtime -usb -name Windows `# General options` \
-monitor /dev/tty -nographic -vga none -serial none `# Graphic options` \
-cpu host,kvm=off -smp 1,sockets=1,cores=1,threads=1 `# CPU Options` \
-m 1024 `# Memory` \
-bios /usr/share/qemu/bios.bin `# BIOS` \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 `# PCIe Bus` \
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on `# Graphics card` \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 `# Graphics card sound` \
-soundhw hda `# Sound` \
@dasJ
dasJ / windows
Last active August 29, 2017 19:36
Qemu final
#!/bin/bash
xhost local:root > /dev/null
if ! [ -d /sys/fs/cgroup/cpuset/windows ]; then
sudo cgcreate -t $USER:users -a $USER:users -g cpuset:windows
fi
/bin/echo "2-7" > /sys/fs/cgroup/cpuset/windows/cpuset.cpus
/bin/echo "0" > /sys/fs/cgroup/cpuset/windows/cpuset.mems
@kyokley
kyokley / dock.md
Last active June 13, 2024 20:32
Docking/Undocking a Lenovo laptop running xmonad

Docking/Undocking a Lenovo laptop running xmonad

Introduction

I ran into this issue while at work and came up with this solution. This gist is mostly just documentation for myself so I can remember what I did 6 months from now. I am in no way saying that this is the right way to fix things but I'll be thrilled if this is in any way helpful to others. That being said, I make no guarantees that bad things will not happen to your machine if you follow these directions. Proceed at your own risk.

Although, I mention using the following setup to resolve an issue I was having using xmonad as my windows manager, I don't think there's anything special about it. It should be possible to use the following steps with any windows manager.

Problem

Setting up multiple monitors in xmonad requires defining the screen configuration using xrandr. The problem is that xmonad does not respond to a laptop being placed or removed from a docking station. Obviously, the solution is to update the monitor configuration on the

@eyecatchup
eyecatchup / hosts
Last active July 12, 2023 08:53
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# Block Skype ads
127.0.0.1 *.msads.net
127.0.0.1 *.msecn.net
127.0.0.1 *.rad.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 ac3.msn.com
127.0.0.1 ad.doubleclick.net
127.0.0.1 adnexus.net
127.0.0.1 adnxs.com
127.0.0.1 ads1.msn.com
@dannguyen
dannguyen / wget-snapshotpage.md
Last active December 25, 2023 20:57
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@Aaronontheweb
Aaronontheweb / GetLastError.cpp
Created November 14, 2013 03:45
How to format the output of Win32's GetLastError() method into a string using FormatString
DWORD dLastError = GetLastError();
LPCTSTR strErrorMessage = NULL;
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL,
dLastError,
0,
(LPWSTR) &strErrorMessage,
0,