dannyman.toldme.com

This page features every post I write, and is dedicated to Andrew Ho.

May 9, 2014
Free Style, Technology

Elevated Trains

Link: https://dannyman.toldme.com/2014/05/09/elevated-trains/

Forney engine pulls Lake Street Elevated Railroad train over Lake Street in Chicago, 1893.

Forney engine pulls Lake Street Elevated Railroad train over Lake Street in Chicago, 1893.

Thanks, Chuckman!!

Feedback Welcome

April 11, 2014
News and Reaction, Technical, Technology, Testimonials

FAQ: Should I Change All My Passwords!!??

Link: https://dannyman.toldme.com/2014/04/11/faq-should-i-change-all-my-passwords/

As a SysAdmin, people ask me how much they need to worry over the heartbleed vulnerability. Here’s my own take:

heartbleed

Google were known to be vulnerable. They co-discovered the vulnerability and deployed fixes quickly. I like to believe they are analyzing the scope and likelihood of user password compromise and will issue good advice on whether Gmail passwords should be updated.

For everything else, my small opinion is “don’t panic.” Not every web site would have been affected. The Ops folks at each site need to patch their systems and assess the extent to which credentials may have been compromised, then take appropriate steps to mitigate compromised data, which might include asking users to set new passwords. But if they’re still waiting on some patches, then submitting a new password could actually put both passwords at risk.

For other important passwords, like your bank, check up on what they’re recommending that you do. If a site is important to you and they offer two-factor auth, go for it: that typically means that if you log on from a new computer they’ll text a one-time pin code to your mobile phone to double-check that it’s you.

Feedback Welcome

April 2, 2014
Linux, Technical

Quick and Dirty Upstart

Link: https://dannyman.toldme.com/2014/04/02/quick-and-dirty-upstart/

I want to launch a service which has its own complex start/stop script at boot, and I want to launch it as a non-login user. So, I dig into upstart. The cookbook … is not a cookbook. So, here’s is my little recipe:

# /etc/init/openfire.conf
description "Run OpenFire Jabber Server"
start on runlevel [2345]
stop on runlevel [!2345]
setuid openfire
setgid openfire
pre-start exec /opt/openfire/bin/openfire start
post-stop exec /opt/openfire/bin/openfire stop

All this does is, run /opt/openfire/bin/openfire start or /opt/openfire/bin/openfire stop at the appropriate time. Allegedly, this is suboptimal, but it works for me.

I tested with:

sudo start openfire
sudo stop openfire
sudo reboot # :)

Another sample, where the idiom is “cd to a directory and run a command:”

# /etc/init/haste-server.conf
description "Private Pastebin Server"
start on runlevel [2345]
stop on runlevel [!2345]
setuid haste
setgid haste
console log
script
  cd /opt/haste-server
  npm start
end script
#respawn

Thank you, htorque on askubuntu!

Feedback Welcome

March 4, 2014
News and Reaction, Politics

Hero of Belbek, UA: Colonel Yuri Mamchur

Link: https://dannyman.toldme.com/2014/03/04/gandhi-king-mandela-mamchur/

How do you triumph against an oppressor who has an overwhelming advantage in terms of firepower? If you are Mahatma Gandi, Martin Luther King Jr, Nelson Mandela, or Ukrainian Colonel Yuri Mamchur, you practice non-violent direct action. I hope that Ukraine may yet share in the triumph of this strategy.

Colonel Yuri Mamchur, Hero of Belbek, UA

Colonel Yuri Mamchur, Hero of Belbek, UA

I will tell the story from Simon Shuster’s Twitter stream:

UPDATE: Very Good Summary on Buzzfeed

Commander of Ukraine’s Belbek base just got a call from Russian counterpart. Another ultimatum: surrender by 16:00. This is the 3rd one

Incredible. Half the Ukraine troops from Belbek base now marching to airstrip occupied by Russians. Unarmed. To take it back.

