Skip to content

Instantly share code, notes, and snippets.

@wrought
wrought / models.py
Created December 3, 2012 09:52
django models implementing portion of hackerspaces space api
from django.db import models
class Status(models.Model):
open = models.BooleanField()
status = models.CharField(max_length=None)
lastchange = models.DateTimeField() # needs to be longint
class Events(models.Model): # example is "fire-alarm"
status = models.ForeignKey('Status')
name = models.CharField(max_length=None)
@wrought
wrought / backup.sh
Last active December 12, 2015 04:09
Localwiki backup script based on https://guide.localwiki.org/Backup
#!/bin/bash
timestamp=`date -u +%Y-%m-%d_%H-%M-%S`
tempdir=~/backups/localwiki-backup-$timestamp
# set stage
mkdir $tempdir -p # make (-p) parent directories as needed
# do the dirty work
cp -r /usr/share/localwiki/ $tempdir/usr.share.localwiki/
#!/bin/bash
####################
# CKAN installation script
# based on http://docs.ckan.org/en/master/install-from-source.html
####################
# @TODO Get these values as flags
dbpassword='abcde12345'
readonlydbpassword='abcde12345'
@wrought
wrought / pg_backup_git.sh
Last active December 15, 2015 21:59
backup postgres db with --inserts flag so it is easier to git track (instead of multiple snapshots, track snapshots with git)
#!/bin/bash
host="host"
user="pg_user"
port=1000
dbname="dbname"
# the "no-password" flag requires a .pgpass file with a password, to avoid being prompted for a password
pg_dump -h $host -U $user -p $port --no-password --inserts $dbname
@wrought
wrought / copyleft_all_wrongs_reversed.html
Last active December 19, 2015 03:29
Little javascript footer for informal rejection of copyright, as copyleft. Not a license, but a disclaimer, [read more](http://web.archive.org/web/20080101091757/http://www.iusmentis.com/copyright/allrightsreserved/)Replace $YOUR_NAME with the proper name for attribution, and $YOUR_URL with the proper URL for attribution.
<p><!--[if lte IE 8]><span style="filter: FlipH; -ms-filter: "FlipH"; display: inline-block;"><![endif]--><span style="-moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); display: inline-block;">&copy;</span><!--[if lte IE 8]></span><![endif]--> CopyLeft <a href="$YOUR_URL"><abbr>$YOUR_NAME</abbr></a>, All Wrongs Reversed, <script type="text/javascript">var d = new Date(); var year = d.getFullYear(); document.write(year);</script>.</p>
@wrought
wrought / .conkyrc
Created August 27, 2013 18:05
a config for crunchbang conky that displays more data, but keeps the keyboard shortcuts
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
@wrought
wrought / open-source-anti-patterns-by-byran-cantrill.txt
Last active December 25, 2015 19:49
Notes on Bryan Cantrill's talk on Corporate Open Source Anti-Patterns
Found this very interesting talk by Bryan Cantrill https://en.wikipedia.org/wiki/Bryan_Cantrill on Corporate Open Source Anti-Patterns: Doing It Wrong (youtube https://www.youtube.com/watch?v=NhgXQFk9noI & slides http://www.slideshare.net/bcantrill/corporate-open-source-antipatterns). His slides are verbose, a little rough, and hard to understand, so I took some notes and made a summary, trying to simplify:
Side-note - He pushes a few debatable viewpoints (common flamebait such as GPL vs other licenses), so take these phrasings with a grain of salt (wink)
Summary
Inverted Thinking:
Misconception that the benefits of open source are assumed to be primary ($). In actuality, benefits are typically secondary, tertiary, and one should consider the cost of sharing is pretty much $0.
Wishful Thinking:
@wrought
wrought / wordlists.html
Created October 21, 2013 22:02
Links to some word lists
<a name="resources">Resources used in compiling this wordlist</a></h2><a name="resources">
</a><ul><a name="resources">
</a><li><a name="resources"></a><a href="http://www.dcs.shef.ac.uk/research/ilash/Moby/">The Moby lexicon project</a> / Grady Ward <p>
</p></li><li><a href="http://ftp.digital.com/pub/misc/stolfi-wordlists/">The stolfi wordlists</a> / Jorge Stolfi and the original wordlist authors<br>
The wordlists in different languages were very useful in finding international words by intersection.<p>
</p></li><li><a href="ftp://ftp.ox.ac.uk/pub/wordlists">The wordlist collection at Oxford</a> / administered by Paul Leyland <p>
@wrought
wrought / peoplesopen.net
Last active December 27, 2015 08:29
default apache config file for a local instance of peoplesopen.net as peoplesopen.loc. Also need to modify /etc/hosts file or DNS settings elsewhere.
<VirtualHost *:80>
ServerName peoplesopen.loc
ServerAlias www.peoplesopen.loc
ServerAdmin webmaster@localhost
DocumentRoot /var/www/peoplesopen.loc/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
@wrought
wrought / california_driver_handbook_bcicyle_snippets
Created December 6, 2013 01:30
California Driver Handbook - English 2013
Page 23
Right-of-Way Rules - "It is important to respect the right-of-way of others, especially pedestrians, motorcycle riders, and bicycle riders."
Pedestrians - "A pedestrian is a person on foot or who uses a conveyance such as roller skates, skateboard, etc., other than a bicycle. A pedestrian can also be a person with a disability using a tricycle, quadricycle, or wheelchair for transportation."
Page 35-36
Shared Roadway Bicycle Markings (Sharrows) - "Sharrows are used to remind motorists that bicycles are allowed to lawfully use this portion of a lane. Sharrows are used to assist bicyclists with positioning on a shared roadway. They also alert motorists of the location a bicyclist may occupy within the traveled roadway."
Bicycle Lanes - "A bicycle lane is a designated traffic lane for bicyclists marked by a solid white line, typically breaking into a dotted line edning before it reaches the corner."
- "Treat a bicycle lane the same as other traffic lanes"
- "[Vehicles] may park in a bicycle lane