Subscribe to the RSS Feed

Paradox - a statement or proposition that seems self-contradictory or absurd but in reality expresses a possible truth.

:: BINARY PARADOX ::

Stepping stone to the /dev/null in the sky

High-speed note taking with Textile

It’s no secret that I’m a Computer Science student. From this you can infer a couple of things fairly reliably:

  1. I have terrible handwriting
  2. I take class notes frequently
  3. My computer spends enough time with me that it might as well be an appendage
  4. I’m lazy and want to script away anything mundane

These factors eventually led me to experiment with various strategies to allow me to take notes on the computer (solving the handwriting and frequent note issues) while at the same time maintaining a low level of effort.

I started by taking notes in OpenOffice/MS Word but found that this was exceptionally annoying. All I was ever doing was creating bulleted lists, numeric lists, various heading sizes, and some minor stylistic effects like bolding and italics. I became proficient enough with the keyboard shortcuts that I could do it with modest speed, but it was becoming clear that OpenOffice was overkill. I eventually ended up using a EEEPC Netbook for the majority of my class time and the 1 gigabyte of RAM was being squandered on this large word processing app. It was also really annoying to try and find specific notes later. There was no easy way to search the content from the command line using grep or the other utilities I’m familiar with.

This led me to writing notes in plaintext format. I’d use indentation and some simple conventions to indicate different things. This was great in the sense that I was able to write the notes very quickly (certainly a factor to consider as a lecturer flies through material as fast as they can get the words out). The flat text file approach was easy to search, easy on RAM, and fast! Using my favourite text editor (VIM) I was able to have spellchecking and little requirement for a mouse or GUI.

Of course flat text files were exceptionally plain. They lacked all of the stylistic elements and visual cues that made the OpenOffice notes nice to study from. I needed something that was the best of both worlds. Around the same time I reached this conclusion I had converted this Website to the TextPattern CMS The content in this CMS is built around a very very simple wiki-like mark-up called Textile . It was perfect for my website content. I could put asterisks around text to bold it, indicate header levels with a few characters at the start of a line, and create tables quickly by just drawing their rough structure with plain ASCII around the cell contents. You can experiment with Textile yourself as the comment form at the bottom of each article/page allows a slightly more limited subset of Textile.

After some research I realized that I could build a script that would process my raw text files written in VIM into XHTML with all of the wonderful visual cues I needed. I found a Python binding for the Textile engine and started to get to work. The result of an afternoon of Python hacking is the note_converter.py script that you’ll find at the bottom of this page.

It meets all of my requirements, and it might meet yours. Feel free to download the script (requires Python 1.6 and the PyTextile library). The source is pretty clean and well commented, though it’s one of my first forays into bin commands in Python. Remember to chmod +x the script before trying to run it. Running it with no arguments will print the help and available arguments.

For my own purposes I create a directory for each class with my txt Textile notes in it. I also include a html template file with the magic content replacement string inside it so that I can have a consistent CSS and header/footer for each course.

Future plans include writing a Vim extension to add the script as a command able to be run easily from within Vim while editing a textile note file. Stay tuned!

Download the note_converter.py script

EDIT After some prodding I’ve included an example of what the textile markup looks like and what it comes out rendered as.

The following is the textile markup you’d create in your editor of choice. It’s super simple and really easy to pick up.

h2. A title
h3. A subheading

p. A paragraph with some *bold* text, some _italics_. Etc, etc
bq. Block quote! Oh gnoes! Where is the reference???

p. Todo List:
# Learn LISP
# ???
# Profit!

p. Mixed multi-level list:
* A point
** How rare!
* Point two
*# Zombies
*## Brain eating zombies

* Vampires
# Day walkers
# Sparkly ones
* What was the point of this again?

p. How about a link? "I like links!":http://slashdot.org

p. Tables are easy too!
|_. Name |_. Awesome |
| Dan | Yes |
| Other | No |

p. And finally, of course... code: @System.out.println("Hello World!");@

It will then render as (well, without my website stylesheet’s effects) as:

A title

A subheading

A paragraph with some bold text, some italics. Etc, etc

Block quote! Oh gnoes! Where is the reference???

Todo List:

  1. Learn LISP
  2. ???
  3. Profit!

Mixed multi-level list:

How about a link? I like links!

Tables are easy too!

Name Awesome
Dan Yes
Other No

And finally, of course… code: System.out.println("Hello World!");


Darwinian Security - Evolving the PWN

Lately I’ve been thinking a little bit about experimenting with the amalgamation of Artificial Intelligence algorithms and different aspects of Information Security. I’m hardly an AI expert, but I’ve had some limited academic exposure to the foundation of a few branches of AI research. I think the important thing is that I’ve seen enough of the material to get my mental wheels spinning.

I’ve thought of two specific concepts I think deserve exploration when time permits. I’m posting my interim thoughts here about one of them mainly to garner some constructive feedback and hopefully some resources. I’m an info sec enthusiast, but certainly not an expert. It would be a great help if I could try finding some related journal publications. Due to the… more obscure… nature of the areas of study I’m also interested in any “less formal” (see: ezines, blogs, mailing lists) research that may relate.

read more...

JRiver Advanced

My open source project to make MUDing accessible. I want to promote new and interesting mash-ups with the MUD paradigm. JRiver will be LP inspired, but abstract enough to handle several game types: MUD, MUSH, MOO, Talkie, etc. We’re aiming to be general wherever we can and providing game-specific example lib code where we can.

read more...

Deflash Script

Many people are aware of HTTP cookies, generally used to add statefulness to the otherwise stateless HTTP protocol. Great for session tracking, preference persistence, etc. Also great for privacy invasion and general ad tracking. Due to the perceived privacy issues, many users delete their browser cookies frequently.

Unfortunately Adobe Flash contains the seldom publicized ability to create it’s own persistent tracking objects outside of the control of your browser. It isn’t very easy to clear these persistent flash objects, and due to being relatively unknown, marketers are now using them to “respawn” traditional HTTP cookies. I.e. when a site wants to track you it will set an HTTP cookie AND a flash “cookie”. If the page detects later that you have a Flash cookie but no HTTP cookie it will recreate aka “respawn” the HTTP cookie using the Flash data.

read more...

Cracking Local Passwords

For a Network Security Class we were asked to prepare a brief document describing techniques used to crack both Windows LM hashes and Linux Shadow Hashes.

Though covered to death elsewhere I figured I might post it here anyway, just for kicks.

Enjoy!

read more...

Powershell Backup Script

I’ve been playing a bit with Windows Powershell (codenamed Monad). Not a bad piece of software all things considered! Certainly a world better than standard Windows XP cmd.exe.

My problem task was that I needed a basic backup script that I could add as an ‘at’ job for a Windows Server 2003 box at work.

It is a very small time operation so all of our backups are stored on two external harddrives. At the end of each week we swap the currently plugged in drive and cycle it out with the second drive. This way we can have one backup drive stored offsite and in a worst case scenario, we’ve only lost a week of data.

read more...

← Previously