Skip to content

Instantly share code, notes, and snippets.

View alexmurray's full-sized avatar
🏠
Working from home

Alex Murray alexmurray

🏠
Working from home
View GitHub Profile
diff --git a/interfaces/builtin/u2f_devices.go b/interfaces/builtin/u2f_devices.go
index 8413c94b2..7a702051f 100644
--- a/interfaces/builtin/u2f_devices.go
+++ b/interfaces/builtin/u2f_devices.go
@@ -121,6 +121,9 @@ var u2fDevices = []u2fDevice{
const u2fDevicesConnectedPlugAppArmor = `
# Description: Allow write access to u2f hidraw devices.
+# Allow to access all usb devices and rely on the device cgroup for mediation.
+/dev/bus/usb/[0-9][0-9][0-9]/[0-9][0-9][0-9] rw,

Keybase proof

I hereby claim:

  • I am alexmurray on github.
  • I am alexmurray (https://keybase.io/alexmurray) on keybase.
  • I have a public key ASDSM5OSxiBsyuFmqu97BTkmWvsDXfq8-Gfje6dHcivZRwo

To claim this, I am signing this object:

@alexmurray
alexmurray / .bashrc
Last active July 26, 2023 05:51
Show IP address in bash prompt
# Set the prompt to include the IP address instead of hostname
function get_ip () {
IFACE=$(ip -4 route | grep default | head -n1 | awk '{print $5}')
if [ ! -z $IFACE ]; then
echo -n "|"; ip -4 -o addr show scope global $IFACE | awk '{gsub(/\/.*/, "|",$4); print $4}' | paste -s -d ""
else
echo -n "||"
fi
}
@alexmurray
alexmurray / install-emacs-25.1.sh
Last active July 11, 2017 13:22
Install emacs-25.1 on Ubuntu
sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo apt-get update
sudo apt-get install emacs25

Keybase proof

I hereby claim:

  • I am alexmurray on github.
  • I am alexmurray (https://keybase.io/alexmurray) on keybase.
  • I have a public key whose fingerprint is 4D2A D64A A650 A333 4867 1E17 94CB FBD8 BA4E 24F6

To claim this, I am signing this object:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Emacs Client
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/home/amurray/bin/ec %F
Icon=emacs24
StartupWMClass=Emacs
@alexmurray
alexmurray / es
Created December 8, 2014 10:31
Shutdown Emacs Server
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# simple script to shutdown the running Emacs daemon
# emacsclient options for reference
# -a Alternate editor, runs bin/false in this case
# -e eval the script
@alexmurray
alexmurray / et
Created December 8, 2014 10:30
Start Emacs Client in Terminal (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# Makes sure emacs daemon is running and opens the file in Emacs in
# the terminal.
# If you want to execute elisp, use -e whatever, like so
# et -e "(message \"Word up\")"
@alexmurray
alexmurray / ec
Last active January 24, 2022 16:56
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@alexmurray
alexmurray / .bashrc
Last active April 10, 2018 01:42
Improve svn diff to be more like git diff
# a nicer git-like svn diff which also works for svn externals which
# normally svn diff doesn't show
function svndiff () {
svn status $* | grep '^ *[ADM]' | cut --complement -c -8 | awk '{printf "%s%c", $0, 0}' | xargs -0 svn diff -x -up --depth=files | colordiff | less -R;
}
function svndiffstat () {
svn status $* | grep '^ *[ADM]' | cut --complement -c -8 | awk '{printf "%s%c", $0, 0}' | xargs -0 svn diff -x -up --depth=files | diffstat -C -p0
}