Skip to content

Instantly share code, notes, and snippets.

@thedod
thedod / README
Created May 29, 2011 08:31
Woof (one-time file exchange) + helper scripts
Woof is an amazingly simple and effective file exchange tool:
http://www.home.unix-ag.org/simon/woof.html
This distribution doesn't include simon Budig's original woof
(that started breaking for me), but Edward Samson's fork:
https://bitbucket.org/edu/woof
Desktop helper scripts:
filewoof and folderwoof "open with" actions for nautilus etc.
and woofget that runs "woof -U" in a terminal window in /tmp
(e.g. for a launcher button)
@thedod
thedod / c2g.py
Created September 6, 2011 21:47
cable2graph of (TELAVIV|JERUSALEM) related clusters
from il_related import il_related
sg = g.subgraph(g.vs.select(_degree_gt=1, place_in=il_related))
print sg.summary()
i = 0
for c in sg.clusters():
if len(c) > 10:
ssg = sg.subgraph(sg.vs.select(c))
filename = 'il-rel-%03d.gml' % i
print filename
print ssg.summary()
@thedod
thedod / README.md
Created September 9, 2011 15:08
svg template for @c2graph (enhances reVerb text contrast)

Pulled wlwardiary's latest template where reVerb extractions are only visible on mouse over. Pretty slick.

This svg template shows everything quite gray and transparent, and gives the reVerb text maximum opacity and colors [not necessarily nice ones. I'm color blind] to enhance contrast.

Usage: python g2svg.py -t contrast4reverb.tmpl ...

@thedod
thedod / README.md
Created January 18, 2012 13:58 — forked from makevoid/README.md
Thorrents.com JSONP embedded search example

Example of embedded http://thorrents.com search, and a tribute to Cory Doctorow ;) tnx to @thedod

See it live here.

If you want to embed this (or any other search) in an existing page:

  • Remove first and last line and paste this where you want it in the <body/>.
  • Change query to whatever you want to search (and maybe change limit).
@thedod
thedod / README.md
Last active February 26, 2016 00:41
Demagnetizr - Tweetable magnet urls
@thedod
thedod / README.md
Created March 18, 2012 08:16
Occupy Ubuntu Unity (regain control over "open with")

Ubuntu used to be a respectable linux distro, but Unity is their attempt to join the coming war on general computation and turn my personal computer into an impersonal "appliance". I could theoretically use gnome shell, but due to developer politics (and I don't care who's to blame here), the thing is buggy on Ubuntu.

One of the things that are crucial to my freedom as the person who actually paid for this hardware is to associate shell scripts like ~/bin/my-very-own-script to various mime-types as open with (running woofs in a terminal is a good example).

When you go to open with tab at properties, you can no longer specify a path. It's all WYGIWYD (what you get is what you deserve) now. Like Apple and politics :)

Hell, even windows lets you do that (at least used to. I'm too lazy to find a friend with windows to check whether it's still true).

The trick is to create (for each script you want to use) a

@thedod
thedod / pp_test.html
Created May 12, 2012 11:11
django-paypal subclass tweaks. Support cart + auto sandbox/4real form action
{% extends "base.html" %}
{% block title %}Test django-paypal cart{% endblock %}
{% block content %}
<h1>Testing django-paypal cart</h1>
{{ form.render }}
{% endblock %}
@thedod
thedod / gencsr.sh
Created July 4, 2012 04:25
Generate ssl key and csr. Short script, but I keep forgetting the syntax :)
#!/bin/sh
mkdir $1
cd $1
touch $1.key
chmod 600 $1.key
openssl genrsa -out $1.key 2048
openssl req -new -key $1.key -out $1.csr
more $1.csr
@thedod
thedod / tahoe-permalink.nginx
Created November 8, 2012 06:50
Shorter permalinks for Tahoe-LAFS/TiddlyWiki sites like https://dubiousdod.org
@thedod
thedod / Makefile
Created November 18, 2012 19:09
Example of a lafs-rpg "browse-me-not mountpoint" (work in progress)
# Now that it works, here's how I've tweaked the Pelican Makefile:
# The find line creates an empty index.html if needed
#...
html: clean $(OUTPUTDIR)/index.html
find $(OUTPUTDIR) -type d -exec touch '{}/index.html' \;
@echo 'Done'
#...