Skip to content

Instantly share code, notes, and snippets.

@flooose
flooose / udisks2.conf
Last active November 4, 2023 15:56
The documentation in udisks2.conf.example is pretty sparse and it took a while to get this going, but this is how I got one specific external drive, formatted with an ext2/3/4 filesystem, to mount with user (not root) write permissions.
[/dev/disk/by-uuid/b3316cac-0e17-432f-a43e-00b4c770ec52]
ext3_allow=rw,exec,X-mount.owner,X-mount.group
ext3_defaults=rw,exec,X-mount.owner=chris,X-mount.group=wheel

Keybase proof

I hereby claim:

  • I am flooose on github.
  • I am cfloess (https://keybase.io/cfloess) on keybase.
  • I have a public key whose fingerprint is 61D0 DCF9 8B34 10B6 78E9 8A62 0BFB 00B0 72A8 BDE9

To claim this, I am signing this object:

@flooose
flooose / yubikey and fido2 for guix.md
Last active March 2, 2022 22:46
An absolute beginner got yubikey working on a guix system install

Introduction

I've been playing with guix, as a full system install, not the drop-in binary. In order to do that, I need certain basics, like access to my github account, which has two-factor authentication activated.

This is how an absolute beginner got it working.

Contents

@flooose
flooose / README.md
Last active December 31, 2016 17:01
Containerizing applications on arch linux

This is how I containerize applications. I used this site for help and inspiration.

$ sudo pacstrap -i -c -d ~/chromium base chromium  --ignore linux

$ sudo systemd-nspawn -u root -D ~/chromium/ bash

root # useradd chris -m
root # su -l chris && cd
$ mkdir -p mnt/pulse mnt/gdm

Crash Report

The wunderground app crashes everytime I start it. The stacktrace indicates it's a permissions issue, but the screenshot below shows that I've enabled the location permission for the app.

@flooose
flooose / balanced.el
Last active March 21, 2016 08:09
Playing around with finding balanced parens and such
(defconst parens "()")
(defconst square-bracket "[]")
(defconst curly-bracket "{}")
(defun paired-p (open close)
(cond
((equal open ?\[)
(equal close ?\]))
((equal open ?\{)
(equal close ?\}))

Keybase proof

I hereby claim:

  • I am flooose on github.
  • I am flooose (https://keybase.io/flooose) on keybase.
  • I have a public key whose fingerprint is C86D 05AE 9A2A 4247 16D1 5422 8751 1416 90C6 CCBA

To claim this, I am signing this object:

--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z_.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z_.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z_.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z_.]+):[^->\n]*$/\1/f,field/
@flooose
flooose / RedisSupport.rb
Created April 19, 2012 08:37
Module with dynamic method.
module RedisSupport
after_save :load_into_redis
before_destroy :remove_from_redis
def self.included(base)
unless base.respond_to? :load_into_redis
raise(Exception.new, "Please define the methods \"load_into_redis\" before including this module")
end
end
@flooose
flooose / gist:1809695
Created February 12, 2012 17:13
rails new blog
$ rails new blog
$ cd rails
$ rails g scaffold Post title:string content:text