-
This weekend I wanted to blog about libgit2sharp but I realized that my setup for blogging wasn’t really practical. I used dotclear but by insisting on markdown and refusing the graphical editor it was only an hindrance for me.
In response I investigated the domain of the simple blogging platforms running only locally and generating html files. The one I ended up using is a ruby tool named Jekyll; the one that is used by GitHub for their GitHub pages.
What is nice is that using a web-hook on my blog repository the simple fact of pushing a new markdown file or modifying a sass file will re-generate all my blog with the changes.
-
One sad thing in WPF currently is that the
CommandBindingsused to attach an action to aRoutedCommanddon’t support the MVVM pattern : Their properties can’t be easily bound to the DataContext, and they don’t support attaching a command represented by anICommand.One of the solutions have always been to use the command sink that Josh Smith provided in it’s CodePlex article Using RoutedCommands with a ViewModel in WPF. But it’s syntax force multiple changes on the view and also force the model to implements the
ExecuteandCanExecuteindependently out of anICommandand don’t begin to support theCanExecuteChangedevent.My solution was to roll my own classes, that you could find in a Gist on GitHub to use it instead of a CommandBindings block in your
UIElementyou declare an attached property calledMvvm.CommandBindingsand use it with nearly the same syntax :<Window x:Class="BlackFox.SampleWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:f="clr-namespace:BlackFox" > <f:Mvvm.CommandBindings> <f:MvvmCommandBindingCollection> <f:MvvmCommandBinding Command="f:MyRoutedCommands.SomeRoutedCommand" Target="{Binding MyCommandInViewModel}" CanExecuteChangedSuggestRequery="True" /> </f:MvvmCommandBindingCollection> </f:Mvvm.CommandBindings> </Window>The only differences are that there is a
Target(ICommand) property instead of the methods and that you could optionally force aCommandManager.InvalidateRequerySuggested();when the command’sCanExecuteChangedevent is raised. -
What i’ll explain here is how to use the
svndumpfilterprogram to extract a folder of an SVN repository in it’s own repository and make it disappear from the history of the original one.What you’ll need
You will need direct access to the server and to warn all your users that they’ll need to checkout again everything you will move (if you don’t renumber the revisions otherwise all users will need to checkout again any part of the repository they use)
Knowing what to filter
You will need to include all the folders you want along with all the folders where something moved, for example if you want
/some/dirbut it was at some point in the history named/somedirand renamed later you need to include both in the filter.The same apply if only some of the files moved from there in this case you need to include each file that moved.
You’ll end up with a list of files and directories representing all the history of the files that will be extracted.
Dump the repository
The first step is to dump the repository as
svndumpfilteronly act on dumps and not on directories themselvessvnadmin dump repo > repo.dumpFilter the history and load it in a new repository
To create a dump that contains only the change in our chosen directories the command is :
svndumpfilter include --drop-empty-revs --renumber-revs /some/dir /somedir < repo.dump > repo-only-some-dir.dumpThe two options
--drop-empty-revsand--renumber-revsare what you’ll need in 99% of the cases but anyway you’ll either want both or none :- Both will give you a clean new repository with new revisions starting at zero and no empty revisions. It’s clean but if you had anywhere else (in the source code comments, in your issue tracker or in some commit message) something referencing “r3628” it will now be incorrect.
- None will give you a chance to have the same revision numbers (Only if you don’t need to create new directories otherwise all revision numbers will move, see next paragraph)
Then you’ll need to create a new repository
mkdir newrepo svnadmin create newrepoIf some of the directories you included had a parent that wasn’t himself included (like our
/some/dirdirectory) you need to create them backsvn checkout "file:////path/to/newrepo/" newrepocheckout mkdir newrepocheckout/some svn add newrepocheckout/some svn commit newrepocheckout -m "Prepare to load filtered history" rm -R newrepocheckoutThen finally load your filtered history :
svnadmin load newrepo < repo-only-some-dir.dumpRemove the files from the originating repository history
It’s simplier as you normally won’t have to create any directory, just load the dump in place of the old repo.
The same choice is offered to you regarding removing the now-empty revs from the history and renumbering the other revisions but in this case it’s more logical to keep the revisions as it will allow for all users that hadn’t checked out the removed directories to continue to work with their checkouts. Otherwise they’ll need a clean new checkout.
rm -R repo svndumpfilter include /some/dir /somedir < repo.dump > repo-without-some-dir.dump mkdir repo svnadmin create repo svnadmin load repo < repo-without-some-dir.dump -
The SSL Observatory is a great project from the EFF to gather all SSL certificates available on HTTPS websites and publish them for analysis. For more details see the SSL Observatory website.
The main problem if you don’t want to analyse it using their pre-configured Amazon EC2 configuration is that the compressed .sql file is around 3 Go compressed using LZMA and 3 To uncompressed so you can’t even un-compress the file and need to pipe directly from 7-Zip to mysql.
To do it either on windows or linux :
7z e -so "observatory-dec-2010.sql.lzma" f | mysql -u root --password=toto42sh observatory2Note: The 7z tools is in the
p7zippackage on a debian system. -
Once a SheevaPlug is formated with sheevaplug-installer the minimum to do is :
Set the MAC address
Connect to the serial console, enter U-Boot and set the MAC address :
setevn ethaddr 00:50:43:01:D2:94 saveenv resetSet timezone and hostname
Login and type :
# Set the time-zone dpkg-reconfigure tzdata #Set the host name echo plugfox.vbfox.local > /etc/hostname /etc/init.d/hostname.sh