“The Italian experience provides a blueprint for how to defeat Mr. Trump. Only two men in Italy have won an electoral competition against Mr. Berlusconi: Romano Prodi and the current prime minister, Matteo Renzi (albeit only in a 2014 European election). Both of them treated Mr. Berlusconi as an ordinary opponent. They focused on the issues, not on his character. In different ways, both of them are seen as outsiders, not as members of what in Italy is defined as the political caste.”

“And an opposition focused on personality would crown Mr. Trump as the people’s leader of the fight against the Washington caste. It would also weaken the opposition voice on the issues, where it is important to conduct a battle of principles.”

Focus on issues and principles, not personality. Don’t feed the troll

Don't feed the troll

In internet speak, “to feed the troll” means to try to engage people online who are just trying to stir up discord for no other reason than to provoke people. Trolls are almost always insecure, psychologically-damaged people, if not full-blown psychopaths who lack the usual social barriers that most of us possess. Thus, a common piece of advice tossed about on the Internet is: “don’t feed the troll.” This is sound advice.

A useful corollary might be: “Don’t elect a troll.” But that’s already done, so we’re left to deal with a Troll-in-Chief. Trump can be engaged on two levels: 1) By reference to his policy decisions (which in less than two weeks have thrown the world into chaos), or 2) By reference to his childish, impulsive, ill-informed tantrums on Twitter. I’ll explain why constraining our responses to his policies is the best best.

Trump is not a politician. Judging by the fact that his personal ventures have failed to beat the S&P 500, he’s not much of a businessman either. So what exactly is Mr. Trump? He’s a showman of course. He has a pathological need for attention. Attention for Mr. Trump is an addiction like mainlining heroin. He is an arch-narcicisssist who stirs up shit on Twitter not only because he’s an angry man but also because he likes the dopamine spike when people respond to his countless micro-tantrums. By responding to his vacuous mean-spirited tirades, we the people along with the media are simply enabling an addicted, very impaired man. We must stop feeding the troll. When he publicly mocks an esteemed U.S. Senator who lost relatives in the Holocaust as he did with Senator Schumer, we need to restrain the impulse to report it or fire back. Only by interrupting the positive feedback loop do we have any hope of staying focused on priorities. After all, sticks and stones may break my bones but words will never hurt me. (Well, at least not directly.) Trump-the-Troll is going to say whatever he needs to say in order to get attention. Where does it end? Trump calling in the nuclear codes because he’s tired of being compared to a Cheeto? It’s time to starve the troll of the attention that fuels his impulsive blathering.

But more importantly, we must not feed the Troll-in-Chief because it’s a side-show. While we and the media are attending the carnival of trolls, the real architect, the real Goebbels, Bannon is working up some serious white-supremacist, Nazi-style mischief. The main attraction isn’t the Troll himself. The Troll is simply a distraction. While we’ve got our eyes on the Troll, Bannon is busy dismantling the foundations of the Republic.

Progressives have to become laser-focused and disciplined. We can start becoming more disciplined by starving the Troll of the attention he desperately craves.

AppleScript and iTerm2

Among the many reasons I use iTerm2 in lieu of the macOS Terminal is its AppleScript support.

I recently had the need to automate some tasks on my Amazon Web Services EC2 server in a way that takes advantage of iTerm2 AppleScript functionality.

Use case

I’ve found recently, that my screen sessions were disappearing. Although I haven’t completely excluded other causes, some have suggested that infrequently-reconnected sessions can be cleaned up. Since I’m not a Unix sysadmin, I’m not sure about this. However, I decided to test the hypothesis by writing an AppleScript that logs into my EC2 server, attaches to each screen session, detaches and closes the connection.

screen escape sequence implementation

The trickiest bit to solve was the ^A escape sequence that screen uses. Here’s how I solved that part:

1
2
3
key code 0 using {control down}
delay 1
keystroke "d"

By wrapping that in a subroutine, I was able to automate the detachment from the current screen.

Full implementation

The complete implementation just loops over the screen session ID’s, attaches and detaches then finally logs out and closes the window. I use LaunchControl to have the AppleScript run every 2 hours.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--
-- Created by: Alan Duncan
-- Created on: 2017-02-02
--
-- Copyright (c) 2017 OjisanSeiuchi
-- All Rights Reserved
--

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set screenIDs to {5546, 5208, 5129, 5580}

tell application "iTerm"
set newWindow to (create window with profile "OjisanSeiuchi EC2")
tell current session of current window
delay 3
repeat with screenID in screenIDs
-- attach to this screen session
set screenCommand to "screen -r " & (screenID as string)
write text screenCommand
delay 2
-- detach from the session
my detach()
delay 1
end repeat
write text "logout"
delay 1
end tell
close newWindow
end tell

-- detaches from the current screen session
on detach()
tell application "iTerm" to activate
tell application "System Events"
tell process "iTerm2"
key code 0 using {control down}
delay 1
keystroke "d"
end tell
end tell
end detach

We’ll see if this solves the problem of screen sessions disappearing.

NYT: Women who voted for Trump

Some insight into women who voted for Trump.

“I think he’s a really good man, deep down. This guy has such potential, and I truly believe he cares about our country and wants to help everyone.”

Well, by everyone, you mean “those exactly like me.” Actually, how about “just me”.


“But I had an 8-year-old who was totally on the Trump train. He talked me into taking him to a Trump rally.”