The column of troops, carrying the Ukraine and Soviet (!) flags, about to march on the Russian occupied airstrip. pic.twitter.com/prR9rfP7Fp

Ukraine column has reached Russian checkpoint. Russians begin firing in the air. Ukrainians keep marching

Russians call commander to negotiate. Troops have RPGs and machine guns trained on the column of unarmed Ukrainian soldiers. Belbek, Crimea

Russians back down, allow 10 Ukraine soldiers to take up positions at occupied base, but still awaiting orders from Moscow

Face off between Ukraine base commander Col. Yuli Manchur and Russian officer at occupied Belbek airbase pic.twitter.com/6N10wuezef

The Ukraine commanders just received word that Putin ordered the Russian troops to withdraw. Is that true?

Officer who shot in air as Ukraine column marched up to him said he was on the Maidan fighting ‘fascists’ with a stick. Presumably Berkut

The red flag the Ukrainians marched with is the banner of the fighter pilots who fought Nazis in 1941 and guarded the Yalta Conference

Ukraine Colonel still negotiating, Russian snipers & RPGs still aiming at column of soldiers. But deescalation is clear, at least in Belbek

Personnel carrier just arrived, disgorging armed Russian troops at checkpoint. Ukraine commander just finished negotiating.

Ukraine commander demands to guard the base jointly with Russians, who pledge to give their commanders’ response by 12:00, in 2 hours

Russian military truck just brought a handful of (probably Russian) news crews to the Belbek standoff. They’re now filming from Russian side

Ukraine’s 204th tactical aviation brigade when they just arrived to face down the Russians in Belbek: pic.twitter.com/Zz91TuJHXf

Marching along with the Ukraine brigade were the wives of four of the officers, all standing surrounded by Russian snipers at Belbek

Phone battery dying. Read @Time a bit later for the hair-raising conclusion of the ballsiest move of the Crimean conflict so far. #Belbek

I first read of the story via ABC News. I think this is an excellent strategy to employ against the Russian occupation. Putin claims the Russians are there to defend against violent acts. It would appear that the Ukrainian Military are Not the Problem here. I hope this tactic is employed further by Ukraine’s soldiers and its people, and I wish to see them succeed. Mamchur and his soldiers are heros of humanity.

Feedback Welcome

February 22, 2014
Free Style, Sundry

Bookmark: Spring Day

Link: https://dannyman.toldme.com/2014/02/22/bookmark-spring-day/

Early to bed, Thursday night. Tommy sleeps through the nights for the most part but this morning at 4:30am he had the hunger. Daddy offered formula, but Tommy didn’t want formula. Daddy set him back in the crib, and Tommy cried. Daddy offered formula again. 2oz down, Tommy cries as Daddy fixes more. 4oz down, then Tommy cries as Daddy fixes more. Another 4oz nearly down and Tommy urps a fountain of undigested formula all over himself and Daddy’s bathrobe. Mommy offers to nurse, and before long mother and son have dozed off together. But Daddy can’t sleep, and so it is off to the coffee shop for a bit of research, then off to work . . .

. . . home a bit early from work, Daddy is beat but can’t settle into a nap. Mommy has an evening shift, so Daddy picks his son up from day care. Smiles. Joy. Upon returning home, the boy is strapped to Daddy’s chest for a pleasant evening stroll as the sun sets, with a soft musical accompaniment from Daddy’s mobile phone. Daddy sings softly to his boy, and Tommy smiles at the mujeres strolling around the park, and can not take his eyes off the lone basketball player, or the groups practicing soccer. Dad passes a few stray balls back to their keepers, and is deeply appreciative of the warm spring vibe. In February. While the rest of the country is snowed in it is already warm in the drought state. This evening in February, the feeling of spring, enjoying soccer with strangers and with the baby, this is a memory one wants to keep.

