Sjælland Vind


Full wind report || WAP version

Numeric Character References

A Numeric Character Reference (NCR) is a construct found in SGML and thus HTML and XML which represents a Unicode glyph. NCR may be decimal, hexadecimal, or perhaps other bases. However, decimal references are most widely supported, despite W3C’s hexadecimal recommendation. Character Entity References (CER) use short names rather than numbers to represent glyphs, but are neither exhaustive nor supported in XML without a Document Type Definition (DTD). There are five exceptions: quot, amp, apos, lt, and gt are the only built-in character entities honored by all XML processors. Apos is not explicitly declared in HTML but does exist in XHTML (because it is based on XML).

In other words, use the column(s) on the left (such as Ӓ) for all your funny characters in HTML and XML. Below is a tiny subset of the Universal Character set:

Numeric Char Ref Char Entity Ref Glyph Char Name
" " " quotation mark
& & & ampersand
' ' ' apostrophe
&#60; &lt; < less-than sign
&#62; &gt; > greater-than sign
&#160; &nbsp;   no-break space
&#162; &cent; ¢ cent sign
&#163; &pound; £ pound sterling sign
&#165; &yen; ¥ yen sign
&#169; &copy; © copyright sign
&#176; &deg; ° degree sign
&#197; &#229; &Aring; &aring; Å å A, ring
&#198; &#230; &AElig; &aelig; Æ æ AE diphthong (ligature)
&#208; &#240; &ETH; &eth; Ð ð Eth, Icelandic
&#209; &#241; &Ntilde; &ntilde; Ñ ñ N tilde
&#216; &#248; &Oslash; &oslash; Ø ø O, slash
&#222; &#254; &THORN; &thorn; Þ þ Thorn, Icelandic
&#256; &#257; Ā ā
&#274; &#275; Ē ē
&#298; &#299; Ī ī
&#332; &#333; Ō ō
&#362; &#363; Ū ū
&#7692; &#7693;
&#7716; &#7717;
&#7734; &#7735;
&#7744; &#7745;
&#7746; &#7747;
&#7748; &#7749;
&#7750; &#7751;
&#7788; &#7789;
&#8364; &euro; Euro Sign
&#8592; leftwards arrow
&#8593; upwards arrow
&#8594; rightwards arrow
&#8595; downwards arrow
&#8598; north west arrow
&#8599; north east arrow
&#8600; south east arrow
&#8601; south west arrow
&#9824; &spades; black spade suit
&#9827; &clubs; black club suit
&#9829; &hearts; black heart suit
&#9830; &diams; black diamond suit
Numeric Char Ref Char Entity Ref Glyph Char Name

Knots

The speed of a vessel relative to the fluid in which it travels is often measured in knots.

The term comes from the practice of throwing a wooden break (chip log) behind a boat connected to a rope with knots at intervals of a little over 14 meters. The number of knots of rope released in about 30 seconds would indicate the speed of the vessel.

In still water or air, a knot is equal to a nautical mile (roughly a minute of latitude) traveled in one hour, exactly 1.852 km/h. Typical walking speed is 2 knots.

The beaufort wind force scale, developed by Sir Francis Beaufort in 1805, measured the qualitative wind effect upon sails. One hundred years later the scale was used to describe the conditions at sea, land, and trees, rather than sails.

knots km/h mph m/s
0.54 1.00 0.62 0.27
0.87 1.61 1.00 0.45
1.00 1.852 1.15 0.51
1.94 3.60 2.24 1.00
knots km/h mph m/s Beaufort number Wind description
0 0 0 0 0 Calm
1 1 1 0.3 1 Light air
4 7 4 1.6 2 Light breeze
7 12 8 3.4 3 Gentle breeze
11 20 13 5.5 4 Moderate breeze
16 30 19 8.0 5 Fresh breeze
22 40 25 10.8 6 Strong breeze
28 51 32 13.9 7 Near gale
34 63 39 17.2 8 Gale
41 76 47 20.8 9 Strong gale
48 88 55 24.5 10 Storm
56 103 64 28.5 11 Violent storm
64 120 74 32.7 12 Hurricane
knots km/h mph m/s Beaufort number Wind description

Take the spice out of spam

What follows in a recipe to extract the finest ham from spam. (note however, that the author no longer uses this recipe as published)

Ingredients

  • procmail
  • spamassassin
  • DreamHost Unix shell account
  • Gmail account

Summary

We’ll forward your public email address (public@mydomain.com) to your server shell account (shellaccount@sjov.dreamhost.com), where we’ll filter your mail through procmail and SpamAssassin, and depending on the results, forward the mail to a private Gmail account (private@gmail.com) where we will do a little more filtering. The result, after proper training, will be absolutely zero spam.

Skipping Gmail is an option and simplifies the procmail recipes, but that is not described here (I happen to like Gmail — it even has vi key bindings).

