;;; linux-version.el ;;; Copyright (C) 2000,2002 Faried Nawaz ;;; Author: Faried Nawaz ;;; Maintainer: fn@hungry.org ;;; Keywords: games ;;; $Id: linux-version.el,v 1.2 2002/04/26 10:51:02 fn Exp $ ;; Writing this file was a waste of time. But a good waste of time! ;; This software is free; 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 2, or (at your option) ;; any later version. ;; This software is distributed in the hope that it will never be ;; useful, and WITHOUT ANY WARRANTY; without even the implied warranty ;; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; For a copy of the GNU General Public License, see the document at ;; http://www.gnu.org/copyleft/gpl.html or write to the Free Software ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. ;;; Commentary: ;; I wrote this code after reading flame.el and BoS's cafe-babble.el. ;; For the latest version of flame.el, see the following: ;; http://www.splode.com/users/friedman/software/emacs-lisp/ ;; To use this package with Noah Friedman's silly-mail.el, use the ;; following lines: ;; (defun add-linux-header (&optional arg) ;; (interactive "p") ;; (sm-put-header-fill-content "X-Linux-Version" ;; (linux-version (or arg (1+ (random 5)))))) ;; (autoload 'sm-add-random-header "silly-mail" nil t) ;; (eval-after-load "silly-mail" ;; '(setq sm-mail-header-table (cons 'add-linux-header ;; sm-mail-header-table))) ;; The main entry points of interest are: ;; linux-version (callable interactively) ;; linux-version-string ;; linux-sentence (callable interactively) ;; linux-sentence-string ;; If you have any additions to offer (and I certainly hope you do), ;; send me a patch and I'll incorporate them. (require 'flame) (random t) (defvar linux-version-version "1.00") (defvar l-sentence '(((l-dist-name) Linux\.) ((l-run-proudly) (l-version-string)\.) ((l-run-proudly) (l-version-string) (l-gcc-version-string) on (l-dist-string)\!) ((l-run-proudly) (l-dist-string)\!) ((l-dist-string) is the best platform for (l-software)\.) (linux kernel hackers run (l-dist-string)\. Shouldn\'t you\?) (i ran (l-dist-string) on my (l-honkin-pc) until i tried (l-dist-string)\.\.\. and now that\'s what i run everywhere\!) (work just gave me a brand new (l-honkin-pc) just for developing (l-software) on linux\! Woo-hoo\!) (my parents gave me a (l-honkin-pc) running (l-dist-string) for my 14th birthday\!) ((l-dist-string) \-\- the choice of the GNU generation\.) ((l-is-biff)) (hail (l-dist-string)\!) (only (l-weenies) use (l-other-OSs) instead of (l-dist-string)\.))) (defvar l-sentence-loop (nconc l-sentence l-sentence)) (defvar l-run-proudly '((i run Linux (l-where) using) (i proudly run Linux (l-where) using) (i always recommend that people run) (i always use))) (defvar l-run-proudly-loop (nconc l-run-proudly l-run-proudly)) (defvar l-version-string '(("0.99p14") ("1.0.3") ("2.0.20") ("2.3.39") ("2.5.2+ac"))) (defvar l-version-string-loop (nconc l-version-string l-version-string)) (defvar l-gcc-version-string '((with gcc (l-gcc-version)) (with gcc (l-gcc-version) and glibc (l-glibc-version)))) (defvar l-gcc-version-string-loop (nconc l-gcc-version-string l-gcc-version-string)) (defvar l-gcc-version '(("2.5.8") ("2.6.3") ("2.7.1") ("2.7.2.1") ("2.7.2.3") ("2.95.1") ("2.96") ("3.13-rms"))) (defvar l-gcc-version-loop (nconc l-gcc-version l-gcc-version)) (defvar l-glibc-version '(("1.2") ("2.0") ("0.99c"))) (defvar l-glibc-version-loop (nconc l-glibc-version l-glibc-version)) (defvar l-software '((qmail) (sendmail) (emacs) (xemacs) (Noah Friedman\'s init files) (zenirc) (gnu liberty) (jdk "1.2" pre4) (Quake 2 mods))) (defvar l-software-loop (nconc l-software l-software)) (defvar l-is-biff '((I SW1THCED TO L1NUX AND MY LIFE 1S GRATE!!!!111) (I LUV LINUX!!!11) (I JUST CANT WAIT UNTIL LINUX RUNSO N MY COMMIE-64!!!!1))) (defvar l-is-biff-loop (nconc l-is-biff l-is-biff)) (defvar l-weenies '((weenies) (lusers) (\`users\') (bozos) (slackers) (capitalist dogs) (pinko liberal commies) (\%\$\^\#\%\!\@\#\$s))) (defvar l-weenies-loop (nconc l-weenies l-weenies)) (defvar l-other-OSs '((NetBSD) (FreeBSD) (SunOS) (OpenBSD) (JavaOS) (OSF/1) (Solaris) (Plan9) (Inferno) (Minix) (DOS) (Win 95) (Win 98) (NT 4) (Windows 2000) (Mach 3) (Hurd) (OpenStep))) (defvar l-other-OSs-loop (nconc l-other-OSs l-other-OSs)) (defvar l-dist-string '(((l-dist-name) Linux) ((l-dist-name) Linux version (l-dist-version)))) (defvar l-dist-string-loop (nconc l-dist-string l-dist-string)) (defvar l-dist-name '((Yellow Dog) (RedHat) (Slackware) (SLS) (TurboLinux) (Mandrake) (Slap Ma Buns) (Gap) (Calvin Klein) (Wranglers) (Catholinux) (Jihad) (FREEMITNICK) ($cript Kiddie$ Fave) (GothAsFsck) (Underware) (Pirate Scurvy) (Pirated) (CopyLefted) (GNU /) (Lignux /) (Sear\'s) (Costco) (Drano) (Michael Jordan\'s Own) (IBM) (CNN) (Potato) (Ultra) (Hyper) (Super) (Meta) (Alt) (Caesar) (Balsalmic Vinaigrette) (Libertarians\' Personal) (Samizdat) (Xanthochroic) (pomo) (pre-Torvaldes) (Absolut) (Morning After) (Moo) (Yow))) (defvar l-dist-name-loop (nconc l-dist-name l-dist-name)) (defvar l-dist-version '(("0.99p14") ("3.4-alpha-6.RELEASE") ("2.0") ("6.1") ("pi") ("alpha") ("5.2beta") ("2.3+4.4bsd") ("ln 2") (pre-AOL\/Time\-Warner) ("3.0+kswapd_patch_alpha"))) (defvar l-dist-version-loop (nconc l-dist-version l-dist-version)) (defvar l-where '((in my bedroom) (at my office) (in my server-farm) (on my (l-honkin-pc)) (in my pants) (at the local gnome coder recruitment center) (at my mom\'s florist business))) (defvar l-where-loop (nconc l-where l-where)) (defvar l-honkin-pc '((Intel (l-intel-type)) ((l-processor-speed) Intel (l-intel-type)) (AMD (l-amd-type)) ((l-processor-speed) AMD (l-amd-type)) (Cyrix (l-processor-speed)) (UltraSparc (l-ultrasparc-type)) (toaster) (wrist-watch) (embedded system) (desktop))) (defvar l-honkin-pc-loop (nconc l-honkin-pc l-honkin-pc)) (defvar l-intel-type '((Pentium) (Pentium-Pro) (Dual Pentium-Pro) (Xeon) (Celeron) (i960) (386) (\'486) (Itanium) (Merced))) (defvar l-intel-type-loop (nconc l-intel-type l-intel-type)) (defvar l-processor-speed '((2KHz) (900 KHz) ("89.3 FM") (1MHz) (20MHz) (66MHz) (100MHz) (266MHz) (1GHz) (1.43THz))) (defvar l-processor-speed-loop (nconc l-processor-speed l-processor-speed)) (defvar l-amd-type '((486) (K5) (K6) (K6-2) (K6-3) (K7) (Athlon) (ClawHammer))) (defvar l-amd-type-loop (nconc l-amd-type l-amd-type)) (defvar l-ultrasparc-type '((1/170) (5) (10) (20))) (defvar l-ultrasparc-type-loop (nconc l-ultrasparc-type l-ultrasparc-type)) (defmacro linux-define-element (name) (let ((loop-to-use (intern (concat name "-loop")))) (` (defun (, (intern name)) nil (let ((step-forward (% (random) 10))) (if (< step-forward 0) (setq step-forward (- step-forward))) (prog1 (nth step-forward (, loop-to-use)) (setq (, loop-to-use) (nthcdr (1+ step-forward) (, loop-to-use))))))))) (linux-define-element "l-sentence") (linux-define-element "l-run-proudly") (linux-define-element "l-version-string") (linux-define-element "l-gcc-version-string") (linux-define-element "l-gcc-version") (linux-define-element "l-glibc-version") (linux-define-element "l-software") (linux-define-element "l-is-biff") (linux-define-element "l-weenies") (linux-define-element "l-other-OSs") (linux-define-element "l-dist-string") (linux-define-element "l-dist-name") (linux-define-element "l-dist-version") (linux-define-element "l-where") (linux-define-element "l-honkin-pc") (linux-define-element "l-intel-type") (linux-define-element "l-processor-speed") (linux-define-element "l-amd-type") (linux-define-element "l-ultrasparc-type") (defun *linux-sentence nil (flame-expand '(l-sentence))) (defun linux-sentence-2 (arg) (let ((start (point))) (linux-sentence-1 arg) (fill-region-as-paragraph start (point) t))) (defun linux-sentence-1 (arg) (cond ((zerop arg) t) (t (insert (linux-sentence-string)) (linux-sentence-1 (1- arg))))) (defun linux-sentence-string () "Make a linux sentence into a string." (concat (flame-sentence-ify (flame-string-ify (flame-append-suffixes-hack (flame-flatten (*linux-sentence))))))) (defun linux-sentence (&optional arg) "Generate ARG (default 1) types of linux advocacy sentences. If interactive, print the result in a buffer and display it. Otherwise, just return the result as a string." (interactive "p") (or arg (setq arg 1)) (if (interactive-p) (let ((w (selected-window))) (pop-to-buffer (get-buffer-create "*Linux Advocacy*")) (goto-char (point-max)) (insert ?\n) (linux-sentence-2 arg) (select-window w)) (let (result) (while (> arg 0) (setq result (concat result (linux-sentence-string) (if (= 1 arg) "" "\n"))) (setq arg (1- arg))) result))) (defun *linux-version nil (flame-expand '(l-dist-string))) (defun linux-version-2 (arg) (let ((start (point))) (linux-version-1 arg) (fill-region-as-paragraph start (point) t))) (defun linux-version-1 (arg) (cond ((zerop arg) t) (t (insert (linux-version-string)) (linux-version-1 (1- arg))))) (defun linux-version-string () "Make a linux version into a string." (concat (flame-sentence-ify (flame-string-ify (flame-append-suffixes-hack (flame-flatten (*linux-version))))))) (defun linux-version (&optional arg) "Generate ARG (default 1) types of linux version strings. If interactive, print the result in a buffer and display it. Otherwise, just return the result as a string." (interactive "p") (or arg (setq arg 1)) (if (interactive-p) (let ((w (selected-window))) (pop-to-buffer (get-buffer-create "*Linux Distros*")) (goto-char (point-max)) (insert ?\n) (linux-version-2 arg) (select-window w)) (let (result) (while (> arg 0) (setq result (concat result (linux-version-string) (if (= 1 arg) "" "\n"))) (setq arg (1- arg))) result))) (provide 'linux-version) ;; eof