Skip to content

Instantly share code, notes, and snippets.

@jpsutton
jpsutton / toggle_touchpad.sh
Last active September 26, 2023 00:44
Bash script to toggle the enabled status on your touchpad while running under KDE Plasma 5
#!/bin/bash
SERVICE="org.kde.KWin"
DBUS_PATH="/org/kde/KWin/InputDevice"
INTERFACE="org.kde.KWin.InputDevice"
METHOD_GET="org.freedesktop.DBus.Properties.Get"
METHOD_SET="org.freedesktop.DBus.Properties.Set"
function find_touchpad {
DM_INTERFACE="org.kde.KWin.InputDeviceManager"
@salotz
salotz / move_axes.py
Created March 1, 2019 20:22
Move a matplotlib Axes from one figure to another.
import matplotlib.pyplot as plt
def move_axes(ax, fig, subplot_spec=111):
"""Move an Axes object from a figure to a new pyplot managed Figure in
the specified subplot."""
# get a reference to the old figure context so we can release it
old_fig = ax.figure
# remove the Axes from it's original Figure context
@mcastelino
mcastelino / qemu_netdev_socket_vlan.md
Last active December 21, 2023 13:20
QEMU usermode virtual vlan using -netdev socket

Goal

How to launch multiple QEMU based VM's that can communicate with the outside world and between each other other without any setup on the host.

This uses two features available in qemu

  • User Mode Networking stack - SLIRP
  • Socket networking backend allows you to create a network of guests that can see each other

This allows us to have