[sic]
Home    Info    Ask
About: Lasciate ogne speranza, voi ch'intrate

"Spin Madly On" theme by Margarette Bacani. Powered by Tumblr.
Saturday Morning Breakfast Cereal - 20120531

Saturday Morning Breakfast Cereal - 20120531

(Source: escroto, via ache)

atop coarse spring grass
we wake, cradled in sunlight
dreams drifting away

Command line Growl

A corollary to the previous. This is a simple bash script that provides growl functionality from the command line. Usage would just be

# growl "this is a test"
Once again credit to Vickash for providing the bulk of the code.

The full script:
#!/bin/bash

set -u
set -e

MSG="$@"

/usr/bin/osascript << EOF
property allNotifications : {}
on growl(theTitle, theContent)
  if allNotifications does not contain theTitle then
      set allNotifications to allNotifications & theTitle
  end if
  set myName to path to me as text
  set TID to text item delimiters
  set text item delimiters to ":"
  set myName to the last text item of myName
  set text item delimiters to TID
  tell application id "com.Growl.GrowlHelperApp"
      register as application myName all notifications allNotifications default notifications allNotifications icon of application "Finder"
      notify with name theTitle title theTitle description theContent application name myName
  end tell
end growl
growl("","$MSG")
EOF

Toggle Transmission Speed-Limit On/Off via script

A bash script which employs Applescript to toggle Transmissions’s “Speed Limit” feature on/off. Scripting this functionality enables you to write other scripts that fire off any external criteria. In my case I automatically turn on SL when my housemates sign on to the network and automatically turn it off when the sign off. I might also set it up so that the speed limit automatically enables if I am using Chrome.

This script assumes installation of Growl 1.2.2 and Transmission 2.52. The Growl stuff is easily removed if you don’t have Growl (but you should since 1.2.2 is free and it’s pretty cool.) It should also work with any Transmission version that has the same menu structure as Transmission 2.52.

Sucks to have to use GUI scripting via AppleScript but I couldn’t find a better way to programmatically control transmission’s speed limit functionality.

Credits:

  • Karin for publishing the relevant AS
  • Vickash for neatly scripting the Growl stuff

#!/bin/bash

set -e
set -u

function toggleSL {
/usr/bin/osascript << EOF
property allNotifications : {}
on growl(theTitle, theContent)
  if allNotifications does not contain theTitle then
      set allNotifications to allNotifications & theTitle
  end if
  set myName to path to me as text
  set TID to text item delimiters
  set text item delimiters to ":"
  set myName to the last text item of myName
  set text item delimiters to TID
  tell application id "com.Growl.GrowlHelperApp"
      register as application myName all notifications allNotifications default notifications allNotifications icon of application "Transmission"
      notify with name theTitle title theTitle description theContent application name myName
  end tell
end growl
set toggled to false
tell application "System Events"
  set frontApp to name of the first process whose frontmost is true
  tell process "Transmission"
    set frontmost to true
    if value of attribute "AXMenuItemMarkChar" of menu item "Speed Limit" of menu "Transfers" of menu bar 1 as text is $1"" then
      click menu item "Speed Limit" of menu "Transfers" of menu bar 1
      set toggled to true
    end if
  end tell
  tell process frontApp
    set frontmost to true
  end tell
end tell
if (toggled is true)
  growl("Transmission","Transmission speed limit turned $2")
end if
EOF
}

if [ "$1" == "off" ]
then
  toggleSL "not " "off"
elif [ "$1" == "on" ]
then
  toggleSL " " "on"
else
  echo "Argument must be either on or off"
  exit -1
fi

theatlantic:

What Can a Nobel Prize-Winning Economist Teach Us About Obamacare?

Ronald Coase won the Nobel Prize in Economics for showing that social costs are symmetrical. In The Problem of Social Cost, Coase invoked the example of a farmer whose crops are trampled by the neighboring rancher’s cattle. Before Coase, it would have been common to view the rancher as the culprit responsible for imposing costs on the blameless farmer. Coase pointed out that no matter which way the legal rights were allocated, one was imposing costs on the other. If the law forces the rancher to keep his cattle fenced in, the farming imposes fence-building costs on the rancher. If the law gives the rancher the right to let his cattle roam free, then the farmer bears the social cost.
Coase’s work was instrumental in establishing a new field of scholarship — the economic analysis of the law, which has been highly influential in many legal areas. In light of this, it is surprising how little role the core Coasian insight had in the Supreme Court’s recent oral argument about the Obamacare mandate. Much of the discussion seemed to take for granted that this mandate encroaches on individual liberty, depriving individuals of the “freedom” not to purchase health insurance.
But as Coase’s analysis makes clear, framing the issue in terms of individual liberty is deeply misleading. When the uninsured get sick and go to the emergency room for care they cannot afford, someone has to pay the costs. If the law gives the uninsured the right not to buy health insurance, then the costs for their emergency care are imposed on the insured, whose payments must cover the hospital’s costs. If the law instead requires the uninsured to buy health insurance, they become personally responsible for the cost of the care they receive.
In other words, the issue is not whether to have a mandate, but rather on whom the mandate should be imposed.
Read more. [Image: mrfoto/Shutterstock]

