After all that mess about US Embassy Cables on WikiLeaks I think this is a good moment to explain to a political analyst/columnist why he or she should use Linux. I will not cover here how to download distro, cut a CD and install Linux, every distro is giving those instruction in detail. I will describe how it looks on Ubuntu, though it will look about the same on any other distro.
We point Firefox to http://wikileaks.ch/cablegate.html and towards the bottom of the page we locate “Click here to download full site in single archive.”. Since that is the link to torrent, Firefox will offer to open it with the default application Transmission. We accept that by clicking the OK button. Then Transmission will ask if we want to add torrent. We click Add button and give some time to Transmission to finish the download. We may wish to help the others by providing upload or we stop uploads using File->Pause All and quit Transmission. That is the procedure for handling any kind of torrent.
Do processing of files
We can find the result of a successful download in Downloads folder and that is 7z archive. Since Ubuntu doesn’t support 7z out of the box we need to install it. We can do it like this: Applications->Accessories->Terminal and execute:
sudo apt-get install p7zip
It will prompt for password and install 7z. Now we can return to GUI, right click on archive, and from the menu select Extract Here. Back to terminal and we change the directory and do the search:
find . -name “*.html” | xargs grep -l “UFO”
which will produce a list of files which contain UFO:
Unfortunately, those are not real UFO’s but some other acronims like EUFOR. To see what is in the file we can use Gedit or Firefox like this:
To do more complicated searches we can go mastering find and grep or switch to SWISH++. Again we need to install it:
sudo apt-get install swish++
then we create index file:
index++ -v3 -e “text:*.html” .
and we can do the search:
The result is:
# results: 4
100 ./2009/11/09MAPUTO1291.html 46552 09MAPUTO1291.html
89 ./2009/07/09MAPUTO713.html 51555 09MAPUTO713.html
87 ./2010/01/10MAPUTO86.html 52688 10MAPUTO86.html
87 ./2010/01/10MAPUTO80.html 49769 10MAPUTO80.html
What would Anna Chapman do in Maputo? So we do a better search:
search++ Anna near Chapman
where we get a disappointing 0 files. To learn more about using and, not, or and near we execute:
There are quite a few examples towards the end of man file.
During indexing we may want to save log file and see what words index++ will discard:
index++ -v3 -e “text:*.html” . > log
There are quite a few of them and those are frequent words like Moscow, Clinton and so on. In order to search on those words we can do this:
It will skip Moscow in the origin section. Alternatively we can always fall back to find and grep.