Skip to content

Instantly share code, notes, and snippets.

@lispm
lispm / insults.lisp
Created November 14, 2018 19:42
Shakesperian insults by Jerry Maguire in Lisp
;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Author: [email protected]; Coding: latin-1; Base: 10; Readtable: CL -*-
; Shakesperian insults by Jerry Maguire
; Lisp code: Rainer Joswig, 2018, [email protected]
(defparameter *insult-data*
#(#("artless" "bawdy" "beslubbering" "bootless" "churlish" "cockered" "clouted"
"craven" "currish" "dankish" "dissembling" "droning" "errant" "fawning"
"fobbing" "froward" "frothy" "gleeking" "goatish" "gorbellied"
"impertinent" "infectious" "jarring" "loggerheaded" "lumpish" "mammering"
@priyadarshan
priyadarshan / illumos-wipe-disk.sh
Last active May 31, 2020 09:32
illumos/OmniOS - Wipe disks in order to re-use them from previous zpool
#!/usr/bin/ksh93
# This script only wipe same-sized disks for now
SIZE="10000831348736"
LAST_PART=`echo "($SIZE / 1024 / 1024) - 10" | /usr/bin/bc`
# List of disks to wipe
DRIVES="c0t5000CCA26BD0CAFAd0p0 c0t5000CCA26BD116ACd0p0 c0t5000CCA26BD59F6Dd0p0 c0t5000CCA26BD5AAC5d0p0
c0t5000CCA26BD6960Ed0p0 c0t5000CCA26BD6B9CCd0p0 c0t5000CCA26BD6C6D4d0p0 c0t5000CCA26BD6E59Cd0p0"
@gkbrk
gkbrk / lobsters-mastodon.lisp
Last active January 20, 2023 06:20
Common lisp Mastodon bot
(ql:quickload :drakma)
(ql:quickload :cl-json)
(ql:quickload :plump)
(ql:quickload :babel)
(ql:quickload :tooter)
(ql:quickload :split-sequence)
(defvar *feed-path* "https://lobste.rs/rss")
(setf drakma:*drakma-default-external-format* :UTF-8)
@alphapapa
alphapapa / ap-helm-find-files.el
Created May 31, 2018 04:03
Custom Helm find-files command
(defun ap/helm-find-files ()
(interactive)
(helm :sources '(ap/helm-source-ivy-views
ap/helm-source-current-file-other-buffers
helm-source-buffers-list
ap/helm-source-files-in-current-dir
helm-source-org-recent-headings
helm-source-bookmarks
ap/helm-source-recentf
ap/helm-source-bindir
@unhammer
unhammer / my-bbdb-notmuch.el
Created May 27, 2018 08:32
search notmuch mail from bbdb
(require 'bbdb)
(defun my-bbdb-notmuch-search (&optional record)
"Search for emails to/from RECORD (or current record if interactive)."
(interactive)
(let* ((record (or record (bbdb-current-record)))
(mails (bbdb-record-field record 'mail))
(query (combine-and-quote-strings mails " OR ")))
(notmuch-search query)))
(define-key bbdb-mode-map (kbd "F") 'my-bbdb-notmuch-search)
@priyadarshan
priyadarshan / cl-udpip.lisp
Created April 29, 2018 10:09 — forked from shortsightedsid/cl-udpip.lisp
Short guide to UDP/IP Client/Server programming in Common Lisp using usockets
; Short guide to UDP/IP Client/Server programming in Common Lisp using usockets
;
; The main reason for this guide is because there are very few examples that
; explain how to get started with socket programming with Common Lisp that I
; could understand.
; After working on a short example on TCP, I found the
; need for a UDP tutorial. So, here goes.
; As usual, we will use quicklisp to load usocket.
@death
death / ql-gitify.lisp
Created March 30, 2018 22:46
Facilitate creating Git repositories for third-party Quicklisp projects.
(defpackage #:snippets/ql-gitify
(:documentation
"Facilitate creating Git repositories for third-party Quicklisp
projects.")
(:use #:cl)
(:import-from #:constantia #:out #:print-table)
(:import-from #:split-sequence #:split-sequence)
(:import-from #:alexandria #:starts-with-subseq #:hash-table-plist)
(:import-from #:ql #:qmerge)
(:export
pfexec bhyve
-H
-B "1,product=OmniOS HVM"
# SmartOS never specifies a hostbridge, amd_hostbridge is needed for at least Free/OpenBSD
# Options are none, hostbridge or amd_hostbridge
# NB: For 'hostbridge' vendor and device are set to a NetApp id
-s 0,amd_hostbridge
# LPC PCI-ISA bridge providing connectivity to com1, com2, and bootrom
@priyadarshan
priyadarshan / fido-dmesg.txt
Created February 7, 2018 08:49
Fido II first DMESG
root@fido:~ # dmesg
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(efifb): resolution 1280x1024
CPU: AMD Ryzen Threadripper 1950X 16-Core Processor (3393.71-MHz K8-class CPU)
@priyadarshan
priyadarshan / 1
Last active February 7, 2018 08:50
1
root@fido:~ # dmesg
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(efifb): resolution 1280x1024
CPU: AMD Ryzen Threadripper 1950X 16-Core Processor (3393.71-MHz K8-class CPU)