In a terminal start a server.
$ python -m SimpleHTTPServer 8000In another terminal set up the cgroups freezer.
| class StackPromise extends Promise { | |
| constructor(args) { | |
| super((myresolve, myreject) => | |
| { | |
| let fn = function(result) { | |
| console.log(new Error("Promise resolved").stack); | |
| myresolve(result); | |
| } | |
| args.call(null, fn, myreject ); |
| from z3 import * | |
| n = 10 | |
| vars = [] | |
| def getConstraint(v, x, y): | |
| if x < 0 or x >= n or y < 0 or y >= n: | |
| return False | |
| return v == (1 + vars[x][y]) |
In a terminal start a server.
$ python -m SimpleHTTPServer 8000In another terminal set up the cgroups freezer.
| import imaplib | |
| HOST = "imap.gmail.com" | |
| USER = "tbarik@ncsu.edu" | |
| PASSWORD = "---" | |
| BATCH_FOLDER = "Batch" | |
| INBOX_FOLDER = "\\Inbox" | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>myapp</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.pocketgophers.myapp</string> | |
| <key>CFBundleURLTypes</key> | |
| <array> |
| # Add this snippet to the top of your playbook. | |
| # It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
| # gwillem@gmail.com | |
| - hosts: all | |
| gather_facts: False | |
| tasks: | |
| - name: install python 2 | |
| raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
TLDR: I now add the following snippet to all my Dockerfiles:
# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
&& (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
&& (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
|| echo "No squid-deb-proxy detected on docker host"
| #!/bin/bash | |
| ##### | |
| # | |
| # Deploy a PDF file annotated with the latest git version | |
| # to your Amazon S3 bucket. | |
| # | |
| # This script requires you are running on a Mac with | |
| # homebrew installed and a S3 bucket setup. | |
| # |