It’s never too early to think about getting the youngsters into the Hitler Youth.


“Trump’s a successful businessman, and I feel like that’s what America needs to bring our economy back.”

Well, let’s just forget about the multiple bankruptcies and stiffing contractors.


“Benghazi. The emails. The I.R.S. She’s a liar.”

Thank goodness we elected a truth-teller. Right.


“Look at how much Trump hires women, how much he does rely on women, how much he relies on his own daughter. I’m sort of amazed by her. She may pull him more into the middle. She’ll be a good voice for women.”

A good voice for wealthy women of privilege.


“Driving to work yesterday, I saw three homeless people. They need our help.”

So taking away any hope of medical coverage is the best way to help people?

Scripting Indigo with Python

I’ve used Indigo home automation software for a few years. It’s a integrated home automation software environment for the Mac and its a solid stable and well-supported platform.

Within Indigo, it’s possible to script triggers and actions either AppleScript or Python. It’s funny - AppleScript often looks like the easier route to take. It looks more like plain English than Python. But as they say, looks are deceiving. Two bits of bad news put the nail in AppleScript’s coffin for me - as least with Indigo.

First, I kept encountering a nasty bug when trying to talk to the Indigo Server via AppleScript run outside of the Indigo environment. You can read all about it on the Indigo forums, but basically AppleScript complained that Indigo Server wasn’t running when it plainly was running. I’m not usually one for complex workarounds such as thus that were being discussed on the forums.[1] So, I began to give Python a consideration.

Then there’s the iffy status of AppleScript coming out of Cupertino. The recent departure of Apple’s head of Mac automation technologies and the fact that Apple dissolved the whole Mac automation team doesn’t bode well for AppleScript.

Setting up to talk to Indigo via the Indigo Plugin Host (IPH) and Python

To make it easier to address the indigohost which is buried ddep in the Application Support directory, you should just create an alias.

1
2
~|⇒ echo "alias indigohost='/Library/Application\ Support/Perceptive\ Automation/Indigo\ 7/IndigoPluginHost.app/Contents/MacOS/IndigoPluginHost'" >> ~/.zshrc
~|⇒ source ~/.zshrc

I happen to use zsh so your terminal environment may be different.

Now to try out the indigohost:

1
indigohost -e 'return indigo.devices.len()'

This should return the number of devices you have. Now you can script Indigo in Python both from within the Indigo client context and as an external application.

To run a Python application as a separate file, it’s just:

1
indigohost -x iphtest.py

Resources

Here are a few resources to get you started:

Good luck and have fun!


  1. For example, some users have reported that restarting the AppleEvents daemon with sudo killall -9 appleeventsd can somehow allow external AppleScript applications to address the Indigo Server. It didn't work for me.

Going "low information"

namaste.jpg

In the wake of Donald Trump’s victory in the U.S. presidential election, Republicans are taking the opportunity to scold progressives about living in an echo chamber and failing to take a moment to sample thought patterns of the Right.

Well I did, but I came to the conclusion that most is still complete rubbish. In fact, according to Sturgeon’s Law, 90% of everything is crap. So don’t take it personally.

There are two problems with echo chambers. First they are chambers. Big walled-off areas that make it hard to hear the echoes from the adjacent chambers. To come to my own defence, I’ve peeked into the streams of my conservative friends. Sorry, you’re all great, but I don’t like what I see. One step beyond my immediate friends, I see rudeness, crudeness, profanity and little thoughtful analysis. Make a logical argument, bring evidence and I’ll listen. But “Lock that bitch up!”? What am I to do with that? Of course, the progressives have their own versions of the echo. But then there are the echoes themselves.

It’s the echoes that are bothering me mostly now.

The echoes have become a cacophony. Thoughts colliding against the walls, amplifying and distorting one another. It’s exhausting and anxiety provoking.

I’m trying something new. I’m dipping into the information stream on a need-to-know basis. Someone asks my opinion about the election of the U.S. president once every four years. And they ask about legislators on their own cycles. So I’ll check back on U.S. politics then. Seriously. Who is Trump going to pick for his Cabinet? Who will he nominate for the Supreme Court? I’m sure it’s all very fascinating. But I can’t do anything about it. And neither can you. Posting it on your FB feed. Liking this, liking that. It’s nothing. I’ll dip back into politics when I’m asked to vote. Otherwise what’s the point. Being informed? Being informed so that you can do what, exactly? So you participate in the Internet outrage du jour? FOMO?

Here’s my program:

  • I’m taking a week off all news and social media. Pushing the reset button.
  • I’ve deleted FB and Twitter from my phone. I’m not going anywhere. I haven’t resigned in protest. It’s just not helping me make better decisions.
  • I’ve deleted all bookmarks to news sites.
  • After a week, I’ll check back with FB. But my resolutions are:
    1. To spend no more that 10 minutes a day looking at FB.
    2. To log in to FB no more than once a day.
    3. To post something no more than once a week. Probably pictures of dogs, children, that sort of thing.
    4. To not post, like, or otherwise react to items of a political nature. Just to be clear, I still think Donald Trump is a neurotic pussy-grabbing clown, but now that you know that, we’re good.
  • For news sites, I’ll check back when I need to act on something and when I need more information in order to act. It’s all very interesting but I’m not sure what I’ll do with it.

I’m calling it goal-oriented news gathering.

Peace.