pyGitBook
As part of doing the report for my Software Design and Development project i tried to find an easy tool that i could use to convert all of my git history into a basic (but nice looking) logbook that i could hand in as part of the project.
Unfortunately i couldn't find any tools that would do this for me. The closest i could find was the commit log that git-hub provided something similar to what i was after but provided alot of stuff such as avatars and commit hashes that i didn't need.
So i decided to quickly whip up a script to pass output from git-log and turn it into a nicely crafted logbook.
To interface with git i originally looked into GitPython but it proved to be rather buggy and hard to work with so i ended up going the much more low tech method of just parsing the output of a standard git-log command.
For the output i decided that using HTML via Jinja2 would be the easiest method as it would allow the template to be updated very easily down the track.
Eventually i came up with a system that i am reasonably happy with, it could do with a bit more work but it will do for now, at least until i have got all my projects out of the way.
An example of the output can be seen HERE
The script is available on github at https://github.com/Hugoagogo/pyGitBook
Cleaning up the itunes media directory
In the process of moving my iTunes library to my new laptop (well its not so new anymore), iTunes has somehow managed to duplicate my entire library, creating a copy of every track, movie, tv show ect, and giving the duplicate some obfuscated name, i.e. ABCD.mp4
Besides being a large bunch of unnecessary files, they eat up a lot of HDD space, around 100GB.
After finally finding out what was eating up my HDD space it was easy to write a quick little python script to find and remove all of these files.
import re, shutil, os
CLEAN_FROM = r"C:\Users\Hugh\Music\iTunes\iTunes Media"
CLEAN_TO = r"C:\Users\Hugh\Desktop\junk"
FILETYPES = ["mp4","m4a"]
if not os.path.exists(CLEAN_TO):
os.makedirs(CLEAN_TO)
pat = re.compile("[A-Z]{4}[.](%s)"%"|".join(FILETYPES))
print "Starting"
for dirpath, dirnames, filenames in os.walk(CLEAN_FROM):
for fname in filenames:
if re.match(pat,fname):
shutil.move(os.path.join(dirpath,fname),os.path.join(CLEAN_TO,fname))
print "Moved: "+fname
print "Done"
I do not guarantee this script will work for you and check what you actually delete before you actually do it
Marble run plans complete
Well after lots of screwing around in Autodesk Inventor I finally have the final plan drawn up for the marble run portion of the machine.
I have also made a major change to my expected overall design, making it a much flatter design, making for simpler parts and less supports needed.
I started just doing one small portion of the mechanism i decided to call the dripper because it "drips" marbles, from this i also had a go at running dynamic simulations and managed to run and test the "dripper" and render a video of how it went.
More recently I have also rendered an image of the whole setup (without the cabinet, pivots ect) and can be found HERE (my thumbnail generator is not working properly)
I have printed out templates for all of the pieces and plan on cutting these out as MDF templates some time next week.
Squiglet – Now with examples
Just a little progress report to say that my vector library is nearing V1 and i will soon be able to resume work on Saga of Sol.
As of yet i just need to tweak the draw function of the vectors to fix an odd bug where the lines will have gaps near the corners of some shapes as well as adding some more functionality to the editor.
As usual the project is available HERE
book-expander
As messing around getting some ebooks onto my nice new kindle, i have run across the problem where some books have been poorly OCRed and have lost a few spaces along the way. i.e. "Monty python" may become "Montypython"
To combat this i have written up a little script that will search though and try to identify and correct where this has happened.
Currently i have it all setup and hard-coded for use on ZIP/HTML exports from calibre returning a new zip that can be re imported. If you are interested in using the functionality on just plain text feel free to download it and use the clean_book function.
All the code and bug tracker can be found HERE on GitHub