theatlantic:

What Can a Nobel Prize-Winning Economist Teach Us About Obamacare?

Ronald Coase won the Nobel Prize in Economics for showing that social costs are symmetrical. In The Problem of Social Cost, Coase invoked the example of a farmer whose crops are trampled by the neighboring rancher’s cattle. Before Coase, it would have been common to view the rancher as the culprit responsible for imposing costs on the blameless farmer. Coase pointed out that no matter which way the legal rights were allocated, one was imposing costs on the other. If the law forces the rancher to keep his cattle fenced in, the farming imposes fence-building costs on the rancher. If the law gives the rancher the right to let his cattle roam free, then the farmer bears the social cost.

Coase’s work was instrumental in establishing a new field of scholarship  the economic analysis of the law, which has been highly influential in many legal areas. In light of this, it is surprising how little role the core Coasian insight had in the Supreme Court’s recent oral argument about the Obamacare mandate. Much of the discussion seemed to take for granted that this mandate encroaches on individual liberty, depriving individuals of the “freedom” not to purchase health insurance.

But as Coase’s analysis makes clear, framing the issue in terms of individual liberty is deeply misleading. When the uninsured get sick and go to the emergency room for care they cannot afford, someone has to pay the costs. If the law gives the uninsured the right not to buy health insurance, then the costs for their emergency care are imposed on the insured, whose payments must cover the hospital’s costs. If the law instead requires the uninsured to buy health insurance, they become personally responsible for the cost of the care they receive.

In other words, the issue is not whether to have a mandate, but rather on whom the mandate should be imposed.

Read more. [Image: mrfoto/Shutterstock]

theatlantic:

Yes, America, We Have Executed an Innocent Man

At 11 p.m Monday, the Columbia University Human Rights Review published and posted its Spring 2012 issue — devoted entirely to a single piece of work about the life and death of two troubled and troublesome South Texas men. In explaining to their readers why an entire issue would be devoted to just one story, the editors of the Review said straightly that the “gravity of the subject matter of the Article and the possible far-reaching policy ramifications of its publication necessitated this decision.” […]
The Review article is an astonishing blend of narrative journalism, legal research, and gumshoe detective work. And it ought to end all reasonable debate in this country about whether an innocent man or woman has yet been executed in America since the modern capital punishment regime was recognized by the Supreme Court in 1976. The article is also a clear and powerful retort to Justice Scalia in Kansas v. Marsh: Our capital cases don’t have nearly the procedural safeguards he wants to pretend they do.
Read more. [Image: Corpus Christi Police Department]

theatlantic:

Yes, America, We Have Executed an Innocent Man

At 11 p.m Monday, the Columbia University Human Rights Review published and posted its Spring 2012 issue — devoted entirely to a single piece of work about the life and death of two troubled and troublesome South Texas men. In explaining to their readers why an entire issue would be devoted to just one story, the editors of the Review said straightly that the “gravity of the subject matter of the Article and the possible far-reaching policy ramifications of its publication necessitated this decision.” […]

The Review article is an astonishing blend of narrative journalism, legal research, and gumshoe detective work. And it ought to end all reasonable debate in this country about whether an innocent man or woman has yet been executed in America since the modern capital punishment regime was recognized by the Supreme Court in 1976. The article is also a clear and powerful retort to Justice Scalia in Kansas v. Marsh: Our capital cases don’t have nearly the procedural safeguards he wants to pretend they do.

Read more. [Image: Corpus Christi Police Department]

theatlantic:

‘Lucy’ Obama and His ‘Charlie Brown’ Progressives

