Skip to content

Instantly share code, notes, and snippets.

  • First, get an ssh session to the machine, just in case we accidentally block our keyboard.
  • Plug in a USB drive to the port you want to restrict.
  • Run lsblk to find the device name (e.g. /dev/sdd), you can check by size.
  • Verify this by running ls -l /dev/disk/by-id, the device ID/name should point to the /dev/sd* you identified in the previous step.
  • Now, run ls -l /dev/disk/by-path, and check which path points to the device. (Note, you need this for the step 1 of the StepMania USB profiles setup as well.) This should look something like pci-0000:06:00.3-usb-0:3:1.0-scsi-0:0:0:0. Remove the -scsi-0:0:0:0 and we're left with a "path" like pci-0000:06:00.3-usb-0:3:1.0.
  • To create the actual rule, create a file called /etc/udev/rules.d/99-restrict-usb-storage.rules, and add this line:
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/udev/rules.d/61-gdm.rules
[Action]
Description = Removing Wayland GDM restrictions
When = PostTransaction
# comments any lines containing "/usr/lib/gdm-disable-wayland"
@cg505
cg505 / .desktoprc
Last active February 12, 2019 01:54
.desktoprc
~/remote/setup-desktop 2>> ~/remote/.desktoprc.log >> ~/remote/.desktoprc.log
# Files that Git should ignore in the Emacs source directory.
# Copyright 2009-2017 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@cg505
cg505 / keybase.md
Last active November 20, 2018 02:54

Keybase proof

I hereby claim:

  • I am cg505 on github.
  • I am cg505 (https://keybase.io/cg505) on keybase.
  • I have a public key ASAFs6jTjEUNkNxFYNGfaY8pGif03QlNOv8c9barMnsf6go

To claim this, I am signing this object:

@cg505
cg505 / .zshrc
Created July 3, 2016 01:36
cg505.zshrc
fpath=(~/.zsh/completions $fpath)
autoload -U compinit colors select-word-style
select-word-style bash
compinit
colors
alias ls='ls --color=auto'
# function advise {
@cg505
cg505 / README
Last active May 14, 2016 17:29
mc webhook setup
make a fifo for the server:
mkfifo serverin
run the server:
tail -f serverin | java -jar minecraft_server.jar nogui | tee serverout
run the webhook client:
ruby mcwh.rb -h "<slack webhook url>" -l serverout
run the webhook server:
@cg505
cg505 / ayy lemon.rb
Created August 16, 2015 03:24
ayy lemon, now with linux support
#!/usr/bin/env ruby
module Illuminati
module V1
module MottoGenerator
def self.ayy_lmao_count
rand(1024) + 64
end
def self.ayy