Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / python-environment.md
Last active October 7, 2020 02:36
Details of the DigitalOcean App Platform Python environment

Details of the DigitalOcean App Platform Python environment

I created an app on the DigitalOcean App Platform with a requirements.txt and a Procfile - causing it to detect a Python application and build the app with their Python buildpack.

Here are some details of the resulting environment, from running commands using the DigitalOcean web terminal.

$ uname -a
Linux digital-ocean-app-9c6bd5794-kt9h8 4.4.0 #1 SMP Sun Jan 10 15:06:54 PST 2016 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/issue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / Earthquakes.ipynb
Created September 10, 2020 16:19
Earthquakes demo for PyRVA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / crontab.txt
Created September 10, 2020 16:09
Dogsheep crontab.txt as of 10th September 2020
# Fetch latest configuration:
*/5 * * * * cd /home/ubuntu/dogsheep-config && python3 git_pull_and_run_scripts.py . && sudo python3 ensure_symlinks.py files-to-symlink
# Goodreads
46 * * * * cd /home/ubuntu && /home/ubuntu/datasette-venv/bin/goodreads-to-sqlite books goodreads.db -a auth.json
# Twitter
1,11,21,31,41,51 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite user-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since
2,7,12,17,22,27,32,37,42,47,52,57 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite home-timeline /home/ubuntu/timeline.db -a /home/ubuntu/auth.json --since
4,14,24,34,44,54 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite mentions-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since
@simonw
simonw / Datasette and Pandas.ipynb
Created July 17, 2020 20:25
Using Datasette with Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / UK power outages.ipynb
Created July 14, 2020 17:17
How to create a SQLite database of UK power outages using sqlite-utils
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / datasette-auth-passwords-heroku.md
Last active July 13, 2020 20:57
Publishing a private Datasette instance to Heroku using datasette-auth-passwords
@simonw
simonw / create-db.sh
Created July 6, 2020 22:10
Create a SQLite database (for use with Datasette) of SBA loans from https://sba.app.box.com/s/tvb0v5i57oa8gc6b5dcm9cyw7y2ms6pp
sqlite-utils insert /tmp/loans.db foia_150k_plus --csv '150k plus/foia_150k_plus.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AL --csv 'Alabama/foia_up_to_150k_AL.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AK --csv 'Alaska/foia_up_to_150k_AK.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AS --csv 'American Samoa/foia_up_to_150k_AS.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AZ --csv 'Arizona/foia_up_to_150k_AZ.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AR --csv 'Arkansas/foia_up_to_150k_AR.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CA --csv 'California/foia_up_to_150k_CA.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CO --csv 'Colorado/foia_up_to_150k_CO.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CT --csv 'Connecticut/foia_up_to_150k_CT.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_DE --csv 'Delaware/foia_up_to_150k_DE.csv'
@simonw
simonw / macos-machine-learning-models.md
Created May 21, 2020 15:46
Machine learning models installed on macOS is part of Vision.framework

Machine learning models installed on macOS is part of Vision.framework

I found these while poking around at the list of open files for photoanalysisd in Activity Monitor.

% ls -lahS /System/Library/Frameworks/Vision.framework/Versions/A/Resources
total 465616
-rw-r--r--    1 root  wheel    40M Dec 13 16:32 landmarks_v2.bin
-rw-r--r--    1 root  wheel    31M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.4_r9_opt_int8.espresso.weights
-rw-r--r--    1 root  wheel    29M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.6_r13.4_opt_int8_asymetric.espresso.weights