You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit of fun with literate programming using Markdown
Literate Programming hacks
Let's try some literate programming. From Don Knuth's original idea, thru
Norman Ramsey's noweb reformulation, by way of Jonathan Aquino's Python
version, which I tweaked to accept Markdown input and added a few new
features.
$ ./noweb.py -R 'outer function' lp_hacks.md | python
Hello world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and after this, we need to do another operation. because the default settings of X11 only allows local users to print. so we need to change this to all users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is the problem I'm trying to solve here. You have some code running in AWS or running in some far-away server rack. Your
access to the machine in question is things like SSH or telnet. The code is running a bunch of jobs as part of a CI/CD system.
You would like to kick off a job where the code runs with RemotePdb so that you can step through it and examine variables and
set breakpoints and all that, without disturbing any other jobs running at the same time.
You can't change the code. You don't have time to get a merge request approved, and it doesn't make sense to do a merge request
to facilitate what might be a very brief one-time debugging session. You need some kind of hooks in your production code that
make this remote debugging stuff feasible without a fresh push to your CI/CD stack.
Decorator to show Python control flow thru a function and the functions it calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I need to wrap my head around this WSGI stuff. Let's dockerize this
tutorial.
https://en.wikipedia.org/wiki/Gunicorn
The Gunicorn "Green Unicorn" (pronounced jee-unicorn) is a Python Web Server
Gateway Interface (WSGI) HTTP server. It is a pre-fork worker model, ported
from Ruby's Unicorn project. The Gunicorn server is broadly compatible with a