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 / shapefile-urls.txt
Created April 6, 2015 16:03
The URL's to every shapefile offered for download by Wake County. `wget -i shapefile-urls.txt`
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Buildings_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Communications_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_ElectricUtilities_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_FireResponse_2015_02.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Hydrology_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_HydrologyAreas_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_MiscLines_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_MiscPolys_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Parking_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Railroads_2013.zip
@leafstorm
leafstorm / tillis-letter.txt
Created February 4, 2015 03:15
Letter to Sen. Thom Tillis regarding his recent statements on hand-washing.
Dear Sen. Tillis,
While it may be the case that some unnecessary regulations are overburdening
our small businesses, the idea that requiring employees to wash their hands
after using the bathroom is unnecessary is completely disgusting. Washing
hands is acknowledged by every medical authority ever as a critical way to
prevent the spread of germs and other contaminants. The idea that public
establishments should be able to forgo such requirements shows a serious
lack of concern for the health of your constituents. I strongly encourage
you to apologize for your use of hand-washing as an example of an "unnecessary
@leafstorm
leafstorm / streamncv.py
Created November 12, 2014 17:52
Python script for decoding NCSBE voter data
#!/usr/bin/env python3
"""
streamncv.py
============
Translates from latin-1 tab-separated-values to UTF-8 comma-separated values
on the fly, without trying to allocate the entire file.
It also prints progress updates.
"""
import csv
@leafstorm
leafstorm / packages.txt
Created August 6, 2014 22:37
Command-line packages to download on Red Hat family machines
nano
fish
tmux
man-pages
ntfs-3g
ack
tree
dos2unix
parallel
unzip
@leafstorm
leafstorm / FastGetter.java
Created July 31, 2014 18:18
An implementation of a Jython FastGetter that doesn't work for some reason.
package jesreflect;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.python.core.Py;
import org.python.core.PyObject;
/**
* An optimized getter that's designed to invoke a Java class's
* getSomething method, with no arguments, and wrap the return value.
@leafstorm
leafstorm / easter.md
Created April 20, 2014 20:57
Some thoughts on Easter, and why it's important.

"But now Christ has been raised from the dead, the firstfruits of those who have fallen asleep. For since death came through a man, the resurrection of the dead also comes through a man. For as in Adam all die, so also in Christ all will be made alive." -- 1 Corinthians 15:20-22

When I was at PyCon, I hung out with @jacobian, @brainwane, and some others while they were painting their nails. The subject turned to religion, and I quickly realized as a person who wasn't a secular humanist, I was a bit of an outlier.

When asked, I began talking about some of what's in the Bible. Jacob asked, "So, you believe the things in the Bible actually happened?" I said "yes." The conversation didn't last long afterwards...we were interrupted by something, I forget what. But given that it's Easter, I'd just like to expound a bit on how that idea is relevant to Christ's resurrection.

The attitude I see a lot of humanists have towards religion is, "Hey, believe whatever you want, so long as it makes you a better person." In

@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 / lessons-learned.md
Last active August 29, 2015 13:56
FOSS Fair 2014: Lessons Learned. Originally derived from a pair of paper towels at Ba-Da Wings.

FOSS Fair 2014: Lessons Learned

First off, FOSS Fair was a lot of fun, and I really look foward to the next one. But, I think we can run it better next time. So, here are my thoughts.

Early Coordination

We were disadvantaged this FOSS Fair by our late start date and our lack of connections. Fortunately, next year we can get started earlier, and we have a few key ideas:

  • Announce the Fair and call for volunteers as early as possible.
@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