Home. Time to play drop the ball over the baby gate. Tommy drops to Daddy, Daddy picks up the ball, drops it at Tommy, who grabs it and drops it to Daddy, who leans over to fetch it, drops it to Tommy, and the ball hits the floor and wobbles erratically over the half-century-old hardwood floor, under the table. Daddy reaches over the gate to pull a chair out so Tommy can crawl under the table and fetch the ball, to drop over the baby gate again . . . and so it goes. Bath time, more formula, a reading break, which devolves into Tommy pulling books out of his box and dropping them, one by one, to the bedroom floor. Thud after thud after thud: endlessly fascinating. Eyes are rubbed, the formula is consumed and baby falls asleep and is put to bed.

A day and an evening, not so much unlike the day before, or the day after, but each a page in an unfolding story. And this, a bookmark for Daddy’s memory.

2 Comments

January 10, 2014
About Me, Sundry, Technology

How Many Calories in a Bowl of Cereal?

Link: https://dannyman.toldme.com/2014/01/10/trader-joes-raisin-bran-calories/

I started trying to use Fitbit to track calorie consumption again the other day. This gets frustrating pretty fast because unless you only eat processed food from packages of specific size you mostly have to accept that calorie counting is a wildly inaccurate guessing game.

I’m happy to embrace the mystery and accept approximate measurements for the most part, but I figured there was one thing I could tackle: breakfast! The most important meal of the day … and I tend to eat the same thing: a bowl of Trader Joe’s Raisin Bran with skim milk. (Trader Joe’s is the only raisin bran I can find any more where the raisins aren’t coated in sugar.)

In theory, this is trivial to figure out. The information is posted right on the side of the box:

Nutrition Facts for Trader Joes Raisin Bran

So, how many calories am I eating, here?

Caveat: I eat cereal by the bowl, not by the cup! I also eat with some quantity of skim milk.

I whipped out my trusty digtal kitchen scale:
1) Switch scale back to metric
2) Place bowl on scale
3) TARE
4) Pour a bowl of cereal, note weight (129g)
5) TARE
6) Pour milk, note weight (331g)
7) Remove bowl from scale and enjoy breakfast before everything goes soggy

Cereal calories are easy to figure: 129/55 * 170 = 399 calories
Milk servings are measured in ml, though. The moment I started trying to look up the volume of a gram of milk, Google just gave me the answer: 113 calories

So, my regular breakfast clocks in at 512 calories. Mainly, I just wanted to sing the praises of my trusty digital kitchen scale.

UPDATE: Friends advise use of http://www.myfitnesspal.com/, which allegedly has a better database. It looks like I can “save” a favorite meal consisting of:

myfitnesspal: saving a measured breakfast.

myfitnesspal: saving a measured breakfast.

2 Comments

November 25, 2013
Excerpts, Free Style, Quotes, Recipes, Testimonials

Slaughterhouses and Battlefields

Link: https://dannyman.toldme.com/2013/11/25/slaughterhouses-and-battlefields/

Two quotes passed along on September 11, from my meat-eating Grandmother:

A  USDA inspector reviews the carcasses of slaughtered pigs for our safety.  Credit: Wikmedia Commons

A USDA inspector reviews the carcasses of slaughtered pigs for our safety. Credit: Wikmedia Commons

“As long as there are slaughterhouses there will be battlefields.” –Leo Tolstoy


“We are the living graves of murdered beasts
slaughtered to satisfy our appetites.
We never pause to wonder at our feasts,
if animals, like men, can possibly have rights.
We pray on Sundays that we may have light,
to guide our footsteps on the path we tread.
We’re sick of war, we do not want to fight –
The thought of it now fills our hearts with dread,
and yet – we gorge ourselves upon the dead.

Like carrion crows we live and feed on meat,
regardless of the suffering and pain
we cause by doing so, if thus we treat
defenseless animals for sport or gain
how can we hope in this world to attain
the PEACE we say we are so anxious for.
We pray for it o’er hecatombs of slain,
to God, while outraging the moral law,
thus cruelty begets its offspring – WAR.”
–George Bernard Shaw