This recipe assumes we are using DreamHost. Elsewhere you may be required to configure the various components (forwarding, procmail, spamassassin, etc) yourself and while I’ve tried to make the scripts as generic as possible, you’ll probably still have to make some heavy modifications to the procmail scripts below. Whether or not you’re using DreamHost, this recipe will focus only on procmail and Gmail configurations, gloss over SpamAssassin, and assume you can set up and forward email. You must be comfortable using the command line, most likely POSIX, and willing to train your spam filters a few minutes a week.

Procedures

We will perform the configuration somewhat backwards so as not to loose email while we set things up and test. You can use an existing Gmail account although a new secret account is recommended. You must use a shell account from which you can send and receive mail. Your shell account should not already be receiving email unless you can handle the required procmail filtering modifications yourself or can accept loosing a few pieces mail before you complete this recipe.

Collect some info

You’ll need to know your shell account name and full host and domain (what we refer to as shellaccount@sjov.dreamhost.com).

Configure Gmail

Whether you use a existing or new Gmail account (private@gmail.com), you should eventually disseminate your public email address (public@mydomain.com) and may want to discourage (or keep secret) your Gmail account (private@gmail.com).

Below we will configure Gmail to leave known addresses (white list) in your Inbox as expected. Mail from new contacts (low but positive spam scores) will have the “new” label and likely spam will be archived with the “Block” label (something like a folder outside of the Inbox). Aliasdomain.com and old@address.com are additional features found in the scripts below (but not described here). You may leave them or remove them with no loss of functionality.

Select “Settings” in the top right corner. Select “Filters”.

Create a new filter matching From: -googlemail.com and Subject:(0K|1K|2K) which only applies the label “new”. Then “Create Filter” or “Update Filter”. This will result in something like this:

Matches: from:(-googlemail.com) subject:((0K|1K|2K))
Do this: Apply label "new"

Simiarly, you’ll need to create the following two filters yourself (note that these below Skip the Inbox):

Matches: from:(-googlemail.com) subject:(3K|4K|5K|6K|7K|8K|9K)
Do this: Skip Inbox, Apply label "Block"
Matches: from:(-public@mydomain.com -aliasdomain.com -googlemail.com)
to:(-public@mydomain.com -old@address.com -aliasdomain.com)
subject:(-bcc)
Do this: Skip Inbox, Apply label "Block"
Test Gmail

Send an email to your private@gmail.com from the same Gmail account. Unless you have other filters, your email should appear in the Gmail Inbox as normal. Note that Gmail does not necessarily send the mail through the Internet when Gmail can handle the mail with its own machines.

Send another mail from some other email host account to private@gmail.com. This mail should skip the Inbox and find its way into the “Block” folder (or label). This will be the fate of nearly all of your emails if you stop now.

Note, I will refer to Gmail labels as folders when a mail skips the Inbox. On the left side, you should see a labels box. Mails with the “Block” label will not appear in the Inbox. So essentially, they are archived in a separate folder, namely the “Block” folder.

Configure Procmail

Login to the your shell account. Make sure you do not already have a .forward.postfix file, .procmailrc file, nor .procmail directory. If any of those exist and you are unwilling to overwrite/delete them, stop here, do not continue, send me an email or a comment (if you really quit, you might want to remove the Gmail filters). Otherwise type the following:

   cd
   wget http://genaud.net/uploads/2007/05/procmailrc
   mv procmailrc .procmailrc
   mkdir .procmail
   cd .procmail
   touch list.black
   echo "my email address has changed" > msg.oldaddress
   wget http://genaud.net/uploads/2007/05/rc.block
   wget http://genaud.net/uploads/2007/05/rc.subjectexe
   wget http://genaud.net/uploads/2007/05/rc.spamtraining
   wget http://genaud.net/uploads/2007/05/rc.spamassassin
   wget http://genaud.net/uploads/2007/05/rc.forward
   cd

You must change the ~/.procmailrc file, modifying most/all of the six EMAIL lines. The lines match the example naming convention in this document. Change CODEWORD to something unique. EMAIL_REGEX is a regular expression that should match your own email addresses.

Install SpamAssassin

An old version is already running on DreamHost, which is perfectly fine. Most likely you can skip ahead.

The adventurous may want to compile the latest and greatest. Edit the rc.spamassassin recipe if your spamassassin is not located in /usr/bin/spamassassin. You may have to (want to) run spamc instead.

Procmail Launch

If you are already using your shell account email you may not want to turn procmail on already, but you’re on your own. Otherwise, we will now filter all email to your shellaccount@sjov.dreamhost.com email address through procmail. Type the following command:

echo "\"|/usr/bin/procmail -t\"" > ~/.forward.postfix
Test Procmail

Sent an email to shellaccount@sjov.dreamhost.com from the shell or another email account. This mail should eventually end up in the Gmail “Block” folder (perhaps with a [bcc] in the Subject depending on the your EMAIL_REGEX variable, but this is not important). You should see that this email was indeed forwarded in your ~/Maildir/log.* file (the log file has an appended ISO date).

