Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / cl-tcpip.lisp
Created April 29, 2018 10:08 — forked from shortsightedsid/cl-tcpip.lisp
Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
; Short guide to TCP/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 spending a day trying, I finally came up with a small
; bit of code that makes it easy to understand the basics. I've written this
; primarily for myself, but should help others get started as well.
; As usual, we will use quicklisp to load usocket.
@priyadarshan
priyadarshan / plex-on-omnios-r151028-lx-zone.md
Last active May 17, 2022 17:48
Install Plex on OmniOS r151028 via lx zone
@priyadarshan
priyadarshan / PolicyKit.conf
Last active December 28, 2021 18:00
FreeBSD 11 notebook installation cheat-sheet
# /usr/local/etc/PolicyKit/PolicyKit.conf
# Allow normal users to mount removable media automatically
<config version="0.1">
<match action="org.freedesktop.hal.storage.mount-removable">
<return result="yes"/>
</match>
<match action="org.freedesktop.hal.storage.mount-fixed">
<return result="yes"/>
</match>
@priyadarshan
priyadarshan / gist:2464631
Created April 22, 2012 15:28
An O(n) implementation of McCreight's suffix-tree algorithm.
;;; Original URL: http://fpn.mit.edu/Downloads/SuffixTree
;;; Copyright rif@mit.edu 2004.
(defpackage :suffix-tree
(:export :build-suffix-tree :stree-root :*stree-print-string*
:random-string :subtree-size :count-leaves)
(:use :common-lisp))
;; An O(n) implementation of McCreight's suffix-tree algorithm.
;; Usage example:
@priyadarshan
priyadarshan / words
Created August 1, 2020 16:50 — forked from wchargin/words
/usr/share/dict/words
This file has been truncated, but you can view the full file.
A
A's
AA's
AB's
ABM's
AC's
ACTH's
AI's
AIDS's
AM's
@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"
(ql:quickload "cl-ppcre")
(ql:quickload "anaphora")
(defpackage :ini-parser
(:use :common-lisp :anaphora)
(:export :read-config-from-file))
(in-package :ini-parser)
(defparameter +empty-line+ (format nil "~%"))
@priyadarshan
priyadarshan / ntfs-filenames.txt
Created February 11, 2020 18:59 — forked from doctaphred/ntfs-filenames.txt
Invalid characters for Windows filenames
Information from https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx :
Use any character in the current code page for a name, including Unicode
characters and characters in the extended character set (128–255), except
for the following:
- The following reserved characters:
< (less than)
> (greater than)
@priyadarshan
priyadarshan / shell-script
Created February 11, 2020 18:59 — forked from doctaphred/shell-script
How to start every shell script, since I can never remember
#!/bin/sh -euvx
# -e If non interactive then exit immediately if a command fails.
# -u Treat unset variables as an error when substituting.
# -v Print shell input lines as they are read.
# -x Print commands and their arguments as they are executed.
@priyadarshan
priyadarshan / bench.sh
Created July 13, 2016 15:08
Bench.sh - Benchmark Script Version 2.1
#!/bin/bash
#####################################################################
# Benchmark Script 2.1 by SavageWS6 from FreeVPS #
#-# Copyright(C) 2015 - SavageWS6 #
#-# License: GNU General Public License 3.0 #
#+# Copyright(C) 2015 - 2016 by SavageWS6 #
# Github: https://github.com/savagews6/bench-sh-2.1 #
#####################################################################
# Original script by akamaras/camarg #
#####################################################################