Skip to content

Instantly share code, notes, and snippets.

View michaelmrose's full-sized avatar
💭
Available to hire

Michael Rose michaelmrose

💭
Available to hire
View GitHub Profile
smartctl -i /dev/sdc
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.6.15-1-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Indilinx Barefoot based SSDs
Device Model: OCZ-VERTEX
Serial Number: 4V1K0T5245OML285C2G4
Firmware Version: 1.4
User Capacity: 32,017,047,552 bytes [32.0 GB]
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
@michaelmrose
michaelmrose / anonymous-gist.el
Created April 28, 2020 02:06
fixing underscores in org in as complicated manner as possible
(eval-after-load 'autoinsert
'(define-auto-insert '(org-mode . "Org Skeleton")
'("Description: "
"#+OPTIONS: ^:{} \n \n")))
(setq auto-insert-query nil)
;; the options defined in org skeleton aren't effective until the file is reread or normal-mode is executed
;; so lets run normal mode after we insert the text
(advice-add 'auto-insert :after 'normal-mode)
@michaelmrose
michaelmrose / i3.desktop
Created April 18, 2020 22:47
i3 session file
[Desktop Entry]
Name=i3
Comment=improved dynamic tiling window manager
Exec=i3
TryExec=i3
Type=Application
X-LightDM-DesktopName=i3
DesktopNames=i3
Keywords=tiling;wm;windowmanager;window;manager;
org-fontify-done-headline t
org-fontify-quote-and-verse-blocks t
org-fontify-whole-heading-line t
org-hide-emphasis-markers t
org-hide-leading-stars t
org-pretty-entities t
org-refile-use-outline-path 'file
org-refile-allow-creating-parent-nodes t
org-outline-path-complete-in-steps nil
org-src-tab-acts-natively t
@michaelmrose
michaelmrose / anonymous-gist.el
Created March 27, 2020 20:29
improved set-insert
(defun michael-set-fucking-insert ()
(interactive)
(let ((mm major-mode))
(with-current-buffer
(find-file-noselect "~/.emacs.d/michael/fuckinginsert.el")
(let ((sexp `(evil-set-initial-state ',mm 'insert)))
(eval sexp)
(goto-char (point-max))
(insert (format "%S\n" sexp))
(save-buffer)))))
@michaelmrose
michaelmrose / anonymous-gist.el
Created March 27, 2020 19:48
set-fucking-insert
(defun michael-set-fucking-insert ()
(interactive)
(let ((file "~/.emacs.d/michael/fuckinginsert.el")
(sexp (concat "(evil-set-initial-state '"
(prin1-to-string major-mode)
" 'insert)\n")))
(eval (read-from-whole-string sexp))
(append-to-file sexp nil file)
(save-buffer file)
))
@michaelmrose
michaelmrose / switchaudio.fish
Created October 23, 2019 21:56
better switchaudio
# Defined in /home/michael/.config/fish/buffer/switchaudio.fish @ line 2
function switchaudio
set sinks (pactl list short sinks | awk '{print $1}')
set streams (pactl list short sink-inputs | cut -f1)
set current (ponymix -t sink defaults --short | awk '{print $2}'|head -1)
switch $argv[1]
case set
set next (ponymix -t sink list --short | grep -i $argv[2]| head -1 |awk '{print $2}')
case toggle
#!/bin/fish
# pass nothing to move everything to the next valid sink and set it as default
# you may pass instead an index or a string that uniquely identifies a sink
# example headset/headphones if your headphones includes that name
set data (pactl list short sinks)
set sinks (p $data | awk '{print $1}')
set current (p $data |head -1|cut -c1)
set streams (pactl list short sink-inputs | cut -f1)
if test -n "$argv"
xterm-24bit|xterm with 24-bit direct color mode,
use=xterm-256color,
sitm=\E[3m,
ritm=\E[23m,
setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,