source code of /small-scripts/index.html
Last modified | |
Lines | 235 |
Parent directory Download CGIread sitemap Main page
Quick links: contact content footer navigation title
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://oskog97.com/style.css" type="text/css"/>
<link rel="icon" type="image/png" href="/favicon.png"/>
<link rel="canonical" href="https://oskog97.com/small-scripts/"/>
<!-- End html5 macro. -->
<!-- Included structured data -->
<script type="application/ld+json">
{
"@context":
{
"@vocab": "http://schema.org/"
},
"@type": "WebPage",
"url": "https://oskog97.com/small-scripts/",
"author": {
"@type": "Person",
"@id": "https://oskog97.com/",
"name": "Oskar Skog",
"url": "https://oskog97.com/"
},
"publisher": {"@id": "https://oskog97.com/"},
"copyrightHolder": {"@id": "https://oskog97.com/"},
"license": "http://creativecommons.org/licenses/by/4.0/",
"DateModified": "2022-12-12"
}
</script>
<!-- End of included structured data-->
<title>Small scripts</title>
<meta name="description" content="Various poorly documented scripts
in Python or Bourne shell."/>
</head>
<body>
<!-- BEGIN autogenerated navigation -->
<nav><div id="navigation"><div id="nav_inner">
<p><a href="#content" class="textonly">Skip navigation</a></p>
<p class="row">
<span class="textonly" translate="no">[</span><a class="head" href="/">Home</a><span class="textonly" translate="no">]</span>
>>
<span class="textonly" translate="no">[</span><a class="sub" href="/projects/anonymine/">Anonymine</a><span class="textonly" translate="no">]</span>
<span class="textonly" translate="no">[</span><a class="sub" href="/projects/light-sensor/">Analog light sensor</a><span class="textonly" translate="no">]</span>
<span class="textonly" translate="no">[</span><a class="sub" href="/projects/PLLM-M702A/">Reverse-engineered schematics for PLLM-M702A</a><span class="textonly" translate="no">]</span>
<span class="textonly" translate="no">]</span><span class="sub active">Small scripts</span><span class="textonly" translate="no">[</span>
<span class="textonly" translate="no">[</span><a class="sub" href="/thinkpad/">-> My IBM thinkpad</a><span class="textonly" translate="no">]</span>
</p>
<p class="row">
<span class="textonly" translate="no">]</span><span class="head active">Small scripts</span><span class="textonly" translate="no">[</span>
>>
<span class="textonly" translate="no">[</span><a class="sub" href="/read/">Website's scripts</a><span class="textonly" translate="no">]</span>
</p>
<p class="row">
<span class="textonly" translate="no">[</span><a class="sub" href="/sitemap.py">Sitemap</a><span class="textonly" translate="no">]</span>
</p>
<hr class="textonly"/>
</div></div></nav>
<!-- END autogenerated navigation -->
<main><div id="content">
<h1 id="title">Small scripts</h1>
<h2>The scripts I'm most proud of</h2>
<dl>
<dt>
<a translate="no"
href="/read/?path=/small-scripts/minify&referer=/small-scripts/&title=Small+scripts">
minify.py
</a> - Simple XHTML minifier
</dt>
<dd>
<p>
It reads from <code>stdin</code> and writes to
<code>stdout</code>. The reason I wrote this script
was that the other HTML minifiers I used were
over-optimizing the HTML, causing validation errors.
</p>
<p>
I don't use this script any more, as my new design is
based on static XHTML5 being served. (Lighttpd can
compress static resources but not the output streams
from CGI scripts.)
</p>
</dd>
<dt>
<a translate="no"
href="/read/?path=/small-scripts/killbom&referer=/small-scripts/&title=Small+scripts">
killbom
</a> - Eliminate UTF-8 Byte Order Marks
</dt>
<dd>
<p>
This script removes all UTF-8 BOMs from all specified
files. Even BOMs, that somehow got somewhere else than
in the beginning of the file, are also removed.
</p>
<p><strong>
This script SHOULD NOT be run on binary files due to
its very literal operation.
</strong></p>
<blockquote>
<pre>Usage: killbom [file] ...
killbom removes all UTF-8 BOM marks from files.
WARNING: It really removes all sequences of '\0xEF\0xBB\0xBF'.
WARNING: It accepts no options. All arguments are treated as filenames.
</pre>
</blockquote>
</dd>
<dt>
<a translate="no"
href="/read/?path=/small-scripts/shrink-disavow&referer=/small-scripts/&title=Small+scripts">
shrink-disavow
</a> - Minify Google Webmaster Tools /
<span translate="no">Search Console</span>
</dt>
<dd>
<p>
It converts multiple complete URLs on the same domain
to the <code>domain: </code>syntax.
</p>
<blockquote>
<pre>Usage: script_name {infile} {outfile} [num_of_links]
num_of_links is the number of URLs from the same domain that will are
required for replacing all those URLs with a single 'domain:'.
The default value is two.
</pre>
</blockquote>
</dd>
<dt>
<a translate="no"
href="/read/?path=/mkhtml&referer=/small-scripts/&title=Small+scripts">
mkhtml
</a> - The key of my new design
</dt>
<dd>
<p>
The old design was based on fancy Python scripts
generating the content. I made it too automated for
too specific types of content.
</p>
<p>The objectives for the new design were:</p>
<ul>
<li>
Autogenerate the navigation.
The only thing I needed to be done automagically.
</li>
<li>
Work like a macro expander.
</li>
<li>
Generate (mostly) static content,
but work for scripts too.
</li>
<li>
Be ran from a Makefile.
</li>
</ul>
<p>It still has some downsides:</p>
<ul>
<li>
A bit terribly implemented.
</li>
<li>
A bit limited in certain cases.
</li>
<li>
Quite ad-hoc.
</li>
<li>
Weird macro syntax.
</li>
</ul>
</dd>
</dl>
<h2>Other scripts</h2>
<dl>
<dt translate="no">
<a href="/read/?path=/small-scripts/monitor&referer=/small-scripts/&title=Small+scripts">
monitor
</a>
</dt>
<dd>Fail2ban, ps aux | grep ..., °C, loadavg ...</dd>
</dl>
</div></main>
<!-- INCLUDED FOOTER -->
<footer><div id="footer">
<hr class="textonly"/>
<p>
Copyright © Oskar Skog<br/>
Website content released under the <a
href="https://creativecommons.org/licenses/by/4.0/" rel="license noopener"
target="_blank">Creative Commons Attribution (CC-BY 4.0)</a> license
and my software usually under the <span class="a"><a target="_blank"
rel="noopener"
href="https://opensource.org/licenses/BSD-2-Clause">FreeBSD license
(2-clause)</a>.</span>
<br/>
Images may be from other sites, I should have cited useful sources
somewhere on the page.
<span class="notprint">Contact me if I haven't.</span>
</p>
<p id="contact" class="notprint">
You can contact me at: <a href="mailto:oskar@oskog97.com"
rel="noopener" target="_blank">oskar@oskog97.com</a>
<span class="a">(<a href="/pgp-pub/oskar.asc"
>PGP public key</a>)</span>
</p>
<p> <a class="notprint" href="https://oskog97.com/read/?path=/style.css">
CSS Stylesheet
</a>
<a href="https://validator.w3.org/check/referrer" rel="nofollow noopener"
target="_blank" class="notprint"><span
class="img">Valid HTML5</span
></a><br/>
</p>
</div></footer>
<!-- END OF INCLUDED FOOTER -->
</body>
</html>