Send an email from your private Gmail address to your secure shell address. This is just a test that nothing wildly strange occurs. This message may be consumed by Gmail (because it is a short loop bounced straight back to Gmail). Whether or not you receive the message again in Gmail, the log should indicate that the forward left your web server (again ~/Maildir/log.*).

You may notice an “0K” (zero K) or some other number in Subject. This just means that the message is spam neutral (or more likely, your spam filter is not activated yet). The higher the number, the more likely it is spam. Let’s play with this number a bit.

Send another mail from some other email host account to private@gmail.com with “1K” in the Subject. This message should appear in the “Block” folder with a “new” label. Finally, send another email just like before except with “6K” in the Subject. The last email should also appear in the “Block” folder but without the “new” label.

It is a good idea to add addresses to your white list (below) and remove the 0K,1K,… or 5K from your Subject when replying to friends and associates.

Nearly all mail is now blocked because our filters now want all mail to be sent via the public email address. That way we guarantee all mail has passed through our spam filters (coming up soon).

Configure Email Forwarding

If all the tests above worked as planned, it should be now safe to forward your public email address to your secure shell address. If you are using DreamHost, you can do this via the panel. You do not need to set up a mailbox, just mail forwarding (you’ll keep the mail to Gmail).

Test Round Trip

From another email address (and/or your shell account), send an email to your public email address. Unless it looks like spam, it should end up in your Gmail Inbox in a moment. Check the log in the shell account. Gmail sometimes takes some time before displaying the email.

SpamAssassin Training

You will definitely want to add many/all of your addresses from your address book to ~/.spamassassin/user_prefs. This will ensure that your buddies do not get trapped by your zealous spam filter. Be sure to add all of your own email addresses, including the public, private, secure, old, aliases, everything. The list can handle simple wildcards (*):

whitelist_from        some*one@somewhere.com

After adding your own addresses, you can run all the tests again. You should no longer get 0K, etc in the subject from known addresses. White listed addresses have a negative 100 spam score plus or minus the calculated spam (which usually varies +/- 5 or 20 for obvious spam) so even the most outrageous pornographic Viagra pushing get rich quick scam from your mother is likely to end up in your box.

Currently, we have a procmail recipe running called rc.spamtraining. This filters out some of the more obvious spam while we train SpamAssassin. rc.spamtraining places its caught spam in ~/Maildir/delete.* (date suffix). The rc.spamassassin recipe divides mail between ~/Maildir/ham.* and ~/Maildir/spam.* . None of these files is guaranteed to be perfectly accurate, but generally delete.* and spam.* are unsolicited mails and ham.* are the mails you wanted. Periodically you should go through these files separating the bona fide spam into one mbox file and the legitimate ham in another mbox file. You may want to limit the ham to personal mail rather than mailing lists, daemon errors, etc.

If you don’t know how to read/write the mbox format you may open the files in elm, mutt or some other mail program and save the files appropriately. For example:

   mutt -f spam_mbox_file

Once you have the mbox files clearly divided between spam and ham, you can train SpamAssassin:

   sa-learn --mbox --spam    my_spam_file

   sa-learn --mbox --ham    my_ham_file

The SpamAssasssin documentation highly recommends that you teach SpamAssassin with more ham than spam. After 2000 messages you should have a very learned spam filter and might consider removing rc.spamtraining from your ~/.procmailrc file.

Advanced Teasers

Once you’ve trained SpamAssassin with thousands of your own emails, you can do some more clever stuff for example lowering the threshold and executing more sophisticated algorithms.

Gmail let’s you change the sender/from address. You should add your public email address and make that the default. Once that is done you can automatically add to your white list by sending an email (from your public Gmail address) to your secure shell address with a Subject like

Subject: CODEWORD.EXE.ADD myfriend@example.com

The downloaded scripts are prepared to handle multiple accounts, automatically reply with address change messages, update your white list by email (from you), a black list, and a few more features that would be too lengthy and boring to mention here. But I’m always up for a chat. The devil is always in the details; I’m game to take up case by case, as long as you can use ‘vi’. ;-)

Akkosa Sutta

As I’ve heard it, Akkosaka was pissed off because one of his relatives had joined the Buddha in the homeless life. He marched off to throw angry insults at the Buddha while the latter patiently listened.

When Akkosaka had finished cursing him, the Buddha asked, “tell me, brahman, do friends and family sometimes come for a visit?”

“Yeah, sure. Sometimes I have friends and family over as guests.”

“Do you serve your guests food and snacks?”

“Of course,” said Akkosaka, “sometimes I serve them food and snacks.”

“And if your guests do not accept the food and snacks, to whom do they belong?”

“If my guests don’t accept my food,” answered Akkosaka, “then those foods are all mine.”

“Likewise,” continued the Buddha, “your insults, anger, and abuses are not accepted by me. It all belongs to you. It is all yours. Those who insult back when insulted, return anger for anger, and engage in argument, are sharing a meal together. But I am not partaking of what you offer. It belongs to you. It is all yours. He who repays anger with anger is worse than the first. But he who refrains, wins a difficult battle for the benefit of both.”

SN 7.2