Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python for Social Good

Python for Social Good

Dražen Lučanin

May 04, 2018
Tweet

More Decks by Dražen Lučanin

Other Decks in Technology

Transcript

  1. • 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?
  2. ⚡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
  3. • 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?
  4. So, Python for Social Good • Modern society has many

    problems • (and we have limited time) • 7 big topics – lately in the spotlight & technology-related
  5. The Open Systems Interconnection model (OSI model) of social good

    Volunteering Politics Democracy Free Press Privacy ☎ Internet Environment
  6. • 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
  7. • ⚡Call for action (CFA) • Python scraping • Requests

    + BeautifulSoup • https://scrapy.org/ • https://scrapinghub.com/ Global Warming Data
  8. • 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
  9. • 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
  10. • 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
  11. • 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
  12. • Snowden reveals government surveillance programs (June 2013) • Privacy-protecting

    solutions are hard to fund • I’ve tried with https://github.com/cloudfleet Privacy
  13. • 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
  14. • 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
  15. • Facebook + Cambridge Analytics + trolls + fake news

    = impact elections • Voting machines in Germany hacked • Outright "cyber warfare” – attack on Estonia’s systems Democracy
  16. • Help find software vulnerabilities • Identify trolls / bots

    on social networks • TensorFlow • https://www.kaggle.com/vikasg/russian-troll-tweets Democracy ⚡CFA
  17. • 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
  18. • 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
  19. • Help politicians you support • Map candidates’ lists –

    http://liste.zagrebjenas.hr/ • Donations – https://zagrebjenas.herokuapp.com/ Politics ⚡CFA
  20. • 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
  21. • Make money • Donate it • American Civil Liberties

    Union • the Natural Resources Defense Council, an • Planned Parenthood Politics ⚡CFA
  22. • 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
  23. • Helping the economically disadvantaged • Helping the misrepresented •

    Other forms of helping your community Volunteering
  24. • 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