Feedback Welcome

November 20, 2013
Technical, Technology

Phishing: Chinese Domain Registration

Link: https://dannyman.toldme.com/2013/11/20/phishing-chinese-domain-registration/

Here is a new phishing attack that made it through to Gmail about the domain name dispute around tjldme . . . ?!!

Dear Manager,

(If you are not the person who is in charge of this, please forward this to your CEO,Thanks)

We are a organization specializing in network consulting and registration in China. Here we have something to confirm with you. We just received an application sent from “Global Importing Co., Ltd” on 20/11/2013, requesting for applying the “tjldme” as the Internet Brand and the following domain names for their business running in China region:

tjldme.asia
tjldme.cn
tjldme.com.cn
tjldme.com.tw
tjldme.hk
tjldme.net.cn
tjldme.org.cn
tjldme.tw

Though our preliminary review and verification, we found that this name is currently being used by your company and is applied as your domain name. In order to avoid any potential risks in terms of domain name dispute and impact on your market businesses in China and Asia in future, we need to confirm with you whether “Global Importing Co., Ltd” is your own subsidiary or partner, whether the registration of the listed domains would bring any impact on you. If no impact on you, we will go on with the registration at once. If you have no relationship with “Global Importing Co., Ltd” and the registration would bring some impact on you, Please contact us immediately within 10 working days, otherwise, you will be deemed as waived by default. We will unconditionally finish the registration for “Global Importing Co., Ltd”

Please contact us in time in order that we can handle this issue better.

Best Regards,

Wesley Hu

Auditing Department.
Registration Department Manager
4/F,No.9 XingHui West Street,
JinNiu ChenDu, China
Office: +86 2887662861
Fax: +86 2887783286
Web: http://www.cnnetpro.com

Please consider the environment before you print this e-mail.

I assume they’ll need a processing fee. I wonder if they munged toldme.com in an effort to avoid Phish filtering . . . ? The URL at the bottom is blocked by our firewall.

1 Comment

November 16, 2013
Free Style, Technology

Test of Android Voice Dictation

Link: https://dannyman.toldme.com/2013/11/16/test-of-android-voice-dictation/

In honor of Benjy Feen, a test of Android’s speech-to-text capability:

Original Text Transcribed Text

We were somewhere around Barstow on the edge of the desert when the drugs began to take hold. I remember saying something like “I feel a bit lightheaded; maybe you should drive….” And suddenly there was a terrible roar all around us and the sky was full of what looked like huge bats, all swooping and screeching and diving around the car, which was going about a hundred miles an hour with the top down to Las Vegas. And a voice was screaming “Holy Jesus! What are these goddamn animals?”

Then it was quiet again. My attorney had taken his shirt off and was pouring beer on his chest, to facilitate the tanning process. “What the hell are you yelling about?” he muttered, staring up at the sun with his eyes closed and covered with wraparound Spanish sunglasses. “Never mind,” I said. “It’s your turn to drive.” I hit the brakes and aimed the Great Red Shark toward the shoulder of the highway. No point mentioning those bats, I thought. The poor bastard will see them soon enough.

We were somewhere around Barstow on the edge of the desert with a drug against a cold. I remember saying something like “I feel a bit lightheaded maybe you should drive.” And suddenly there was a terrible rawr all around us in the sky was full of it look like you’re fat, also reach me on the car, which was going about a hundred miles an hour with the top down to Las Vegas. And waste of screaming “All ages! What are these god damn animals?”

It was quiet again. I turn into taking your shirt off was pouring beer ice chest, to the Celtic the tanning process. “What the hell are you yelling about?” he muttered, staring up at the Sun with his eyes closed and covered with wraparound Spanish sunglasses. “Nevermind,” I said. “It’s your turn to drive.” I hit the brakes and emigrate red truck with the shoulder of the highway. No point missing those bats, I thought. The poor bastard will see them soon enough.

