Skip to content

Instantly share code, notes, and snippets.

@PhilHudson
PhilHudson / gist:1566751
Created January 5, 2012 19:19
Packard Bell dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.35-22-generic (buildd@rothera) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu4) ) #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 (Ubuntu 2.6.35-22.33-generic 2.6.35.4)
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009dc00 (usable)
[ 0.000000] BIOS-e820: 000000000009dc00 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000ce000 - 00000000000d0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000dc000 - 00000000000e0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 0000000057e90000 (usable)
@PhilHudson
PhilHudson / gist:1569497
Created January 6, 2012 07:22
Packard Bell lspci -vvv
00:00.0 Host bridge: ATI Technologies Inc Device 5a31 (rev 01)
Subsystem: Packard Bell B.V. Device c101
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
Latency: 64
Kernel modules: ati-agp
00:01.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
@PhilHudson
PhilHudson / gist:1788795
Created February 10, 2012 11:04
Emacs custom settings for C-style indentation for elisp (2)
'(align-lisp-modes (quote (emacs-lisp-mode lisp-interaction-mode lisp-mode scheme-mode clojure-mode)))
'(align-rules-list (quote ((lisp-second-arg (regexp . "\\(^\\s-+[^(
]\\|(\\(\\S-+\\)\\s-+\\)\\S-+\\(\\s-+\\)") (group . 3) (modes . align-lisp-modes) (run-if lambda nil current-prefix-arg)) (lisp-alist-dot (regexp . "\\(\\s-*\\)\\.\\(\\s-*\\)") (group 1 2) (modes . align-lisp-modes)) (open-comment (regexp lambda (end reverse) (funcall (if reverse (quote re-search-backward) (quote re-search-forward)) (concat "[^
\\\\]" (regexp-quote comment-start) "\\(.+\\)$") end t)) (modes . align-open-comment-modes)) (c-macro-definition (regexp . "^\\s-*#\\s-*define\\s-+\\S-+\\(\\s-+\\)") (modes . align-c++-modes)) (c-variable-declaration (regexp . "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)[A-Za-z_][0-9A-Za-z:_]*\\s-*\\(\\()\\|=[^=
].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)?\\s-*[;,]\\|)\\s-*$\\)") (group . 1) (modes . align-c++-modes) (justify . t) (valid lambda nil (not (or (save-excursion (goto-char (match-beginning 1)) (backward-wo
@PhilHudson
PhilHudson / gist:1883609
Created February 22, 2012 09:34
pretty-lambdas for elisp
(defun pretty-lambdas ()
"Show glyph for lower-case Greek lambda (λ) wherever 'lambda' appears."
(font-lock-add-keywords
nil
`(("(\\(lambda\\>\\)"
(0
(progn
(compose-region
(match-beginning 1)
(match-end 1)
@PhilHudson
PhilHudson / gist:1933912
Created February 28, 2012 17:44
C-style closing-paren indent for elisp
(defadvice lisp-indent-line (after my-trailing-parens-lisp-indentation)
"Make close parens on their own line indent like C"
(interactive)
(let (col-num)
(save-excursion
(beginning-of-line)
(when (looking-at "^\\s-*\)")
(search-forward "\)")
(backward-sexp)
(setf col-num (current-column))
@PhilHudson
PhilHudson / gist:3136807
Created July 18, 2012 15:17
Auto-compile elisp
(defun ph/is-elisp-file (filename)
"Returns non-nil if FILENAME ends in either '.el' or '.el.gz'"
(string-match-p "\\.el\\(\\.gz\\)?\\'" filename)
)
(defun ph/autocompile-elisp ()
"Compiles and tags my custom elisp code files on save:
<`dot-emacs'>, and files under the <`ph/elisp-root'> directory.
References: `dot-emacs-file'"
@PhilHudson
PhilHudson / gist:3136942
Created July 18, 2012 15:30
rebuild_tags
#!/bin/sh
if [ "x${OSTYPE}x" = "xcygwinx" ]; then
ETAGS='etags -L'
ETAGS_INCLUDE_FILE_SWITCH='--etags-include'
elif [ "x${OSTYPE}x" = "xlinuxx" ]; then
ETAGS='etags -L'
ETAGS_INCLUDE_FILE_SWITCH='--etags-include'
else
ETAGS='etags'
ETAGS_INCLUDE_FILE_SWITCH='--include'
@PhilHudson
PhilHudson / gist:4054639
Created November 11, 2012 11:33
Workaround for identica-mode memory leak
(defun ph/kill-bogus-http-buffers ()
"Kill bogus http buffers created by `identica-mode' wtf."
(interactive)
(ignore-errors
(kill-buffers-matching
"^.\\*http 127\\.0\\.0\\.1:3128\\*\\(<[[:digit:]]+>\\)?"
)
)
)
@PhilHudson
PhilHudson / gist:4054641
Created November 11, 2012 11:34
Workaround for identica-mode memory leak
(defun ph/kill-bogus-http-buffers ()
"Kill bogus http buffers created by `identica-mode' wtf."
(interactive)
(ignore-errors
(kill-buffers-matching
"^.\\*http 127\\.0\\.0\\.1:3128\\*\\(<[[:digit:]]+>\\)?")))
(add-hook 'identica-mode-hook 'ph/turn-off-filladapt-mode)
@PhilHudson
PhilHudson / gist:5188974
Created March 18, 2013 17:19
Files: ~/.screenrc ~/bin/short_day_name ~/bin/hr ~/bin/min ~/bin/sec ~/bin/copy-screen-copybuffer ~/bin/darwin/pbcopy
### .screenrc -*- mode: sh;-*-
# ==============================================================================
# Time-stamp: "2013-03-17 11:28:57 phil"
# ==============================================================================
defutf8 on
# Kill screen's startup message:
startup_message off