Lucy just had one Charlie Brown. Obama has a whole roster of would-be kickers, and a habit of teeing up the ball only to callously pull it away.Don’t progressives see this?
Obama tricked the cannabis community into thinking his Justice Department would go easy on medical marijuana in states where it is legal, broke his promise, then misled voters about his options.
Obama tricked anti-war voters into thinking that he wouldn’t order American troops into battle unless there was an imminent threat to America or a declaration of war from Congress, then went to war in Libya, violating the War Powers Resolution, even though neither condition was met.
Obama tricked transparency advocates into thinking he’d celebrate whistleblowers and set new standards in open government. He has prosecuted whistleblowers as aggressively as any president in history, and presided over a dramatic escalation in what the federal government does in secret.
Obama tricked executive-power critics into thinking he would roll back the excesses of the Bush Administration. He has transformed those excesses into matters of bipartisan consensus, and gone farther in some respects, as when an American citizen was killed extra-judicially on his order. 
Obama tricked immigration-reform advocates into thinking he was a fellow traveler, then upset them with Secure Communities, record-breaking deportation levels, and a failure to improve immigration detention.
Obama tricked Iraq War opponents into thinking that he would exit the country by the withdrawal date that George W. Bush negotiated. The Iraqi government wouldn’t let him keep troops in the country beyond that date, although he tried to break his promise. Now the Obama Administration pays a small army of private-security contractors to protect America’s presence in that country.
Obama tricked critics of indefinite detention into thinking that he abhorred the practice, only to sign a bill that institutionalized it. 
Obama tricked critics of signing statements into thinking he wouldn’t issue them. But he’s done so on many occasions.
Obama tricked critics of the state-secrets privilege into thinking he’d reverse Bush-era uses of the tactic. Instead he’s continued it.
This isn’t an exhaustive list, but these examples are sufficient to draw a conclusion: Progressives shouldn’t trust what Obama says, or what they think he believes. They should judge his actions. It’s the only way to distinguish between promises he aims to keep and things he’s said to mislead small constituencies into thinking he’ll do more for them than is justified by reality. 
[Images: Charles Schultz/Reuters, edited by David A. Graham]

theatlantic:

‘Lucy’ Obama and His ‘Charlie Brown’ Progressives

Lucy just had one Charlie Brown. Obama has a whole roster of would-be kickers, and a habit of teeing up the ball only to callously pull it away.

Don’t progressives see this?

  • Obama tricked the cannabis community into thinking his Justice Department would go easy on medical marijuana in states where it is legal, broke his promise, then misled voters about his options.
  • Obama tricked anti-war voters into thinking that he wouldn’t order American troops into battle unless there was an imminent threat to America or a declaration of war from Congress, then went to war in Libya, violating the War Powers Resolution, even though neither condition was met.
  • Obama tricked transparency advocates into thinking he’d celebrate whistleblowers and set new standards in open government. He has prosecuted whistleblowers as aggressively as any president in history, and presided over a dramatic escalation in what the federal government does in secret.
  • Obama tricked executive-power critics into thinking he would roll back the excesses of the Bush Administration. He has transformed those excesses into matters of bipartisan consensus, and gone farther in some respects, as when an American citizen was killed extra-judicially on his order. 
  • Obama tricked immigration-reform advocates into thinking he was a fellow traveler, then upset them with Secure Communities, record-breaking deportation levels, and a failure to improve immigration detention.
  • Obama tricked Iraq War opponents into thinking that he would exit the country by the withdrawal date that George W. Bush negotiated. The Iraqi government wouldn’t let him keep troops in the country beyond that date, although he tried to break his promise. Now the Obama Administration pays a small army of private-security contractors to protect America’s presence in that country.
  • Obama tricked critics of indefinite detention into thinking that he abhorred the practice, only to sign a bill that institutionalized it. 
  • Obama tricked critics of signing statements into thinking he wouldn’t issue them. But he’s done so on many occasions.
  • Obama tricked critics of the state-secrets privilege into thinking he’d reverse Bush-era uses of the tactic. Instead he’s continued it.

This isn’t an exhaustive list, but these examples are sufficient to draw a conclusion: Progressives shouldn’t trust what Obama says, or what they think he believes. They should judge his actions. It’s the only way to distinguish between promises he aims to keep and things he’s said to mislead small constituencies into thinking he’ll do more for them than is justified by reality. 

[Images: Charles Schultz/Reuters, edited by David A. Graham]

Block non-VPN traffic on OSX using OpenVPN

For the sake of completeness here are the rules I’m using to block non-VPN traffic now that I’ve switched from PPTP to OpenVPN. Once again the idea is that if the OpenVPN connection drops no (meaningful) internet traffic should be allowed over the unencrypted ISP connection.

These rules were published by Gordon Willem Klok here. I just modified them to account for the specifics of my OpenVPN provider.

01000 allow ip from any to any via lo*
01001 allow ip from any to 46.246.117.0/24 dst-port 1194-1201 out
01002 allow ip from 46.246.117.0/24 1194-1201 to any in
01003 allow udp from any 67 to any dst-port 68 in
01004 allow udp from any 68 to any dst-port 67 out
01005 allow ip from any to any dst-port 53 out via tap0
01006 allow ip from any 53 to any in via tap0
01007 allow ip from any to any via tap0
01008 allow ip from any to any dst-port 53 out
10101 allow ip from any 53 to any in
10201 deny ip from any to any in
20001 deny ip from any to any out
65535 allow ip from any to any

myheadisweak:

Day and Night in New York City Captured in Single Images by Stephen Wilkes.

(via theatlantic)