Slide 1

Slide 1 text

Python for Social Good Dražen Lučanin @metakermit

Slide 2

Slide 2 text

• Let’s take a step back… • from startups, VR, chatbots, blokchains, Ubers for X… • take a broader look at the world and its problems • What does society really need at this point? • … and can we do it with Python? What’s this about?

Slide 3

Slide 3 text

⚡Calls for action (CFA) • Talk sprinkled with ⚡calls for action • Lots of link – available on this awesome list • https://github.com/metakermit/awesome-python-for- social-good • The slides will be there and on Twitter

Slide 4

Slide 4 text

• PhD in computer science at TU Wien • Analysing energy efficiency of data centers • Punk Rock Dev – since 2015 • Developing apps with a kick! • https://punkrockdev.com/ • Music, drawing & some political activism here and there Who am I?

Slide 5

Slide 5 text

So, Python for Social Good • Modern society has many problems • (and we have limited time) • 7 big topics – lately in the spotlight & technology-related

Slide 6

Slide 6 text

The Open Systems Interconnection model (OSI model) of social good Volunteering Politics Democracy Free Press Privacy ☎ Internet Environment

Slide 7

Slide 7 text

Environment

Slide 8

Slide 8 text

https://xkcd.com/1732/ 4°C in 22,000 years ~1°C in 100 years

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

• Trump’s admin. deleting public climate change data • Public data archivers • https://envirodatagov.org/ • http://eotarchive.cdlib.org/2016.html • http://www.cdlib.org/ • http://www.ppehlab.org/datarefuge • https://climatemirror.org/ Global Warming Data

Slide 11

Slide 11 text

• ⚡Call for action (CFA) • Python scraping • Requests + BeautifulSoup • https://scrapy.org/ • https://scrapinghub.com/ Global Warming Data

Slide 12

Slide 12 text

Mining gold not popular, but… ⛏

Slide 13

Slide 13 text

• Is there a way to make mining computation more green? • Supply-demand balancing • Negative energy prices • Helping balance out volatility of e.g. wind turbines • Can a proof of environment friendliness be encoded? • A blockchain in less than 50 lines of Python • …and green? ♻ Blockchain mining ⚡CFA

Slide 14

Slide 14 text

☎ Internet

Slide 15

Slide 15 text

• Synonym for communication ☎ Internet

Slide 16

Slide 16 text

• The "Mirai" botnet • > 500,000 compromised routers, refrigerators, TVs, DVRs, baby monitors, thermostats, and webcams • Took down DynDNS, causing an Internet blackout • Memcached attack • 88,000 misconfigured memcached servers on the Internet • 50k x amplification – a 203 byte request causes a 100 MB response • The largest DDoS attack ever! 1.3 Tbps Botnet DDoS attacks

Slide 17

Slide 17 text

https://xkcd.com/1966/

Slide 18

Slide 18 text

• Heartbleed • Shellshock • Meltdown, Spectre, oh my! Endless vulnerabilities

Slide 19

Slide 19 text

• Make sure your servers are secure • Don’t expose Memcached to the Internet! • Keep your software up to date – https://github.com/punkrockdev/server • Unattended OS upgrades • Using ansible – a Python-based server management tool • Metasploit (PyMetasploit) – tools for pen-testing your sites • Learn the basics of internet security • Use HTTPS – Let’s Encrypt • Hash passwords with scrypt • Don’t roll your own crypto – https://cryptography.io/ for Python ☎ Internet ⚡CFA

Slide 20

Slide 20 text

• Don’t let your users behave insecurely • 86% of passwords are terrible (123456, password, …) • Appear in leaked password datasets • Pwned Passwords V2 • Elegant & safe API check • You send a part of the hashed password and get back a searchable dataset of “pwned passwords” • You can self-host the service too ☎ Internet ⚡CFA

Slide 21

Slide 21 text

Privacy

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

• Snowden reveals government surveillance programs (June 2013) • Privacy-protecting solutions are hard to fund • I’ve tried with https://github.com/cloudfleet Privacy

Slide 24

Slide 24 text

• Great software for encrypted communication • Signal – peer-to-peer encrypted chat app • Mailpile – web-based email client w/ PGP in Python • Both are open source and could use help Privacy ⚡CFA

Slide 25

Slide 25 text

Free Press

Slide 26

Slide 26 text

• Fake news • Attacks on journalists Free Press

Slide 27

Slide 27 text

• Help fact-checking sites • https://www.snopes.com/ • http://www.politifact.com/ • http://fivethirtyeight.com/ • Start something like this in your own community • Be wary of the possibility of tampering with information • TensorFlow detect fake news – Jupyter notebooks & datasets on Kaggle • https://www.kaggle.com/c/fake-news • https://www.kaggle.com/datasets?sortBy=relevance&search=fake+news Free Press ⚡CFA

Slide 28

Slide 28 text

Democracy

Slide 29

Slide 29 text

• Facebook + Cambridge Analytics + trolls + fake news = impact elections • Voting machines in Germany hacked • Outright "cyber warfare” – attack on Estonia’s systems Democracy

Slide 30

Slide 30 text

• Help find software vulnerabilities • Identify trolls / bots on social networks • TensorFlow • https://www.kaggle.com/vikasg/russian-troll-tweets Democracy ⚡CFA

Slide 31

Slide 31 text

Politics

Slide 32

Slide 32 text

• Get involved! • A world where decisions aren’t based on facts takes us back to the dark ages • Science and humanism must prevail • Critical thinking and evidence (rationalism and empiricism) > dogma or superstition • “Ideological” divisions are crude • Debate is good, but we must ground it in facts • Daniel Kahneman – "Thinking, Fast and Slow” • Human biases • Think slow! Analyse available data Politics

Slide 33

Slide 33 text

• Analyse the data • Open data • Scrape it! • I’ve done this for the city budget spending data in Zagreb – https://github.com/za-grad/otvoreni-akti • Code for America / Europe / … • Civic hacktivism • Help your town make a better service for something Politics ⚡CFA

Slide 34

Slide 34 text

• Help politicians you support • Map candidates’ lists – http://liste.zagrebjenas.hr/ • Donations – https://zagrebjenas.herokuapp.com/ Politics ⚡CFA

Slide 35

Slide 35 text

• Subvert politicians you don’t support • Trump2Cash (@Trump2Cash) • A stock trading bot powered by Trump tweets • Open source in Python – https://github.com/maxbbraun/trump2cash • Twitter streaming API • Google Cloud NLP API • Wikidata company data • TradeKing stock API Politics ⚡CFA

Slide 36

Slide 36 text

• Make money • Donate it • American Civil Liberties Union • the Natural Resources Defense Council, an • Planned Parenthood Politics ⚡CFA

Slide 37

Slide 37 text

• Personally, I have a very particular set of skills, skills that allow me to have some fun with Mr. Trump’s emotional incontinence and maybe effect positive change along the way. – Max Braun Politics ⚡CFA

Slide 38

Slide 38 text

Volunteering

Slide 39

Slide 39 text

• Helping the economically disadvantaged • Helping the misrepresented • Other forms of helping your community Volunteering

Slide 40

Slide 40 text

• Both local & remote • http://www.refugeescode.at/ • https://www.freecodecamp.org/nonprofits/ • Help teach others • Python is the No. 1 language in education Volunteering ⚡CFA

Slide 41

Slide 41 text

We need you

Slide 42

Slide 42 text

May the 4th be with you!

Slide 43

Slide 43 text

Thank you! Dražen Lučanin @metakermit https://github.com/metakermit/awesome-python-for-social-good