Fun with Unix
So. I learned a little bit about a lot of things last night. I wanted to share because I found some cool resources. Warning: technical discussion follows.
Some facts: I play WoW
. I'm in a WoW guild blog
. We also have a Yahoo! group page
. I wanted everyone in the guild to get emailed whenever anyone commented on the blog. We use blogger and it doesn't have very much in the way of group blog features. Because yahoo groups is a glorified listserv, I wanted to post comments to our blog to the group page and let yahoo email the comment to the group. Posts to the group page get sent to the group members (i.e. my fellow guildies).
Blogger developers, if your listening, a very nice feature: email comments to all blog authors.
Anyway, I ran into some troubles
Grabbing for straws here...Brian
Is there a way to force gmail to convert html emails to plain text before forwarding (via a filter)?
I'm kludging together a feature that blogger should have... When someone posts a comment to my group blog, I'd like the whole group to receive an email. Blogger won't do this (mostly because it doesn't store member email addresses). My group also has a "yahoo group" which I use as a mailing list. Yahoo groups only supports email posts from registered users. Needless to say, I can't figure out a way to tell
yahoo groups to accept emails from blogger (noreply-comm...@blogger.com).
So... I'd like to setup blogger to send my gmail account (which is registered with yahoo groups) the email. I'd use gmail's filter feature to redirect the blogger comment to yahoo groups. *pant, pant*
The twist: blogger sends comments as HTML, but Yahoo groups won't accept HTML formated email submissions! Arg!
Thus, can I get gmail to convert the html emails to plain text before forwarding on to yahoo groups.
(BTW, if you have a better solution to my problem, I'm all ears.)
gave me some hints, but gmail turned out to be a dead end.
I sucked in my gut, pulled up my britches and headed over to he.net, where my website is hosted, to delve into the mysterious world of Unix mail. I knew it must be possible to write a script to redirect email. Mailbots, as they're called. Some googling later, I discovered a UNIX utilities called procmail...
(That elipsis represents about 5 hours of messing with the procmailrc file. See these comments.
This is the .procmailrc file I created.
| formail -rk -I "Content-Type: text/plain; charset=UTF-8"
| sed 's/<[^>]*href="\([^ "]*\)"[^>]*>/- \1 -/g'
| sed "s/<[^>]*>//g"
| $SENDMAIL -oi firstname.lastname@example.org
Basically, this is a script that preprocesses email as they come into the server. My script matches emails that come from blogger, it changes the content type email header, strips the html tags (keeping URLs) and then forwards the email on to the yahoo group page. The goobly gook you see are regular expressions. If you don't know regular expressions, run to your nearest google search box and look it up. They're essential.
I edited the page in emacs. Here's an emacs cheatsheet
that I found because its been years since I used the program.
Also, a shout out to he.net... They rock. If you need web hosting, use hurricane electric
UPDATE: It doesn't appear to working now! Arg! Back to the UNIX labyrinth...
UPDATE 2: It works now.
This is laughable... I just don't know why.
Isn't it obvious that greater economic interdependence would yield friendlier international relations? Apparently not:
to my knowledge there isn't any evidence of a substantial effect of economic interdependence on likelihood of war Â there's disagreement in the literature, but most scholars find either a modest positive effect or a modest negative effect (and disagree about appropriate measurements). Thus, as far as I know, it's a wash as to whether interdependence increases or decreases the chances of war. For an account of how interdependence can lead to asymmetric power relations and thus the possibility of conflict, see Hirschman's work.
Would there be a selection bias here? At what rate would currently friendly countries have war against each other if they were less integrated?
This drives me just enough crazy that I might have to look into it some more...
How to measure economic interdependence? What is War? How do we know when war was prevented by the bounds of economics? How many dollars of trade does it take to prevent a war?
Better yet, if economics can't explain war and peace, don't we have to explain why there isn't a connection? What does correlate with rising tensions between countriIncompatibletable culture? Failures of leadership and diplomacy (i.e. specific blunders... glitches in the Matrix)? Baring economic interconnection as viable path to greater global harmony, are we only left with such fatalistic views?
America is the greatest nation on the earth
Is this a silly proposition? America is the greatest nation on earth.
Do I have to be blind to the nation's failings to believe this statement? To belive this, is it a sign of my unthinking, national chauvinism? Must patriots believe their country is the greatest?
An easy way to dismiss all this talk of "greatest nation" is to argue that the phrase has no meaning. In other words, there is no way to order the nations from best to worst. At least, you can't rank nations absolutely. You may be able to say one nation is better than another in some narrow context. For example, America has a stronger tradition of free speech than China and thus is better in this respect. You run into problems here too because you can wrangle over what "free speech" is. If I'm a communist in China, I might be able to speak more freely about the subjugation of the under classes than I could in America. In France, I may be given more free reign to discuss my alternative theories regarding the events on 9/11
. So, even in this narrow context, ranking is impossible.
If ranking is impossible on the "small" things that constitute a nation, then it must be impossible to rank nations in aggregate.
There are practical problems with ranking nations, too. Britons, like Americans, are a patriotic bunch. I assume most British (American) patriots believe Great Britain (America) is the greatest nation on earth. Unless you can argue that Great Britain and America are, somehow, the same nation, both of these groups of people can't be correct. America and Britain can't both be the greatest nation. Thus, ranking nations will require one (or both) of these peoples is delusional. Not a particularly satisfying result... Who wants to believe that a group of millions of people are off their rocker?
Another take on the phrase "greatest nation" is to redefine it such that it doesn't require the ranking of nations. "Greatest" just means "I like it a lot." This may be true, but ask someone with the opinion that America is the greatest nation if America is better than some country X. They're likely to answer yes and list the reason's why. No, ranking is implied in the phrase. Thus, to leave the phrase bare of implicit ranking, strips it bare of its vital aspect.
We cannot rank nations absolutely. We're free to rank them relatively. From my point of view, America is the greatest nation. You can't prove me wrong by any means. If I truly believe this then the phrase "Will Ambrosini believes America is the greatest nation" is true.
Relativism strips the vitality out of the phrase, too. When I say that I believe America is the greatest nation, I mean to convey an objective fact. Not only do I have this belief, but I believe it to be a truth about the world. For example, I believe that matter is made of atoms. This is a true statement because it correctly relates my belief. It's also true as an objective fact of reality.
Even still, the atomic theory of matter is a model of reality. There have been other models of the nature of matter
. Most likely, in the future more refined or radically new models will be developed that supplant the atomic theory. Yet, until such models are discovered, atoms are an objective fact. Ask a question about the nature of matter (e.g. Why do small pollen grains bounce around randomly when looked at under a microscope?
) and any answer the theory gives will be true. If the theory can't give an answer, the theory is not wrong, its just incomplete.
Atomic theory is not objective truth in its phrasing, its truth is derived from the results it predicts.
If I believe in the atomic theory of matter, but I'm ignorant about its details (what exactly what is an atom?), do I share the same belief as a nuclear physicist? It may be that though both the physicist and I carry in our minds something called the "atomic theory", these are in fact different things. But ignorance just means that I will be able to answer fewer questions about the nature of matter than the physicist. To the extent we carry the same idea in our heads, we will agree on the answers to questions about matter. I'll just have fewer answers to give. For example, I assume the physicist would explain Brownian Motion of pollen particles in a similar way I do... Atoms are zooming around in all directions and randomly hit the pollen on all sides.
My world view is similar to the world view of most Americans. That world view is just a model in my mind that theorizes the ideal nation. This theory says things about freedom, liberty, equality, justice, etc. In the same way my belief about the atomic theory of matter is the same as the physicist's, my American ideal is shared with fellow Americans. What is a nation of people if those people don't share a world view?
To declare America to be the greatest nation is to declare it to be the nation that most closely aligns itself with my ideal of how nations work.
This does not imply that America is perfect. To be perfect, a nation would have to exactly match the ideal. There's two problems with this: 1) the ideal is constantly shifting (e.g. we have higher expectations health care than we did 100 years ago) 2) the ideal contains contradictions that cannot be aligned. The first problem implies that the goal posts are moving. For this reason, a great nation will always be striving to form a more perfect union
. We'll never get there, but we can try to get closer to perfection. The second problem is where the ideal collides with reality. Compromise is a fact of life. For example, both freedom and equality are ideals that we should strive for. But these two often come in conflict. Minimum wage laws increase equality but they inhibit the freedom of employers and employees to make any contract on labor that they would wish. To balance freedom with equality requires compromise. However, you can't compromise ideals and still achieve perfection, but the compromise gets us closer.Voters believe Democrats don't believe America is the greatest country
. You can go on and on about how Democrats are more subtle people. They are less likely to be knee-jerk nationalists. They are more likely to think through issues rather than assume the prevailing opinion is correct. Thus, this subtlety is hard to translate for the electorate (see the whole "I voted for it before I voted against it"
issue of last election session).
I suspect something worse for the Democrats. Democrats are believed to not share, or worse they don't want to share, the world view of most Americans. If they don't share our world view, why should they lead us? We might as have those delusional Brits lead us.