I added the quotation marks manually, as well as the paragraph break. My phone, unlike others, does not seem to understand the “new paragraph” command. The original text, was stolen from http://www.galleries.com/jeff/gonzo.htm, which was stolen from Hunter S. Thompson, who is dead.

Feedback Welcome

November 15, 2013
Sundry, Technical, Technology, Testimonials

A Computer Telephone Without a Keyboard!?

Link: https://dannyman.toldme.com/2013/11/15/a-computer-telephone-without-a-keyboard/

At long last, I retired my old T-Mobile G2. It was the last in a long line of phones I have owned for the past decade with a physical keyboard. (I think I owned every Sidekick up to the 3 before going Android with the G1 and the G2.) I like the ability to thumb type into my phone, but the G2’s old keyboard had long ago gone creaky, and it had lacked a dedicated number row besides.

Obligatory picture recently taken with my new computer telephone.  Featuring a cat.

Obligatory picture recently taken with my new computer telephone. Featuring a cat.

They don’t make nice smart phones with keyboards any more. Market research seems to indicate that the only remaining markets for keyboard phones are horny teenagers who need a cheap, hip Android-based Sidekick, and those legions of high powered business people who will never abandon their ancient Blackberries.

Anyway, the new Nexus 5 is here. The on-screen keyboard is okay slow and inaccurate. Like moving from a really fantastic sports car to a hovercraft piloted by a drunken monkey. I mean,the monkey-piloted hovercraft is undeniably cool technology, and I can eventually get where I need to go, but . . . its not the same, you see?

So, lets explore Voice dictation! It works . . . well, about as well as the monkey hovercraft, but with the added benefit that you don’t have to keep jiggling your thumb across the screen. But how do you do new lines and paragraphs? Where’s the command reference?

I asked Google. Google: android voice dictation commands?

Yup. If there is a reference somewhere, Google doesn’t know about it. How sad.

There is one humorous and not overly annoying video demonstrating how to do voice dictation. Various forum posts have users saying they can’t find a reference, but simple punctuation seems to work, and sometimes you can say “new paragraph” and sometimes you can not.

I have to wonder, at times.

The other thing that excited me about the Nexus 5 was that on the home screen you can drag apps right up to “Uninstall” . . . unless they’re Google apps! “Way to not be evil,” I cried. Until a Google colleague pointed out that it was just a bit of UI funkiness on Google’s part, owing to the applications coming bolted into the UI, there is at least a method to disable them.

Anyway, this is useful knowledge that helped me to vanquish the Picasa sync thing that has been hiding images from the gallery for the past few years. I have another project where I’m testing out BitTorrent Sync to pull images off our phones and then sync a copy of the family photo archive back down to the phones. If that works out, I’ll write it up. I may pursue that further to see if I can’t replace Dropbox, which, unfortunately, does not (yet) offer any sort of a family plan. Also, if I can host my own data I needn’t share as much of it with the NSA.

Feedback Welcome

October 15, 2013
JIRA, Technology

Notes From Atlassian Summit 2013

Link: https://dannyman.toldme.com/2013/10/15/atlassian-summit/

Two weeks ago, I attended Atlassian Summit 2013 in San Francisco.  This is an opportunity to train, network, and absorb propaganda about Atlassian products (JIRA, Greenhopper, Confluence, &c.) and ecosystem partners.  I thought I would share a summary of some of the notes I took along the way, for anyone who might find interest:

At the Keynote, Atlassian launched some interesting products:

As time passes, the ticket gets crankier at you about the SLA in real time.

As time passes, the ticket gets crankier at you in real time about the SLA.

Jira Service Desk

Jira Service Desk is an extension to JIRA 6 oriented around IT needs.  The interesting features include:

The first thing helps people get their work done, and the second is manager catnip.

Confluence Knowledge Base

Confluence 5.3 features a shake-the-box Knowledge Base setup:

Other Stuff I looked into:

REST and Webhooks

There was a presentation on JIRA’s REST API, and mention of Webhooks.

REST is really easy to use.  For example, hit https://jira.atlassian.com/rest/api/latest/issue/JRA-9

There’s API docs here: https://docs.atlassian.com/jira/REST/

Another feature for tight integration is Webhooks: you can configure JIRA so that certain issue actions trigger a hit to a remote URL.  This is generally intended for building apps around JIRA.  We might use this to implement Nagios ACKs.

Atlassian Connect

I haven’t looked too deeply as this is a JIRA 6 feature, but Atlassian Connect promises to be a new method of building JIRA extensions that is lighter-weight than their traditional plugin method.  (Plugins want you to set up Eclipse and build a Java Dev environment in your workstation… Connect sounds like just build something in your own technology stack around REST and Webhooks)

Cultivating Content: Designing Wiki Solutions that Scale

Rebecca Glassman, a tech writer at Opower, gave a really engaging talk that addresses a problem that seems commonplace: how to tame the wiki jungle!  Her methodology went something like this:

As they better learned user needs and what sort of knowledge there was, they built “The BOOK” (Body of Opower Knowledge) based on a National Parks model:

(I have some more notes on how they built, launched, and promoted The BOOK.  The problem they tackled sounds all to familiar and her approach is what I have always imagined as the sort of way to go.)

Ad Hoc Canvas

The Ad Hoc Canvas plugin for Confluence caught my eye.  At first glance, it is like Trello, or Kanban, where you fill out little cards and drag them around to track things.  But it has options to organize the information in different ways depending on the task at hand: wherever you are using a spreadsheet to track knowledge or work, Ad Hoc Canvas might be a much better solution.  Just look at the videos and you get an idea . . .

The Dark Art of Performance Tuning

Adaptavist gave a presentation on performance analysis of JIRA and Confluence.  It was fairly high-level but the gist of this is that you want to monitor and trend the state of the JVM: memory, heap, garbage collection, filehandles, database connections, &c.  He had some cool graphs of stuff like garbage collection events versus latency that had helped them to analyze issues for clients.  One consideration is that each plugin and each code revision to a plugin brings a bunch of new code into the pool with its own potential for issues.  Ideally, you can set up a load testing environment for your staging system.  Short of that, the more system metrics that you can track, you can upgrade plugins one at a time and watch for any effects.  As an example, one plugin upgrade went from reserving 30 database connections to reserving 150 database connections, and that messed up performance because the rest of the system would become starved of available database connections.  (So, they figured that out and increased that resource..)

tl;dr: JIRA Performance Tuning is a variation of managing other JVM Applications

Collaboration For Executives

I popped in on this session near the end, but the takeaway for anyone who wants to deliver effective presentations to upper management are:

The presenter’s narrative was driven by an initial need to capture executive buy-in that their JIRA system was critical to business function and needed adequate resourcing.

Feedback Welcome

September 23, 2013
JIRA, Python, Technical

Jython: Timezone Manipulation and Meeting Invitations vs Outlook

Link: https://dannyman.toldme.com/2013/09/23/jython-timezone-manipulation-and-meeting-invitations-vs-outlook/

As part of a project at work I’ve built some Jython code that builds iCalendar attachments to include meeting invitations for scheduled maintenance sessions. Jython is Python-in-Java which takes some getting used to but is damned handy when you’re working with JIRA. I will share a few anecdotes:

1) For doing date and time calculations, specifically to determine locale offset from UTC, you’re a lot happier calling the Java SimpleDateFormat stuff than you are dealing with Python. Python is a beautiful language but I burned a lot of time in an earlier version of this code figuring out how to convert between different time objects for manipulation and whatnot. This is not what you would expect from an intuitive, weakly-typed language, and it is interesting to find that the more obtuse, strongly-typed language handles time zones and it just fricking works.

Here is some sample code:

from java.text import SimpleDateFormat
from com.atlassian.jira.timezone import TimeZoneManagerImpl
tzm = TimeZoneManagerImpl(ComponentManager.getInstance().getJiraAuthenticationContext(),
    ComponentManager.getInstance().getUserPreferencesManager(),
    ComponentManager.getInstance().getApplicationProperties())
# df_utc = DateFormat UTC
# df_assignee = DateFormat Assignee
df_utc = SimpleDateFormat("EEE yyyy-MM-dd HH:mm ZZZZZ (zzz)")
df_assignee = SimpleDateFormat("EEE yyyy-MM-dd HH:mm ZZZZZ (zzz)")
tz = df_utc.getTimeZone()
df_utc.setTimeZone(tz.getTimeZone("UTC"))
df_assignee.setTimeZone(tzm.getTimeZoneforUser(assignee))
issue_dict['Start_Time_text'] = df_utc.format(start_time.getTime())
issue_dict['Start_Time_html'] = df_utc.format(start_time.getTime())
if df_utc != df_assignee:
    issue_dict['Start_Time_text'] += "\r\n                   "
    issue_dict['Start_Time_text'] += df_assignee.format(start_time.getTime())
    issue_dict['Start_Time_html'] += "
" issue_dict['Start_Time_html'] += df_assignee.format(start_time.getTime()) # Get TimeZone of Assignee # Start Time in Assignee TimeZone

Since our team is global I set up our announcement emails to render the time in UTC, and, if it is different, in the time zone of the person leading the change. For example:

Start Time: Mon 2013-09-23 23:00 +0000 (UTC)
Mon 2013-09-23 16:00 -0700 (PDT)

2) I was sending meeting invitations with the host set to the assignee of the maintenance event. This seemed reasonable to me, but when Mac Outlook saw that the host was set, it would not offer to add the event to the host’s calendar. After all, all meeting invitations come from Microsoft Outlook, right?! If I am the host it must already be on my calendar!!

I tried just not setting the host. This worked fine except now people would RSVP to the event and they would get an error stuck in their outboxes.

So . . . set the host to a bogus email address? My boss was like “just change the code to send two different invitations” which sounds easy enough for him but I know how creaky and fun to debug is my code. I came upon a better solution: I set the host address to user+calendar@domain.com. This way, Outlook is naive enough to believe the email address doesn’t match, but all our software which handles mail delivery knows the old ways of address extension . . . I can send one invitation, and have that much less messy code to maintain.

from icalendar import Calendar, Event, UTC, vText, vCalAddress
# [ . . . ]
event = Event()
# [ . . . ]
# THIS trick allows organizer to add event without breaking RSVP
# decline functionality.  (Outlook and its users suck.)
organizer_a = assignee.getEmailAddress().split('@')
organizer = vCalAddress('MAILTO:' + organizer_a[0]+ '+calendar@' +
    organizer_a[1])
organizer.params['CN'] = vText(assignee.getDisplayName() + ' (' + assignee.getName() + ')')
event['organizer'] = organizer

You can get an idea of what fun it is to build iCalendar invitations, yes? The thing with the parentheses concatenation on the CN line is to follow our organization’s convention of rendering email addresses as “user@organization.com (Full Name)”.

3) Okay, third anecdote. You see in my first code fragment that I’m building up text objects for HTML and plaintext. I feed them into templates and craft a beautiful mime multipart/alternative with HTML and nicely-formatted plaintext . . . however, if there’s a Calendar invite also attached then Microsoft Exchange blows all that away, mangles the HTML to RTF and back again to HTML, and then renders its own text version of the RTF. My effort to make a pretty text email for the users gets chewed up and spat out, and my HTML gets mangled up, too. (And, yes, I work with SysAdmins so some users actually do look at the plain text . . .) I hate you, Microsoft Exchange!

Feedback Welcome

« Newer Stuff . . . Older Stuff »
Site Archive