Shared posts

20 Mar 22:10

Bonus: L.A. Teachers’ Strike

Tom Roche

just 30 min, just Will (no bant) doing excellent interview with teachers about LAUSD and the state of US public education (and the assault on US public goods and public sector generally)

Will talks to Betsy and Gloria, two LA public school teachers, ahead of the three-day teachers’ strike planned to begin this Tuesday. They discuss their demands, the conditions in the schools, engaging the local community, and challenges from the LA school district superintendent.


Support the UTLA & SEIU 99 through the links here: https://linktr.ee/ctowne1115?utm_source=linktree_profile_share&ltsid=c4187339-a6f3-459a-9e58-874764f6c580



Get bonus content on Patreon

Hosted on Acast. See acast.com/privacy for more information.

20 Mar 20:39

Real Python: Executing Python Scripts With a Shebang

Tom Roche

good (but truncated--definitely see [full article](https://realpython.com/python-shebang/), archived [here](https://archive.today/lkEL2) and [here](http://web.archive.org/web/20230320203813/https://realpython.com/python-shebang/), esp re portability) summary of this very-important, often-overlooked technique

In shell scripts, the shebang line (#!) specifies the path to the interpreter that should execute the file. You can place it at the top of your Python file to tell the shell how to run your script, allowing you to execute the script directly without typing python before the script name. The shebang is essential for Unix-like systems but ignored on Windows unless using specific compatibility layers.

By the end of this tutorial, you’ll understand that:

  • A shebang specifies the path to the Python interpreter in scripts, allowing direct execution.
  • You should include a shebang when a script needs direct execution, but not in import-only modules.
  • Best practices for shebangs include using /usr/bin/env for portability and ensuring the script is executable.
  • Shebangs have limitations, such as being ignored on Windows without compatibility layers like WSL.

To proceed, you should have basic familiarity with the command line and know how to run Python scripts from it. You can also download the supporting materials for this tutorial to follow along with the code examples:

Free Sample Code: Click here to download the free sample code that you’ll use to execute Python scripts with a shebang.

What’s a Shebang, and When Should You Use It?

In short, a shebang is a special kind of comment that you may include in your source code to tell the operating system’s shell where to find the interpreter for the rest of the file:

Python
#!/usr/bin/python3

print("Hello, World!")
Copied!

If you’re using a shebang, it must appear on the first line in your script, and it has to start with a hash sign (#) followed by an exclamation mark (!), colloquially known as the bang, hence the name shebang. The choice of the hash sign to begin this special sequence of characters wasn’t accidental, as many scripting languages use it for inline comments.

You should make sure you don’t put any other comments before the shebang line if you want it to work correctly, or else it won’t be recognized! After the exclamation mark, specify an absolute path to the relevant code interpreter, such as Python. Providing a relative path will have no effect, unfortunately.

Note: The shebang is only recognized by shells, such as Z shell or Bash, running on Unix-like operating systems, including macOS and Linux distributions. It bears no particular meaning in the Windows terminal, which treats the shebang as an ordinary comment by ignoring it.

You can get the shebang to work on Windows by installing the Windows Subsystem for Linux (WSL) that comes with a Unix shell. Alternatively, Windows lets you make a global file association between a file extension like .py and a program, such as the Python interpreter, to achieve a similar effect.

It’s not uncommon to combine a shebang with the name-main idiom, which prevents the main block of code from running when someone imports the file from another module:

Python
#!/usr/bin/python3

if __name__ == "__main__":
    print("Hello, World!")
Copied!

With this conditional statement, Python will call the print() function only when you run this module directly as a script—for example, by providing its path to the Python interpreter:

Shell
$ python3 /path/to/your/script.py
Hello, World!
Copied!

As long as the script’s content starts with a correctly defined shebang line and your system user has permission to execute the corresponding file, you can omit the python3 command to run that script:

Shell
$ /path/to/your/script.py
Hello, World!
Copied!

A shebang is only relevant to runnable scripts that you wish to execute without explicitly specifying the program to run them through. You wouldn’t typically put a shebang in a Python module that only contains function and class definitions meant for importing from other modules. Therefore, use the shebang when you don’t want to prefix the command that runs your Python script with python or python3.

Note: In the old days of Python, the shebang line would sometimes appear alongside another specially formatted comment described in PEP 263:

Python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    print("Grüß Gott")
Copied!

The highlighted line used to be necessary to tell the interpreter which character encoding it should use to read your source code correctly, as Python defaulted to ASCII. However, this was only important when you directly embedded non-Latin characters, such as ü or ß, in your code.

This special comment is irrelevant today because modern Python versions use the universal UTF-8 encoding, which can handle such characters with ease. Nevertheless, it’s always preferable to replace tricky characters with their encoded representations using Unicode literals:

Python
>>> "Grüß Gott".encode("unicode_escape")
b'Gr\\xfc\\xdf Gott'
Copied!

Your foreign colleagues who have different keyboard layouts will thank you for that!

Now that you have a high-level understanding of what a shebang is and when to use it, you’re ready to explore it in more detail. In the next section, you’ll take a closer look at how it works.

How Does a Shebang Work?

Normally, to run a program in the terminal, you must provide the full path to a particular binary executable or the name of a command present in one of the directories listed on the PATH environment variable. One or more command-line arguments may follow this path or command:

Shell
$ /usr/bin/python3 -c 'print("Hello, World!")'
Hello, World!

$ python3 -c 'print("Hello, World!")'
Hello, World!
Copied!

Here, you run the Python interpreter in a non-interactive mode against a one-liner program passed through the -c option. In the first case, you provide an absolute path to python3, while in the second case, you rely on the fact that the parent folder, /usr/bin/, is included on the search path by default. Your shell can find the Python executable, even if you don’t provide the full path, by looking through the directories on the PATH variable.

Note: If multiple commands with the same name exist in more than one directory listed on the PATH variable, then your shell will execute the first it can find. As a result, the outcome of running a command without explicitly specifying the corresponding path may sometimes be surprising. It’ll depend on the order of directories in your PATH variable. However, this can be useful, as you’ll find out later.

Read the full article at https://realpython.com/python-shebang/ »


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

20 Mar 20:30

3/20/23: Is Trump's Arrest Imminent?/MAGA Rages At Desantis/Credit Suisse Rescued/ Putin Tours Ukraine Warzone/Iraq 20 year Anniversary/Anti-Lab Leak Propaganda/Jon Stewart KO's Larry Summers

Tom Roche

WAAAY too much Trump (esp potential Bragg indictment for Stormy Daniels payoff) and 2024 horserace up front: it's basically the 1st half of this ep. Then MUCH better on
- banking (both Switzerland {UBS, Credit Suisse} and esp US (mid-to-large bank bailouts/backstops withheld from small/local banks)
- US sockpuppeting Ukraine (K&S don't quite say /that/, but they get close)
- 20th anniversary lookback/bigup to 2003 opponents (inc Bernie Sanders, Barbara Lee, Obama, Phil Donahue, Michael Moore) of the 2nd US invasion of Iraq
- good Saagar radar on latest attempt (this time via The Atlantic) to obfuscate growing evidence for lableak by showering USCFM with zoonotic bogusity (this time, COVID-19 via raccoon dogs)
- EXCELLENT Krystal radar on Jon Stewart in-your-face pushback to Larry Summers on US inflation policy specifically, and (JS doesn't use this term, at least in the clips, but he might as well have said) privatizing massive profits for the US 1% while socializing their losses

Krystal and Saagar discuss Trump's claims that he will be arrested on Tuesday, Lawyer Bradley Moss (@BradMossEsq) joins to give his legal opinion on Trump's legal scenario, MAGA demands Desantis block arrest of Trump, Pence is frozen on Trump criticism, Credit Suisse rescued on brink, Biden Sec confirms small banks won't receive same treatment, Putin tours Ukraine Warzone, US infuriated by China's Ukraine Peace Deal, the 20 year anniversary of Iraq, Saagar looks into the insane Anti Lab Leak propaganda, and Krystal looks into Jon Stewart's interview with Larry Summers on Socialism for the Rich.


To become a Breaking Points Premium Member and watch/listen to the show uncut and 1 hour early visit: https://breakingpoints.supercast.com/



To listen to Breaking Points as a podcast, check them out on Apple and Spotify



Apple: https://podcasts.apple.com/us/podcast/breaking-points-with-krystal-and-saagar/id1570045623

 


Spotify: https://open.spotify.com/show/4Kbsy61zJSzPxNZZ3PKbXl

 



Merch: https://breaking-points.myshopify.com/

Learn more about your ad choices. Visit megaphone.fm/adchoices

20 Mar 18:27

Your Place or Mine with Shaun Keaveny: Mini Guide

Tom Roche

Keaveny and Lawrence excellent as usual, this time with quick surveys of 5 world festivals

It’s cold and it's grey out there right now, so time to start planning your holiday... welcome to Shaun's mini travel guides, to warm you up before Series 2. In this guide Shaun shares some seriously fab festivals, from Burning Man to the world's biggest food fight. Your Place Or Mine is the travel podcast that isn’t going anywhere - not until guests can convince Shaun Keaveny it’s worth getting off the sofa for. Each week a familiar face will try to persuade Shaun and resident geographer, historian and comedian Iszi Lawrence that jetting off to their favourite destination is worth the hassle. Your Place or Mine is a BBC Audio production for BBC Radio 4 and BBC Sounds. Producers: Becca Bryers and Hannah Hufford
19 Mar 05:17

John Cale, Spy Songs & RIP Wayne Shorter

Tom Roche

[EXCELLENT ep](https://soundopinions.org/show/903) (archived [here](http://web.archive.org/web/20230318041652/https://www.soundopinions.org/show/903)) overall, but ... it has 3 segments, following /not/ in order:

1. (intro to 19:18) interview with John Cale, a massively important 20c musician (and still active--this interview is largely about his [new/2023 album](https://en.wikipedia.org/wiki/Mercy_(John_Cale_album)))
3. (44:09-50:13) obit for Wayne Shorter (1933-2023), /yet another massively important 20c musician/ (who also continued releasing well into this century)
2. (19:33-44:00) excerpts from 10 songs about spies and spying

Sooo ... I can see, maybe, not doing 2 entire episodes about Cale and Shorter. Maybe. But ... why the need to cram-in this not-quite-filler (these really are some great songs), giving these giants even less space/tribute, given that SO still keep to a 50-ish-minutes-per-episode (inherited from their WBEZ days, and they're still widely distributed on US public radio)?

For more than 60 years, John Cale has continued to make exciting, challenging and culturally relevant music, including his most recent release, Mercy. Hosts Jim DeRogatis and Greg Kot talk with the Velvet Underground legend about his new music, collaborations and legacy. Plus, the hosts share some of their favorite spy songs and bid farewell to jazz saxophonist Wayne Shorter.

 

Join our Facebook Group: https://bit.ly/3sivr9T

Become a member on Patreon: https://bit.ly/3slWZvc

Sign up for our newsletter: https://bit.ly/3eEvRnG

Make a donation via PayPal: https://bit.ly/3dmt9lU

Send us a Voice Memo: Desktop: bit.ly/2RyD5Ah  Mobile: sayhi.chat/soundops

 

Featured Songs:

John Cale, "STORY OF BLOOD feat. Weyes Blood," Mercy, Double Six, 2023
The Beatles, "With A Little Help From My Friends," Sgt. Pepper's Lonely Hearts Club Band, Capitol, 1967
John Cale, "EVERLASTING DAYS feat. Animal Collective," Mercy, Double Six, 2023
John Cale, "MARILYN MONROE'S LEGS (beauty elsewhere) feat. Actress," Mercy, Double Six, 2023
John Cale, "TIME STANDS STILL feat. Sylvan Esso," Mercy, Double Six, 2023
John Cale, "NIGHT CRAWLING," Mercy, Double Six, 2023
John Cale, "MOONSTRUCK (Nico's Song)," Mercy, Double Six, 2023
The Velvet Underground and Nico, "Femme Fatale," The Velvet Underground & Nico, Verve, 1967
The Velvet Underground and Nico, "I'm Waiting for the Man," The Velvet Underground & Nico, Verve, 1967
John Cale, "Dying On the Vine (Fragments)," Artificial Intelligence, PVC, 1985
John Cale, "MERCY," Mercy, Double Six, 2023
Johnny Rivers, "Secret Agent Man," ...And I Know You Wanna Dance, Imperial, 1966
Tony Allen, "Secret Agent," Secret Agent, World Circuit, 2009
The Fugs, "CIA Man," Virgin Fugs, ESP-Disk, 1967
Gene Vincent, "Private Detective (feat. The Shouts)," Private Detective (feat. The Shouts) (Single), Columbia, 1964
Rockwell, "Somebody's Watching Me," Somebody's Watching Me, Motown, 1984
The Untouchables, "I Spy (For the F.B.I.)," Wild Child, MCA, 1985
Lori & The Chameleons, "The Lonely Spy," To the Shores of Lake Placid, Zoo, 1982
Desmond Dekker & the Aces, "007 (Shanty Town)," Action!, Lagoon, 1968
The dB's, "A Spy In the House of Love," Like This, Bearsville, 1984
Big Boys, "Detectives," The Skinny Elvis, Touch and Go, 1993
Steely Dan & Tom Scott, "Aja," Aja, ABC, 1977
Wayne Shorter, "Speak No Evil," Speak No Evil, Blue Note, 1966
Poster Children, "She Walks," Flower Plower, Limited Potential, 1989

Support The Show: https://www.patreon.com/soundopinions

See omnystudio.com/listener for privacy information.

See Privacy Policy at https://art19.com/privacy and California Privacy Notice at https://art19.com/privacy#do-not-sell-my-info.

18 Mar 21:30

Will the Left Stand Up to the Deep State?

by Katie Halper
Tom Roche

more-consistently-EXCELLENT-than-usual UI, including:
- (3 of) 4 food groups
----- Jamie Raskin rant: unhinged, McCarthyite, Putinphobic, lying, deepstate-censorship-loving--it's the fellative mode of CorpDem politics in one loathsome package !-(
----- Bill Cassidy vs Social Security--what CorpRepub's do in daylight, after fellating Wall Street all night long
----- Havana Syndrome ferret torture (gotta listen--it's as bad as it sounds :-(
- Christian Parenti interview: mostly VERY EXCELLENT analysis
----- US banking fails c1999-2023
----- how US ProgDems simp for the CorpDem-deepstate alliance

Subscribe for the full episode at the bottom of the page. Watch a free preview here:

“Why has the Left turned its back on free speech?” asks Christian Parenti, professor of economics and author of Radical Hamilton.

As Democrats censor Matt Taibbi over the Twitter Files, smear journalists Seymour Hersh and Jeff Gerth for reporting facts they don’t like, bury coverage on the Ohio train derailment, and vote for censorship bills in the name of stopping Putin, Parenti recalls a time when it was the Left who were the defenders of the First Amendment.

But now, as US leaders move deeper and darker into warmongering and censorship, lying to us at every turn to grow their power and wealth, Parenti instead asks: “When will the Left stand up to the deep state?”

The most recent move by the rich and powerful is the bailout of Silicon Valley Bank. “This is triage,” Parenti explains. “This is a tourniquet on a shattered leg, and that has to happen. You cannot let the US financial system collapse and not bring down the rest of the economy.” But while he agrees that the bailout is necessary in the short run, Parenti explains that the collapse is the fault of the capitalist system itself. Hear his analysis on how to fix it.

Plus, listen to the full interview on how the FBI intervened in the election, why liberal media is against free speech, and Christian and Aaron’s debate on Trump’s anti-war message.

Check out this week’s Thursday Throwdown: Democrats’ Matt Taibbi Meltdown where Useful Idiot Matt Taibbi goes to Congress.

And join the Absurd Arena live discussion board with Katie and Aaron every Tuesday at 12pm est in the Substack app.

Watch the full interview here:

Read more

18 Mar 21:10

UNLOCKED: Show and Tell: Father Ted

by The Späti Boys
Tom Roche

EXCELLENT Ciarán+Nick+Rob on the classic Irish sitcom (1995-1998), including
- writers, actors, and characters
- modern Ireland culture esp entertainment (much less politics, even less economics)
- 1990s in Ireland and globally (esp US)
- da Choich (not just from Ciarán but also Nick (Babakitis), who despite being Greek, is also apparently Catholic--didn't know that was legal :-)

Unlocked for Paddy's Day! Ciarán shows the Irish classic sitcom Father Ted to the class

FOR MORE LIKE THIS SUB ON PATREON:
https://www.patreon.com/cornerspaeti

HOW TO REACH US:
Corner Späti https://twitter.com/cornerspaeti
Julia https://twitter.com/KMarxiana
Rob https://twitter.com/leninkraft
Nick https://twitter.com/sternburgpapi
Uma https://twitter.com/umawrnkl
Ciarán https://twitter.com/CiaranDold

Support Corner Späti

18 Mar 19:04

Hunter Biden Sues Laptop Repair Shop—Confirming Authenticity, ICC Issues Arrest Warrant for Putin, Kamala Beclowns Herself (Again), & More

Tom Roche

VERY EXCELLENT not-quite-week-in-review: no Michael Tracey unfortunately, but Greenwald and guest Nick Cruse (@ Revolutionary Blackout Network) spit fire

18 Mar 16:51

AER 122: Attempts to arrest Imran Khan and the Lahore High Court rallies

Tom Roche

VERY EXCELLENT short but action-packed Waqas Ahmed review of Pakistan politics 2021-2023

Waqas is back to keep us up to date on the Imran Khan file. The entire Pakistan establishment is united in trying to keep Imran Khan from returning to power in an election through court cases, violent repression, and electoral delay; but the people’s protests don’t seem to stop. Pakistan and Imran Khan at an … Continue reading "AER 122: Attempts to arrest Imran Khan and the Lahore High Court rallies"
17 Mar 20:58

How Iran Won the U.S. War in Iraq

by Murtaza Hussain
Tom Roche

pullquote:
> This picture of Iranian ascendance [in Iraq after 2003] is not only reflected in that country’s own intelligence documents. A massive two-volume study published in 2019 by the U.S. Army War College [v1 [here](https://digitalcommons.usmalibrary.org/books/16/) and [here](https://archive.is/EflpC), v2 [here](https://digitalcommons.usmalibrary.org/books/15/) and [here](https://archive.is/Lefi5)] came to a similar conclusion, stating that “an emboldened and expansionist Iran appears to be the only victor” of the conflict. The study is the most comprehensive look yet at the costs and consequences of the war from a U.S. military perspective.

In January 2015, as Islamic State militants were waging an offensive across Iraq and Syria, an Iranian intelligence officer known among his colleagues by the code name Boroujerdi sat down for a meeting with an important official: then-Iraqi Prime Minister Haider al-Abadi.

The meeting, held at Abadi’s office in Iraq’s presidential palace in Baghdad, took place “without the presence of a secretary or a third person,” according to a report about the discussion contained in a leaked archive of cables from Iran’s shadowy Ministry of Intelligence and Security.

Abadi was a member of Iraq’s exiled political class, mostly Shia, who had returned to take power following the U.S. invasion. The two men discussed a range of topics, including the threat of ISIS to the Iraqi state, the role of foreign powers like Turkey and Saudi Arabia in the region, and, finally, the position of the West. On at least one point, they agreed: Despite the threat of ISIS and other regional powers, the political conditions wrought by the U.S. invasion of Iraq and removal of Saddam Hussein had created an opportunity for the Islamic Republic of Iran and its allied Iraqi elites to “take advantage of this situation,” according to the Ministry of Intelligence and Security report.

Twenty years after U.S. troops first invaded Iraq, the classified Iranian intelligence documents, which were leaked to The Intercept and first reported in a series of stories that were published beginning in 2019, shed light on the important question of who actually won the war. One victor emerges clearly from the hundreds of pages of classified documents: Iran.

Today, Iran enjoys privileged access to Iraq’s political system and economy, while the United States has been reduced to a minor player. Iraqis themselves remain fractiously divided; many of their own political elites are close allies of Iran. The Ministry of Intelligence and Security cables, which were written between 2013 and 2015, the peak of the international campaign against ISIS, provide no shortage of examples of the expansion of Iran’s influence in Iraq. While helping train and organize Iraqi security forces who are ideologically tied to the Islamic Republic, activities documented at length in the cables, Iranian officials had also been routinely involved in promoting favored Iraqi politicians to important roles in the Iraqi government to protect Iran’s economic and political interests. One classified 2014 report contained in the trove of Iranian cables described then-future Iraqi Prime Minister Adil Abdul-Mahdi as having a “special relationship” with Iran and named a laundry list of other Iraqi cabinet members who were close with the Islamic Republic — often people who had spent years exiled in Iran. The cables discuss how these close relationships have benefitted Iran, including by having sympathetic Iraqi officials give Iran access to Iraqi airspace and vital transportation connections with their allies in Syria.

The privileged conversation between Boroujerdi and Abadi was being replicated at that time at many levels of Iraqi government and society. In the cables, Iranian officials documented their work to solidify business and security interests in Iraq while obtaining oil and development contracts in the northern Kurdish regions and water purification projects in the south, the latter won with the help of a $16 million bribe paid to an Iraqi member of Parliament, according to one of the documents. The cables also show how former Iraqi military officials, including individuals trained or supported by the U.S. during the occupation, had been pressed into the service of Iranian intelligence, with one typical operative described as being forced to “collaborate to save himself.”

The war’s benefits to Iran were not solely political or security based either. Iraq is home to many sacred sites of Shia Islam, which, as the cables note, have opened up to Iranian tourism and influence. The documents in the Ministry of Intelligence and Security archive mostly provide individual reports of conversations and intelligence activities carried out by Iranian operatives inside Iraq. Yet overall, they depict Iran’s far-reaching political, security, and even cultural influence over Iraqi society in the vacuum left by the U.S. invasion.

This picture of Iranian ascendance is not only reflected in that country’s own intelligence documents. A massive two-volume study published in 2019 by the U.S. Army War College came to a similar conclusion, stating that “an emboldened and expansionist Iran appears to be the only victor” of the conflict. The study is the most comprehensive look yet at the costs and consequences of the war from a U.S. military perspective. Some of those costs are obvious and well known: Thousands of Americans were killed in combat after an ill-defined mission to find weapons of mass destruction devolved into a counterinsurgency campaign and civil war. But although most of the burden of the war was borne by the relatively small number of Americans who directly took part, the war had broader impacts on American society that continue to be felt today.

“In the conflict’s immediate aftermath, the pendulum of American politics swung to the opposite pole with deep skepticism about foreign interventions.”

“The Iraq War has the potential to be one of the most consequential conflicts in American history. It shattered a long-standing political tradition against pre-emptive wars,” the War College authors wrote. “In the conflict’s immediate aftermath, the pendulum of American politics swung to the opposite pole with deep skepticism about foreign interventions.”

Iraqis themselves have suffered greatly from the war; millions have been killed, wounded, or displaced as a result of the invasion and the subsequent civil conflict. The emergence of the Sunni Islamist extremist group ISIS, which Iran’s intelligence documents discuss at length, was itself the product of the chaos of post-invasion Iraq, including abuses by rogue Iranian-backed militias. In the same 2015 conversation between Boroujerdi and former Prime Minister Abadi, the Iranian intelligence officer opined that “today, the Sunnis find themselves in the worst possible circumstances and have lost their self-confidence,” adding that they “are vagrants, their cities are destroyed, and an unclear future awaits them.”

The miserable condition of Iraqi Sunnis had worried others within Iran’s intelligence establishment, who warned that many Sunnis, reeling from massacres by Iraqi government security forces and militias, had been driven not merely to welcome ISIS, but also other Iranian enemies as well.

“The policies of Iran inside Iraq have given legitimacy for the Americans to return to Iraq,” one Iranian intelligence officer lamented. “People and parties who were fighting against America from the Sunni side now are wishing that not only America, but even Israel could come and rescue them from Iran.”

In the end, ISIS was destroyed as the result of a tacit coalition between the Iraqi government, the United States, Iran, and the Kurdish Peshmerga, which combined to fight the group and regain control of its territories. Today, Iran remains the most powerful outside player inside Iraq. Although it has achieved a goal longed for since the Iran-Iraq War of the 1980s — to wield power in Iraq and incorporate its Shia-majority areas into Iran’s sphere of influence — Iran’s victory has proven, in many ways, an unhappy one.

During protests against government corruption in Iraq in 2019, Iraqis often blamed Iran and its allies, along with the United States, for the parlous state of the country. In 2020, Iranian Gen. Qassim Suleimani, a major architect of Iran’s policy in Iraq whose role is documented at length in the Ministry of Intelligence and Security archive, was assassinated in a U.S. drone strike near Baghdad’s airport, following tit-for-tat attacks between Iranian-backed militias and U.S. troops in the country.

Despite relative peace following the defeat of ISIS, Iraq today remains a powder keg with widespread unemployment, environmental degradation, and poverty that its ruling elites, widely denounced by Iraqis as kleptocrats and puppets of foreign countries, have been unable or unwilling to address. Two decades after the first U.S. troops invaded Iraq, Iran is facing its own challenges with internal instability and the economic impact of a U.S.-led international sanctions campaign that has destroyed its economy.

Yet when it comes to the shadow war between Iran and the United States in Iraq, Iranian elites likely view themselves as having prevailed — at a steep price to themselves, Americans, and Iraqis alike.

The post How Iran Won the U.S. War in Iraq appeared first on The Intercept.

17 Mar 20:44

The News Quiz - 17th February

Tom Roche

Mostly quite funny (esp the opening bits on Nicola Sturgeon resignation and Scotland politics), except that, being the BBC, they threw some libel/shade regarding the old/unfounded claims of Corbyn-Labour antisemitism. (Fortunately NQ ran out of time before they could also libel Assange again, or repeat their recent claim that Putin blew up the Nord Stream pipelines.)

Andy Zaltzman is joined by Zoe Lyons, Angela Barnes, Hugo Rifkind and Nish Kumar. On the agenda this week is Nicola Sturgeon's surprise resignation, Jeremy Corbyn being barred as a Labour candidate and the case of 200,000 stolen Cadbury Creme Eggs.

Hosted and written by Andy Zaltzman with additional material from Alice Fraser, Catherine Brinkworth, Eleanor Morton, Peter Tellouche and Cameron Loxdale.

Producer: Georgia Keating Executive Producer: Pete Strauss Production Co-ordinator: Becky Carewe-Jeffries Sound Editor: Marc Willcox

A BBC Studios Production

17 Mar 18:57

3/17/23: Jon Stewart Pushes Mark Cuban On SVB, Carcinogens Detected in East Palestine, Roger Waters Concert Cancelled For Israel Position, McNally Embarrassing Social Media Flirting, Snapchat Crazy AI bot, Gov Gavin Newsom's Connection To SVB

Tom Roche

all excellent (esp Katie Halper on Germany vs Roger Waters), but the Klippenstein interview (on Newsom, SVB, etc) is repeat from W 15 Mar CP

In this episode we discuss Jon Stewart giving push back to Mark Cuban's takes on SVB bailout in a recent interview, an independent test in East Palestine, Ohio detected deadly carcinogens in the water, a Roger Waters concert was cancelled due to his past statements on Israel, Lieutenant Governor McNally is caught with embarrassing social media posts flirting with a young man, Snapchat rolls out out a new AI to their app that goes haywire, and Ken Klippenstein (@kenklippenstein) from The Intercept joins to talk about Governor Gavin Newsom's personal financial connections to the SVB bailout.


To become a Breaking Points Premium Member and watch/listen to the show uncut and 1 hour early visit: https://breakingpoints.supercast.com/



To listen to Breaking Points as a podcast, check them out on Apple and Spotify



Apple: https://podcasts.apple.com/us/podcast/breaking-points-with-krystal-and-saagar/id1570045623

 


Spotify: https://open.spotify.com/show/4Kbsy61zJSzPxNZZ3PKbXl

 



Merch: https://breaking-points.myshopify.com/

Learn more about your ad choices. Visit megaphone.fm/adchoices

17 Mar 18:05

Hell on Earth - Episode 10: A NEW GOD

Tom Roche

VERY EXCELLENT survey of British history (mostly England, some Scotland and Ireland--sorry no Wales :-) c1649-c1688, and the birth of Western colonial capitalism

Commonwealth, Restoration, Glorious Revolution: we complete England’s cycle of political instability and, with a little help from our old friends the Dutch, birth a new order into the world.


Interactive atlas, bibliography and credits for the series can be found at: hellonearth.chapotraphouse.com


This is the end of the narrative portion of our series, thank you all so much for listening. But fear not: There’s more Hell to come. We have seven (7) bonus episodes coming up featuring interviews with guest experts on specific thematic topics we wanted to dive into more. Release schedule will remain weekly on Wednesdays through mid-April, with Will’s Movie Mindset series debuting right after.



Get bonus content on Patreon

Hosted on Acast. See acast.com/privacy for more information.

17 Mar 18:02

715 - Xi Jinping 3rd Term Celebratory Podcast Global News Report feat. Derek Davison (3/16/23)

Tom Roche

(almost-completely) EXCELLENT and funny global roundup with The 3 plus Derek Davison of the American Prestige and Foreign Exchanges podcasts, including

- PRC makes Iran-Saudi peace, implications for US, Yemen, etc
- Australia to get nuclear subs (what could go wrong?)
- RoK vs Japan
- Ethiopia vs Tigray
- Turkey elections (could "Meatball Recep" lose?)
- Russia vs US and Ukraine, inc
----- Reaper down
----- Bakhmut
----- Wagner
----- status generally of the NATO proxy war (where guest and hosts mostly agree with the deepstate-media quagmire consensus--the glaring analytic fail of this ep)
----- grain exports
- "Kailasa" dupes Newark

Sr. Foreign Correspondent Derek Davison stops by to take us around the world: China brokers mid-east diplomatic deal, Australia gets nuclear subs, porno mercenary recruitment, Russia drops drone, Ukraine exports grain…everything you could need in your Chapo Daily Brief.


Subscribe to Derek’s Foreign Exchanges here: https://fx.substack.com/

And listen to American Prestige here: https://podcasts.apple.com/us/podcast/american-prestige/id1574741668

Get bonus content on Patreon

Hosted on Acast. See acast.com/privacy for more information.

17 Mar 03:09

Doing Scams with my Son-in-Law

by The Späti Boys
Tom Roche

EXCELLENT Ciarán+Uma ep (at least, after 19:00--skip to that point in the audio unless you're /really/ into their bant) on economics and politics in modern/today's Ireland (19:00-37:40) and Cyprus (37:40 to end), with more depth (including history from ~1960-2023) on Cyprus, but more lived/personal experience on Ireland (since Ciarán is Irish, and Uma is a historian of Ireland who has lived there)

Uma and Ciarán talk about Nickelback's Funk Song, Zadar's Snake Museum, Anti-migrant demos in Ireland but most importantly, we try to understand Cyprus.

HOW TO SUPPORT US:
https://www.patreon.com/cornerspaeti

HOW TO REACH US:
Corner Späti https://twitter.com/cornerspaeti
Julia https://twitter.com/KMarxiana
Rob https://twitter.com/leninkraft
Nick https://twitter.com/sternburgpapi
Uma https://twitter.com/umawrnkl
Ciarán https://twitter.com/CiaranDold

Support Corner Späti

16 Mar 22:12

Why 3 US banks collapsed in 1 week: Economist Michael Hudson explains

Tom Roche

VERY EXCELLENT

Economist Michael Hudson analyzes the collapse of Silicon Valley Bank, Silvergate, and Signature Bank, explaining the similarities to the 2008 financial crash. He also addresses the US government bailout (which it isn't calling a bailout), the role of the Federal Reserve and Treasury, the factor of cryptocurrency, and the danger of derivatives. TRANSCRIPT: https://geopoliticaleconomy.com/2023/03/14/us-banks-collapsed-economist-michael-hudson VIDEO: https://youtube.com/watch?v=uvm9qrXhqf8 Check out the playlist for the show that Michael Hudson co-hosts here, Geopolitical Economy Hour: https://youtube.com/playlist?list=PLDAi0NdlN8hMl9DkPLikDDGccibhYHnDP Michael's column "Why the US banking system is breaking up": https://geopoliticaleconomy.com/2023/03/12/michael-hudson-why-the-us-banking-system-is-breaking-up Michael's other article "Why the US bank crisis is not over": https://geopoliticaleconomy.com/2023/03/13/michael-hudson-us-bank-crisis
16 Mar 17:05

Democracy Now! 2023-03-16 Thursday

Tom Roche

generally good (though 2nd {interview, segment after headlines} is as DN-usual pro-Tigray-biased), esp EXCELLENT (but too short) final segment (starts 46:30) with Nadje Al-Ali (@ Brown U) on the 20th anniversary of the 2nd US invasion of Iraq

Democracy Now! 2023-03-16 Thursday

  • Headlines for March 16, 2023
  • Blinken Visits Niger, Home to U.S. Drone Base, as Biden Moves to Counter China & Russia in Africa
  • Will Peace Hold in Tigray? Blinken Visits Ethiopia Four Months After Truce Reached to End War
  • Death, Destruction & Resilience: Nadje Al-Ali on the 20th Anniversary of U.S. Invasion of Iraq

Download this show

16 Mar 00:17

7. They Call Me Juice

Tom Roche

great short listen (provided you can fast-forward through the ads)

Another mystery man, nicknamed Red, comes to town. He’s Mickey’s so-called “outlaw biker buddy.” Red takes activist Bryce Shelby for a drive to scope out the home of Colorado’s attorney general as part of a budding assassination plot. But Red lets something slip that makes Bryce suspicious.

See omnystudio.com/listener for privacy information.

15 Mar 22:15

#152 The Reading Wars Are Older Than You Think

Tom Roche

interesting piece, good listen, but ... they never come right out and say what exactly /are/ robust empirical results in "reading science" aka "what we know" about the pedagogy of reading (and writing)

Two decades ago, phonics fever swept the land as George W. Bush made “scientifically-based reading instruction” a centerpiece of his education agenda. But despite its scale and huge price tag, Bush’s Reading First initiative has largely been forgotten. Have You Heard revisits the Bush-led effort to transform reading instruction, learning a familiar lesson along the way: history can’t teach us anything if no one remembers it. The financial support of listeners like you keeps this podcast going. Subscribe on Patreon: https://www.patreon.com/HaveYouHeardPodcast or donate on PayPal: https://www.paypal.me/haveyouheardpodcast
15 Mar 20:25

Grayzone Radio - Tuesday, March 14, 2023

Tom Roche

2 halves, both VERY EXCELLENT

Grayzone Radio with Max Blumenthal excerpts investigative reports from The Grayzone podcast.
15 Mar 18:30

3/15/23: Russian Jet Shoots Down American Drone, Desantis Speaks On Ukraine, Tucker Scoffs Trump Foreign Policy, Is SVB Like 2008, Biden Approves Fossil Fuel Drilling, ChatGPT4.0, Women in Workforce, Ebola Outbreak to Covid Lab Leak

Tom Roche

yet another VERY EXCELLENT CounterPoints from Grim and Jashinsky

Ryan and Emily discuss a Russian jet shooting down an American drone, Desantis gives statements on Ukraine similar to Trump but receives more backlash, Tucker ridicules what Trump got done during his term and calls him "autistic", Is SVB the sign of another 2008 like collapse?, Biden approves a controversial fossil fuel drilling, ChatGPT 4.0 is unveiled, Emily looks at Women in the workforce, and Ryan looks into the origins of Ebola and how that outbreak's response may have effected our response to the possible Covid lab leak.

To become a Breaking Points Premium Member and watch/listen to the show uncut and 1 hour early visit: https://breakingpoints.supercast.com/



To listen to Breaking Points as a podcast, check them out on Apple and Spotify



Apple: https://podcasts.apple.com/us/podcast/breaking-points-with-krystal-and-saagar/id1570045623

 


Spotify: https://open.spotify.com/show/4Kbsy61zJSzPxNZZ3PKbXl

 



Merch: https://breaking-points.myshopify.com/

Learn more about your ad choices. Visit megaphone.fm/adchoices

15 Mar 17:41

African leaders, collective west is not the only game in town

Tom Roche

excellent on the Geingob-Lammert interview (presumably in Windhoek) and Macron-Tshisekedi interview (in Kinshasa)

African leaders, collective west is not the only game in town
15 Mar 17:01

Democracy Now! 2023-03-15 Wednesday

Tom Roche

EXCELLENT Scahill interview (13:27-37:45) on the US proxy war with Russia, drones in RUW, and the Nord Stream bombing whodunit (which Hersh obviously has correctly attributed, hence the US deepstate now seeks to obfuscate via its NYT and German sockpuppets)

Democracy Now! 2023-03-15 Wednesday

  • Headlines for March 15, 2023
  • Jeremy Scahill on Growing Proxy War Between U.S. and Russia & Downing of U.S. Drone in Black Sea
  • The Nord Stream Bombing: Jeremy Scahill on Why U.S. Remains Most Likely Culprit in Pipeline Sabotage
  • "Catastrophic": Trump-Appointed Judge in Texas May Restrict Abortion Pill Mifepristone Nationwide
  • Mexico's Missing: 100,000+ Cases Unsolved as Leaked Military Docs Shed New Light on Ayotzinapa 43

Download this show

15 Mar 16:58

Democracy Now! 2023-03-14 Tuesday

Tom Roche

better-than-recent-usual DN, esp interview segment on US banking with Mehrsa Baradaran (UC Irvine) and David Sirota (The Lever, et al)

Democracy Now! 2023-03-14 Tuesday

  • Headlines for March 14, 2023
  • How Silicon Valley Bank & Signature Bank Lobbied to Weaken Regulations That Could Have Prevented Collapse
  • Autopsy Suggests "Cop City" Protester Sitting Cross-Legged, Hands Up, When Shot 14 Times by Police

Download this show

14 Mar 17:29

714 - McNally Jackin’ (3/13/23)

Tom Roche

VERY FUNNY, bant+politics, and the end of a Dreher-a

We’ve got the Silicon Valley Bank collapse, saber rattling over a war against Mexican cartels, plus we meet a delightful new character out of the great state of Tennessee, wish a bittersweet farewell to an old friend, and FINALLY take those damn smoke detectors down a peg or two. All that and a side of meat salad in today’s ep. Get bonus content on Patreon

Hosted on Acast. See acast.com/privacy for more information.

13 Mar 22:40

3/13/23: Massive SVB Bailout, Crypto Bank Collapses, Execs Sold Millions Before Collapse, JD Vance Rips Republicans on Norfolk, Pence Blasts Trump and Tucker, Desantis Blames Wokeness on Bank Collapse, Fauci Freaks Over Prosecution Calls

Tom Roche

VERY EXCELLENT--even by Breaking Points standards--at least for the 1st {53 min, ~2/3} of this episode:

+ last weekend's US bank bailouts, esp Silicon Valley Bank (SVB) and the "crypto banks" Signature and Silvergate. Much more about SVB, but especially ...
+ ... how US corporate elites (including 'tech libertarians') immediately demand, and Corporate Party elites snap-to to supply, "socialization of [their] losses" after years of privatizing their gains, esp thanks to
+ ... US Corporate Party continuing--even after the GFC--to deregulate US banking, including the egregious story of "America's gay hero" Barney Frank (of Dodd-Frank fame) shilling for (after accepting a seat on the board of, and massive compensation from) Signature Bank.
+ how the failed banks shovelled millions in stock and bonuses out the door before regulators shut them down
+ especially excellent interview with Matthew Zeitlin (of GridNews) on how now US regulators are treating ~all US banks as "Too Big to Fail," and massively subsidizing those banks (and the wealthiest depositors) by insuring ~all deposits (not just those under 250 k$) and allowing banks to inflate the value of their assets.

After 53:19, it's still listenable, just nothing you haven't heard many times before:

- Republicans (esp JD Vance) supporting (at least rhetorically) increased rail regulation, esp Norfolk Southern
- Mike Pence finally (and in the cringiest way possible) blames Trump for Jan6 (though not by name)
- KB anti-antiwokeness radar, esp targeting Meatball Ron DeSantis' blaming SVB collapse on ... wait for it ... wokeness
- SE radar on the newly-retired (from US Federal government, but /not/ from appearing in USCFM interviews) Fauci spinning his "evolution" on lableak and gain-of-function (to rapturous applause from the BlueAnons)

Krystal and Saagar discuss the massive SVB bailout propping up the banking sector, Romney and Mark Cuban demand bailouts, Crypto Bank Signature collapses amid tech fallout, SVB Executives sold millions in stock and took bonuses before collapse, Matthew Zeitlin (@MattZeitlin) from the GridNews joins us to talk about how all banks are being considered "Too Big to Fail", JD Vance rips Republicans opposing Norfolk Southern Regulation, Pence blasts Trump and Tucker for January 6th, and Desantis blames Wokeness for Bank collapse, and Fauci is flustered when asked about calls for his prosecution.



To become a Breaking Points Premium Member and watch/listen to the show uncut and 1 hour early visit: https://breakingpoints.supercast.com/



To listen to Breaking Points as a podcast, check them out on Apple and Spotify



Apple: https://podcasts.apple.com/us/podcast/breaking-points-with-krystal-and-saagar/id1570045623

 


Spotify: https://open.spotify.com/show/4Kbsy61zJSzPxNZZ3PKbXl

 



Merch: https://breaking-points.myshopify.com/

Learn more about your ad choices. Visit megaphone.fm/adchoices

13 Mar 22:17

Hooray, We Now Have Medicare for All (Bank Deposits)!

by Jon Schwarz
Tom Roche

Jon Schwarz EXCELLENT as usual

Customers in line outside Silicon Valley Bank headquarters in Santa Clara, California, US, on Monday, March 13, 2023.

Customers in line outside the Silicon Valley Bank headquarters in Santa Clara, Calif., on March 13, 2023.

Photo: David Paul Morris/Getty Images

For everyone who’s fought and bled for years to get Medicare for All in the United States, I’ve got some great news: The government just created it on Sunday!

Yes, this is Medicare for All Bank Deposits, rather than Medicare for All People. But if we think this through, we’ll see that both these things are great ideas and make sense for the same reasons — and there’s no reason that if we have one, we can’t have the other.

First of all, it’s important to understand what happened yesterday. Banks are intrinsically vulnerable to runs. They accept deposits from regular people and businesses, which is good, so we don’t have to keep sacks full of cash in our closet and pay armed men to guard them.

The problem is that we want to be able to come get our money out of the bank at any time. However, banks don’t keep sacks of all our cash in their vaults waiting for us. They loan deposits out and make other investments with them, leaving just a fraction of their deposits available to be withdrawn at any time. In the past, in the U.S., this meant that if rumors got going that a bank was insolvent, it didn’t actually matter whether or not the bank was healthy or not. Everyone would show up and try to get their money out first, creating a self-fulfilling prophecy: The very fact that people were scared a bank was insolvent could make it insolvent. (In fact, Silicon Valley Bank, whose failure led to Sunday’s swift government action, may have been accidentally destroyed by its own clients telling each other scary stories in a group chat.)

As a company called American Deposit Management cheerily informs us on its website, “The history of bank failures in the U.S. begins just over 40 years after the Declaration of Independence was signed.” From then until the Great Depression, America saw constant, catastrophic bank panics that destroyed individual fortunes and the economy overall.

Until the beginning of Franklin D. Roosevelt’s presidency, Wall Street had been able to fend off most democratic oversight. Partly, they did this by overtly arguing that the government would stifle crucial financial innovations and partly by covertly engaging in every form of corruption imaginable. But by 1933, there was enough popular anger at a recent cascade of bank runs and failures to overwhelm the industry’s power. The government was forced to do something about it, and part of the something was the creation of Federal Deposit Insurance Corporation.

One of the main things the FDIC has done ever since is insure deposits, mostly savings and checking accounts, up to a certain limit. Originally, the limit was the equivalent of about $50,000 today. The idea was that this would cover most Americans, and people with more money were big boys and girls able to take care of themselves. It was last raised in 2008 to $250,000. Crucially, the funding for the insurance comes from an assessment on the banks themselves.

But the insurance created a new problem: With deposits insured by the government, depositors would naturally be tempted to place their money with banks making risky investments that promised high returns, knowing that if the bank lost their money, the government would step in and make them whole. Roosevelt was concerned about this at the time, telling reporters off the record, “We do not wish to make the United States Government liable for the mistakes and errors of individual banks, and put a premium on unsound banking in the future.” The only solution was what banks hated most: regulation, government oversight of what they were doing with their depositors’ money.

This was the basic background to what happened last week, when Silicon Valley Bank, or SVB, previously the 16th-largest bank in America and the favorite bank of the valley’s venture capitalists, experienced a bank run. This was alarming to many of its largest depositors, given that they apparently have the financial sophistication of a chicken. For instance, Roku revealed in a filing with the Securities and Exchange Commission that it was holding “approximately $487 million” at SVB. This suggests that $486,750,000 of Roku’s money was uninsured — and as the filing said, “the Company does not know to what extent the Company will be able to recover its cash on deposit at SVB.”

It is not, in fact, impossible for corporations to manage their money safely. Indeed, some do it every day. But apparently, it can be a challenge for chickens, which have brains the size of two shelled peanuts.

The mass financial incompetence by SVB’s depositors set off shrieking and caterwauling from the valley’s venture capitalists and angel investors that could be heard on Neptune:


On the one hand, this is hilarious. Silicon Valley’s libertarianism is apparently based on one clear, firm principle: It’s illegal for them and their friends to lose money.

But on the other hand, the financial system is so complex that literally no one on Earth can say for sure how it will behave under stress. Again, remember that banks can experience runs not because they’re insolvent, but because people come to believe they are or just that other people will believe that they are, perhaps because someone prominent is SCREAMING AT THEM IN ALL CAPS TO PANIC.

And society at large has a genuine interest in preventing bank runs. So the Treasury Department, the Federal Reserve, and the FDIC jointly announced on Sunday that the government would guarantee all deposits at SVB (and another big bank called Signature), no matter the size. In other words, it turns out Roku will be getting back all of its $487 million.

This might be the right call overall. But then again, it’s gratingly unfair. SVB’s big depositors are suddenly getting financial backing from the government — i.e., everyone else in America.

Most importantly, the entire financial system now understands that, if push comes to shove, the government will guarantee all deposits of any amount. The $250,000 limit turns out to be no limit at all.

The Treasury Department doesn’t want to admit this, of course, but they also can’t deny it. So when Washington Post reporter Jeff Stein asked about it yesterday, a Treasury official responded, “Well, you see, mmfrrffm rmmm blrf.”


But whatever cloud of words is emitted by the government, depositors will be incentivized to put their money in banks taking wild swings, knowing that if there’s an upside, they’ll pocket some of it, while if things go wrong, the government will step in.

Now that this Rubicon has been crossed, there’s only one rational path forward: If the government is going to guarantee all bank deposits, then much of the banking industry is parasitical and should be euthanized.

The logic here is largely the same as with health care, where logic likewise inexorably points to universal insurance funded and supervised by the government.

Individuals have a strong interest in both their health costs and their basic banking deposits being covered by insurance. The conservative perspective is that everyone should buy private insurance based on a constant, never-ending series of Monte Carlo simulations about what your individual future holds.

But this is impossible for human beings. The future is unknowable. You may live your entire life with few health care costs, or you might suddenly face $1 million in costs next year. Your bank might putter along indefinitely, or it might explode tomorrow.

Likewise, society has a powerful interest in everyone being covered by these kinds of insurance. In the case of SVB, we don’t want the depositors to go without insurance but then be able to blackmail everyone else into bailing them out because we’re scared their miscalculations will infect the rest of the system. Analogously, we don’t want people, especially powerful ones, to avoid health insurance and then demand we pay for their treatment if they get a dangerous infectious disease.

In both cases, universal insurance is also necessary for more subtle reasons. Everyone knows that both the U.S. health insurance system and the banking system are unbearably unjust. If they’re not dealt with in an equitable way, the anger Americans rightfully feel about both will continue to be harvested by reactionary politicians.

The clear answer for health care is Medicare for All. With banking, it may plausibly be something like Banking for All — i.e., the Federal Reserve giving every person and corporation an account that no bank run could ever take away. In both cases, the solution is simple and obvious, with the only obstacle being the extraordinary power of wealthy corporations that serve no purpose whatsoever.

The post Hooray, We Now Have Medicare for All (Bank Deposits)! appeared first on The Intercept.

13 Mar 21:55

Laura Tingle's Canberra

Tom Roche

excellent-as-usual weekly review of Australian politics, but this week, even better

What the about-to-be-announced AUKUS plan will mean for us strategically, and how it will play domestically. Plus, the final wrap on the Robodebt hearings, which have raised big questions about the public service.  Guest: Laura Tingle, Chief political correspondent, 7.30, ABC
13 Mar 16:13

James Dyer: Editing org files on an Android device - Part 1

by James Dyer
Tom Roche

pullquote:
> Now that [one can run [emacs on Android](https://www.emacswiki.org/emacs/EmacsOnAndroid), here's] an emacs workflow [syncing with [syncthing](https://syncthing.net/)] between [my linux laptop, my Android v13 tablet, and my Android v9 phone].

Dyer notes later that
- /(minor)/ he also has [KDE Connect](https://kdeconnect.kde.org/) installed on all of above, but he suggests it's mostly just convenience for this usecase.
- /(major)/ pullquote: 'for the moment android emacs doesn’t have the ability to download packages from melpa or elpa. Not too much of a problem for me though as my default config is tending towards vanilla anyway so for the moment I decided to create a purely android version of my .emacs config by stripping out everything I didn’t think I needed with an eye on creating a generic version across not only android but windows too.'
- while one can currently do Lisp like
> (when (string-equal system-type "windows-nt")
he does not currently know (/TODO:/ find!) of an equivalent OS-detector for Android

process summary:
0. on Android:
0.1. install F-Droid
0.2. install emacs from F-Droid

1. sync [emacs configfile](https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html) (aka /.emacs/) from laptop to Androids:
1.1. syncthing .emacs
1.2. symlink .emacs from syncthing dir to F-droid-emacs dir
1.3. start emacs on Android, deal with errors

2. next steps (for promised part 2 in series):
- set storage/file-access permissions for Android emacs
- find an on-screen keyboard

Now that there is a build for emacs on Android I thought I would try and develop an emacs workflow between my Galaxy Note 8 / Galaxy Tab S7+ and my linux laptop.

At the moment I am using Markor on my phone and this serves my needs adequately but of course I am missing that org file support.

My current process involves syncthing to push my org files around my laptop / phone and tablet. I also push other things that are regularly backed up and this does include my .emacs config file.

So the relevant files are already present on my device the next thing to do is to install emacs from F-Droid and grant emacs file permissions.

My phone is running Android version 9 and my tablet version 13 so the method to get permissions set up for Emacs was slightly different in each case.

On my phone from the settings I selected Apps -> top right menu (App permissions) -> Storage -> Emacs to On

On my tablet from the settings I selected Apps -> top right menu (Special access) -> All files access -> Emacs to On

Next up is to set up my configuration file, in this case I am going to create a symbolic link using dired. First of course is to run up emacs and then navigate to my syncthing’d .emacs file which in my case is in the following location:

/storage/emulated/0/DCIM/Linux

The android emacs menu bar is quite responsive and the menu appears in a nice large touch friendly font so I can just File -> Open Directory… at which point an on screen keyboard pops up and I can input the path.

Note : Something I discovered early on was that because I have KDE Connect installed across all my devices and Clipboard sync is turned on it means that the clipboard is shared between devices. This means that anything that is copied from within emacs on my laptop appears on my phone or tablet, so I could just type out the path on my laptop, copy it to the kill ring and it appears on the Samsung Keyboard clipboard field ready to paste into emacs!

Now the path has been input dired shows the directory containing all my files including my .emacs file. Now I select the line containing the file (yes, using my finger!!) then from the top menu : Operate -> Simlink to… and input the following:

/data/data/org.gnu.emacs/files/.emacs

Now restart emacs or maybe Emacs-Lisp -> Evaluate Buffer

When I first attempted this my default .emacs gave a prodigious number of errors and I realised that for the moment android emacs doesn’t have the ability to download packages from melpa or elpa. Not too much of a problem for me though as my default config is tending towards vanilla anyway so for the moment I decided to create a purely android version of my .emacs config by stripping out everything I didn’t think I needed with an eye on creating a generic version across not only android but windows too. Currently I have a few (when (string-equal system-type "windows-nt") and for android I just need something similar but with android as the defining string.

Technically just setting the storage permissions for emacs on my device would have been enough to open an org file and edit it, but now I have a symbolic link to my .emacs config and it is synched to all my devices it means I now have the ability to modify it anywhere and although I currently have an android specific version it won’t be too long before I have a single generic config for all my devices / operating systems.

The next step will be to find an on-screen keyboard to fit a good emacs editing workflow - a sneak peek below of Keyboard Designer but that will be for part 2!

13 Mar 02:28

Brett Cannon: How virtual environments work

Tom Roche

good/short explainer for virtual environments esp on Linuxy platforms, and esp interacting with VS Code

After needing to do a deep dive on the venv module (which I will explain later in this blog post as to why), I thought I would explain how virtual environments work to help demystify them.

Why do virtual environments exist?

Back in my the day, there was no concept of environments in Python: all you had was your Python installation and the current directory. That meant when you installed something you either installed it globally into your Python interpreter or you just dumped it into the current directory. Both of these approaches had their drawbacks.

Installing globally meant you didn&apost have any isolation between your projects. This led to issues like version conflicts between what one of your projects might need compared to another one. It also meant you had no idea what requirements your project actually had since you had no way of actually testing your assumptions of what you needed. This was an issue if you needed to share you code with someone else as you didn&apost have a way to test that you weren&apost accidentally wrong about what your dependencies were.

Installing into your local directory didn&apost isolate your installs based on Python version or interpreter version (or even interpreter build type, back when you had to compile your extension modules differently for debug and release builds of Python). So while you could install everything into the same directory as your own code (which you did, and thus didn&apost use src directory layouts for simplicity), there wasn&apost a way to install different wheels for each Python interpreter you had on your machine so you could have multiple environments per project (I&aposm glossing over the fact that back in my the day you also didn&apost have wheels or editable installs).

Enter virtual environments. Suddenly you had a way to install projects as a group that was tied to a specific Python interpreter. That got us the isolation/separation of only installing things you depend on (and being able to verify that through your testing), as well has having as many environments as you want to go with your projects (e.g. an environment for each version of Python that you support). So all sorts of wins! It&aposs an important feature to have while doing development (which is why it can be rather frustrating for users when Python distributors leave venv out).

How do virtual environments work?

💡
Virtual environments are different than conda environments (in my opinion; some people disagree with me on this view). The key difference is that conda environments allow projects to install arbitrary shell scripts which are run when you activate a conda environment (which is done implicitly when you use conda run). This is why you are always expected to activate a conda environment, as some conda packages require those shell scripts to be run. I won&apost be covering conda environments in this post.

Their structure

There are two parts to virtual environments: their directories and their configuration file. As a running example, I&aposm going to assume you ran the command py -m venv --without-pip .venv in some directory on a Unix-based OS (you can substitute py with whatever Python interpreter you want, including the Python Launcher for Unix).

For simplicity I&aposm going to focus on the Unix case and not cover Windows in depth.

A virtual environment has 3 directories and potentially a symlink in the virtual environment directory (i.e. within .venv):

  1. bin ( Scripts on Windows)
  2. include ( Include on Windows)
  3. lib/pythonX.Y/site-packages where X.Y is the Python version (Lib/site-packages on Windows)
  4. lib64 symlinked to lib if you&aposre using a 64-bit build of Python that&aposs on a POSIX-based OS that&aposs not macOS

The Python executable for the virtual environment ends up in bin as various symlinks back to the original interpreter (e.g. .venv/bin/python is a symlink; Windows has a different story). The site-packages directory is where projects get installed into the virtual environment (including pip if you choose to have it installed into the virtual environment). The include directory is for any header files that might get installed for some reason from a project. The lib64 symlink is for consistency on those Unix OSs where they have such directories.

The configuration file is pyvenv.cfg and it lives at the top of your virtual environment directory (e.v. .venv/pyvenv.cfg). As of Python 3.11, it contains a few entries:

  1. home (the directory where the executable used to create the virtual environment lives; os.path.dirname(sys._base_executable))
  2. include-system-packages (should the global site-packages be included, effectively turning off isolation?)
  3. version (the Python version down to the micro version, but not with the release level, e.g. 3.12.0, but not 3.12.0a6)
  4. executable (the executable used to create the virtual environment; os.path.realpath(sys._base_executable))
  5. command (the CLI command that could have recreated the virtual environment)

On my machine, the pyvenv.cfg contents are:

home = /home/linuxbrew/.linuxbrew/opt/python@3.11/bin
include-system-site-packages = false
version = 3.11.2
executable = /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.2_1/bin/python3.11
command = /home/linuxbrew/.linuxbrew/opt/python@3.11/bin/python3.11 -m venv --without-pip /tmp/.venv
Example pyvenv.cfg

One interesting thing to note is pyvenv.cfg is not a valid INI file according to the configparser module due to lacking any sections. To read fields in the file you are expected to use line.partition("=") and to strip the resulting key and value.

And that&aposs all there is to a virtual environment! When you don&apost install pip they are extremely fast to create: 3 files, a symlink, and a single file. And they are simple enough you can probably create one manually.

One point I would like to make is how virtual environments are designed to be disposable and not relocatable. Because of their simplicity, virtual environments are viewed as something you can throw away and recreate quickly (if it takes your OS a long time to create 3 directories, a symlink, and a file consisting of 292 bytes like on my machine, you have bigger problems to worry about than virtual environment relocation 😉). Unfortunately, people tend to conflate environment creation with package installation, when they are in fact two separate things. What projects you choose to install with which installer is actually separate from environment creation and probably influences your "getting started" time the most.

How Python uses a virtual environment

During start-up, Python automatically calls the site.main() function (unless you specify the -S flag). That function calls site.venv() which handles setting up your Python executable to use the virtual environment appropriately. Specifically, the site module:

  1. Looks for pyvenv.cfg in either the same or parent directory as the running executable (which is not resolved, so the location of the symlink is used)
  2. Looks for include-system-site-packages in pyvenv.cfg to decide whether the system site-packages ends up on sys.path
  3. Sets sys._home if home is found in pyvenv.cfg (sys._home is used by sysconfig)

That&aposs it! It&aposs a surprisingly simple mechanism for what it accomplishes.

One thing to notice here about how all of this works is virtual environment activation is optional. Because the site module works off of the symlink to the executable in the virtual environment to resolve everything, activation is just a convenience. Honestly, all the activation scripts do are:

  1. Puts the bin/ (or Scripts/) directory at the front of your PATH environment variable
  2. Sets VIRTUAL_ENV to the directory containing your virtual environment
  3. Tweaks your shell prompt to let you know your PATH has been changed
  4. Registers a deactivate shell function which undoes the other steps

In the end, whether you type python after activation or .venv/bin/python makes no difference to Python. Some tooling like the Python extension for VS Code or the Python Launcher for Unix may check for VIRTUAL_ENV to pick up on your intent to use a virtual environment, but it doesn&apost influence Python itself.

Introducing microvenv

In the Python extension for VS Code, we have an issue where Python beginners end up on Debian or a Debian-based distro like Ubuntu and want to create a virtual environment. Due to Debian removing venv from the default Python install and beginners not realizing there was more to install than python3, they often end up failing at creating a virtual environment  (at least initially as you can install python3-venv separately; in the next version of Debian there will be a python3-full package you can install which will include venv and pip, but it will probably take a while for all the instructions online to be updated to suggest that over python3). We believe the lack of venv is a problem as beginners should be using environments, but asking them to install yet more software can be a barrier to getting started (I&aposm also ignoring the fact pip isn&apost installed by default on Debian either which also complicates the getting started experience for beginners).

But venv is not shipped as a separate part of Python&aposs stdlib, so we can&apost simply install it from PyPI somehow or easily ship it as part of the Python extension to work around this. Since venv is in the stdlib, it&aposs developed along with the version of Python it ships with, so there&aposs no single copy which is fully compatible with all maintained versions of Python (e.g. Python 3.11 added support to use sysconfig to get the directories to create for a virtual environment, various fields in pyvenv.cfg have been added over time, use new language features may be used, etc.). While we could ship a copy of venv for every maintained version of Python, we potentially would have to ship for every micro release to guarantee we always had a working copy, and that&aposs a lot of upstream tracking to do. And even if we only shipped copies from minor release of Python, we would still have to track every micro release in case a bug in venv was fixed.

Hence I have created microvenv. It is a project which provides a single .py file which you use to create a minimal virtual environment. You can either execute it as a script or call its create() function that is analogous to venv.create(). It&aposs also compatible with all maintained versions of Python. As I (hopefully) showed above, creating a virtual environment is actually straight-forward, so I was able to replicate the necessary bits in less than 100 lines of Python code (specifically 87 lines in the 2023.1.1 release). That actually makes it small enough to pass in via python -c, which means it could be embedded in a binary as a string constant and passed as an argument when executing a Python executable as a subprocess if you wanted to (directly executing microvenv.py works). Hopefully that means a tool could guarantee it can always construct a virtual environment somehow.

To keep microvenv simple, small, and maintainable, it does not contain any activation scripts. I personally don&apost want to be a shell script expert for multiple shells, nor do I want to track the upstream activation scripts (and they do change in case you were thinking "it shouldn&apost be that hard to track"). Also, in VS Code we are actually working towards implicitly activating virtual environments by updating your environment variables directly instead of executing any activation shell scripts, so the shell scripts aren&apost needed for our use case (we are actively moving away from using any activation scripts where we can as we have run into race condition problems with them when sending the command to the shell; thank goodness of conda run, but we also know people still want an activated terminal).

I&aposm also skipping Windows support because we have found the lack of venv to be a unique problem for Linux in general, and Debian-based distros specifically.

I honestly don&apost expect anyone except tool providers to use microvenv, but since it could be useful to others beyond VS Code, I decided it was worth releasing on its own. I also expect anyone using the project to only use it as a fallback when venv is not available (which you can deduce by running py -c "from importlib.util import find_spec; print(find_spec(&aposvenv&apos) is not None)"). And before anyone asks why we don&apost just use virtualenv, its wheel is 8.7MB compared to microvenv at 3.9KB; 0.05% the size, or 2175x smaller. Granted, a good chunk of what makes up virtualenv&aposs wheel is probably from shipping pip and setuptools in the wheel for fast installation of those projects after virtual environment creation, but we also acknowledge our need for a small, portable, single-file virtual environment creator is rather niche and something virtualenv currently doesn&apost support (for good reason).

Our plan for the Python extension for VS Code is to use microvenv as a fallback mechanism for our Python: Create Environment command (FYI we also plan to bootstrap pip via its pip.pyz file from bootstrap.pypa.io by downloading it on-demand, which is luckily less than 2MB). That way we can start suggesting to users in various UX flows to create and use an environment when one isn&apost already being used (as appropriate, of course). We want beginners to learn about environments if they don&apost already know about them and also remind experienced users when they may have accidentally forgotten to create an environment for their workspace. That way people get the benefit of (virtual) environments with as little friction as possible.