Tag Archives: Linux

Mapping Pixel People formulae with graphviz

pixel peopleI had reached the “end” of the Pixel People game sometime ago, but it was not the end of my experiment as yet.

Basically the professions unlock formulae was going to be the base for me to do some link plotting of their relationships. Graphviz works with the DOT file format, which is nothing more than a text file, so it makes for nice shell scripting. Of course there are other awesome helper libraries like afterglow (messed around with it a bit in the past) which make use of the graphviz library to do the final plotting, but being able to plot directly with graphviz also gives us some more flexibility to do whatever we want (most of the time).

Part of the raw file, with the formulae:

mayor
mechanic
engineer = mayor + mechanic
sheriff = mayor + mayor
architect = mayor + engineer
landscaper = assistant + architect
deputy = assistant + sheriff
gardener = landscaper + deputy
mechanical engineer = mechanic + engineer
botanist = farmer + farmer

The code to create the two DOT files (undirected and directed graphs), and to generate the images based on different layout algorithms. Circo, fdp and sfdp layouts weren’t really useful for this kind of graph, so I commented them out.

#!/bin/sh

echo "graph pixpple {" > graph.dot
echo "overlap=scalexy;" >> graph.dot
echo "splines=true;" >> graph.dot
cat formulae | sed -re 's/ /_/g' -e 's/^(.+)_=_(.+)_\+_(.+)$/\2 -- \1\n\3 -- \1/' | sed -r 's/$/;/' >> graph.dot
echo "}" >> graph.dot

echo "digraph pixpple {" > digraph.dot
echo "overlap=scalexy;" >> digraph.dot
echo "splines=true;" >> digraph.dot
cat formulae | sed -re 's/ /_/g' -e 's/^(.+)_=_(.+)_\+_(.+)$/\2 -> \1\n\3 -> \1/' | sed -r 's/$/;/' >> digraph.dot
echo "}" >> digraph.dot

echo "============================================="
dot -v -Tpng digraph.dot > dot.png

echo "============================================="
neato -v -Tpng digraph.dot > neato.png

echo "============================================="
twopi -v -Tpng digraph.dot > twopi.png

#echo "============================================="
#circo -v -Tpng digraph.dot > circo.png

#echo "============================================="
#fdp -v -Tpng graph.dot > fdp.png

#echo "============================================="
#sfdp -v -Tpng graph.dot > sfdp.png

The front part of the digraph DOT file:

digraph pixpple {
overlap=scalexy;
splines=true;
mayor;
mechanic;
mayor -> engineer;
mechanic -> engineer;
mayor -> sheriff;
mayor -> sheriff;
mayor -> architect;

The front part of the graph DOT file:

graph pixpple {
overlap=scalexy;
splines=true;
mayor;
mechanic;
mayor -- engineer;
mechanic -- engineer;
mayor -- sheriff;
mayor -- sheriff;
mayor -- architect;

And some results…

dot layout output
dot layout output
neato layout output
neato layout output
twopi layout output
twopi layout output

Ubuntu profiles for Volatility

VolatilityJust to share some profiles I made for analyzing Ubuntu (Linux) memory dumps in Volatility.

Profiles were made according to the instructions in http://code.google.com/p/volatility/wiki/LinuxMemoryForensics

HTH!

Visualizing binary samples, now with scripts!

Well, have worked the stuff from my previous post into a set of scripts, just to share. For more on the visualizing of binary samples and why/how it works, you can refer to that post for more details.

You can download the code here. You need to have gnuplot installed. And yes, this runs in Linux (perhaps it could run in cygwin too, but YMMV).

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

How to use: (the output folder defaults to ./output/ )

./generate_scatterplots.sh <binaries_folder> [<output_folder>]

HTH.

Continue reading Visualizing binary samples, now with scripts!