Skip to content

Instantly share code, notes, and snippets.

@leafstorm
leafstorm / print-server.md
Created April 11, 2017 02:09
How to set up a CUPS print server running Fedora Server for an HP printer, and connect to it from your Fedora Workstation:

How to set up a CUPS print server running Fedora Server for an HP printer, and connect to it from your Fedora Workstation:

Run these commands on the server:

dnf install cups hplip
systemctl start cups
firewall-cmd --zone=FedoraServer --add-service=ipp
firewall-cmd --zone=FedoraServer --add-service=ipp --permanent

Then go to the CUPS Web admin at http://[server]:631 and go to the "Administration" page.

@leafstorm
leafstorm / mountree.py
Created March 23, 2014 23:16
A script that arranges all your mountpoints into a tree.
#!/usr/bin/env python3
"""
mountree
========
This prints all your filesystem mounts in a tree so you can see how they
are laid out.
It only works on Linux because it uses ``/proc``.
:copyright: © 2014 Matthew Frazier
@leafstorm
leafstorm / brickyard.md
Created August 30, 2013 15:51
Ideas for the Brickyard PC environment.

Brickyard

Brickyard is a design for a simple (simulated) personal computer environment, to be used for OS development. It presents a highly simplified and idealized set of hardware (display, input, storage) to the CPU, so that people interested in OS development can focus on writing critical OS features like scheduling, interrupt handling, and memory management, without having to wade through the complexities of modern (or classical) hardware.

The CPU

Brickyard will use a MIPS32 CPU. This means that it will have to be emulated on almost all target platforms. However, even if ARM or x86 were selected, emulation would still be necessary on the "other" platform, and even on the host platform, highly platform- and OS-specific code would be necessary to allow for the needed degree of virtualization. Given that emulation is almost a requirement, MIPS was selected because it is easier to write emulators for than ARM or x86, but it still has a full GNU toolchain available.

A 32-bit CPU is used so that emulat

@leafstorm
leafstorm / gist:5558628
Created May 11, 2013 02:00
Synaptics settings for a Macbook Pro's touchpad.
synclient ClickFinger3=2
synclient MaxTapTime=0
synclient MaxDoubleTapTime=0
synclient TapButton1=0
synclient TapButton2=0
synclient TapButton3=0
synclient HorizTwoFingerScroll=1
@leafstorm
leafstorm / gist:4975030
Created February 18, 2013 03:56
LeafStorm's Relay Chat - my idea for an IRC-like chat system. This does not constitute a spec.

LeafStorm's Relay Chat

LRC is a chat protocol based on edn - Clojure's extension of S-expressions. The idea is to have a format that is easily typable and telnettable, but also clearly and consistently structured.

High-Level Overview

@leafstorm
leafstorm / gist:4238078
Created December 8, 2012 01:35
LUG @ NC State Constitution, Markdownified

% Constitution of the Linux Users Group at North Carolina State University % % November 21, 2000

Name and Purpose

This organization shall be known as the Linux Users Group (LUG) at North Carolina State University.

The purpose of this organization is to promote the use and usability of

@leafstorm
leafstorm / gist:4173435
Created November 30, 2012 02:37
Wolfline Route Naming and Numbering Proposal

Wolfline Route Naming and Numbering Proposal

Matthew Frazier, Department of Computer Science

With the new route restructuring proposed by HDR Engineering for the NC State Wolfline service, the Wolfline has an opportunity to rearrange its route names and numbering into a more cleanly organized system.

Demonstration Network

The original draft of this plan used the 10-year Wolfline service plan as proposed by HDR Engineering. However, at the publication of the Wolfline Fall 2012 system map, it became apparent that NC State Transportation did not plan to follow the plan exactly. (Not that I mind.)

@leafstorm
leafstorm / gist:3342583
Created August 13, 2012 17:20
The LUG @ NC State Brand Book

LUG @ NC State Brand Book

This is our totally strict set of guidelines about how to refer to the Linux Users' Group at NC State University, and produce print media about the LUG.

Names

The official, formal name of the LUG is "the Linux Users' Group at North Carolina State University." Never use this except when drafting legal documents.

In situations where a "full" name (but not a legal name) is necessary, use "Linux Users' Group at NC State University." For a shorter name, use "LUG @ NC State."

@leafstorm
leafstorm / gist:2907123
Created June 10, 2012 19:53
ItemBox, A serialization format I never got around to implementing

ItemBox 1.0 draft 1

ItemBox is a binary format for serializing data in a language-independent way, similar to JSON, YAML, BSON, MessagePack, and other formats. ItemBox is specifically designed for encoding and decoding speed, space efficiency, and ease of implementation.

Types Representable

@leafstorm
leafstorm / gist:2323188
Created April 6, 2012 21:43
PEG.js parser for DCPU-16 assembly language
/**
* Parser for DCPU-16 assembly language.
* This parser should accurately parse all of Notch's example code, and most
* of the community's code.
* It converts instructions to objects with fields {op, params, label}.
* op is the lowercased opcode, params is the parameters passed to it (as
* values), and label is the label prefixing the statement (null if the
* statement is unlabelled).
* Values have a type field and one or two others depending on the type.
*