Check These Out
in "a.html", find all images referred as relative URI in an HTML file by "src" attribute of "img" element, replace them with "data:" URI. This useful to create single HTML file holding all images in it, as a replacement of the IE-created .mht file format. The generated HTML works fine on every other browser except IE, as well as many HTML editors like kompozer, while the .mht format only works for IE, but not for every other browser. Compare to the KDE's own single-file-web-page format "war" format, which only opens correctly on KDE, the HTML file with "data:" URI is more universally supported.
The above command have many bugs. My commandline-fu is too limited to fix them:
1. it assume all URLs are relative URIs, thus works in this case:
$
but does not work in this case:
$
This may not be a bug, as full URIs perhaps should be ignored in many use cases.
2. it only work for images whoes file name suffix is one of .jpg, .gif, .png, albeit images with .jpeg suffix and those without extension names at all are legal to HTML.
3. image file name is not allowed to contain "(" even though frequently used, as in "(copy of) my car.jpg". Besides, neither single nor double quotes are allowed.
4. There is infact a big flaw in this, file names are actually used as regular expression to be replaced with base64 encoded content. This cause the script to fail in many other cases. Example: 'D:\images\logo.png', where backward slash have different meaning in regular expression. I don't know how to fix this. I don't know any command that can do full text (no regular expression) replacement the way basic editors like gedit does.
5. The original a.html are not preserved, so a user should make a copy first in case things go wrong.
In this example, file contains five columns where first column is text. Variance is calculated for columns 2 - 5 by using perl module Statistics::Descriptive. There are many more statistical functions available in the module.
-s must be a valid resolution. You can get a list of valid (and supported) resolutions via `xrandr`.
This will diff your local version of the file with the latest version in svn. I put this in a shell function like so:
$svd() { vimdiff
This is handy for making screenshots of all your videos for referring to in your flv player.
just use a space to prevent commands from being recorded in bash's history on most systems
Limited, but useful construct to extract text embedded in XML tags. This will only work if bar is all on one line.
If nobody posts an alternative for the multiline sed version, I'll figure it out later...
Based on capsule8 agent examples, not rigorously tested