diff --git a/2016-04-02-apt-caching-for-debootstrap.html b/2016-04-02-apt-caching-for-debootstrap.html index a7a896f..e069cc5 100644 --- a/2016-04-02-apt-caching-for-debootstrap.html +++ b/2016-04-02-apt-caching-for-debootstrap.html @@ -7,17 +7,20 @@

Install apt-cacher-ng

-sudo apt-get install squid-deb-proxy +
sudo apt-get install squid-deb-proxy
+

Tell programs to use the proxy

-export http_proxy=http://127.0.0.1:8000 -# Note that you'll need to re-export this before any use of debootstrap +
export http_proxy=http://127.0.0.1:8000
+# Note that you'll need to re-export this before any use of debootstrap
+

Tell sudo to pass through http_proxy

-sudo visudo +
sudo visudo
 # Add the line after the env_reset line:
-Defaults env_keep += "http_proxy"
+Defaults env_keep += "http_proxy"
+
diff --git a/markdown/2016-04-02-apt-caching-for-debootstrap.md b/markdown/2016-04-02-apt-caching-for-debootstrap.md new file mode 100644 index 0000000..bd3884e --- /dev/null +++ b/markdown/2016-04-02-apt-caching-for-debootstrap.md @@ -0,0 +1,23 @@ + + + + + +If you’re building system images, you’re going to do a lot of debootstrap, which is going to fetch a lot of packages. On a fast system, that’ll be the slowest part of the process. Here’s how to cache. + +### Install apt-cacher-ng + + sudo apt-get install squid-deb-proxy + +### Tell programs to use the proxy + + export http_proxy=http://127.0.0.1:8000 + # Note that you'll need to re-export this before any use of debootstrap + +### Tell sudo to pass through http_proxy + + sudo visudo + # Add the line after the env_reset line: + Defaults env_keep += "http_proxy" + + diff --git a/markdown/build-html.sh b/markdown/build-html.sh index 6177cd8..b52d3d3 100755 --- a/markdown/build-html.sh +++ b/markdown/build-html.sh @@ -6,7 +6,7 @@ for FILE in $BASEDIR/*.md; do BASENAME=$(basename $FILE) OUTNAME=${BASENAME%.md}.html echo "$BASENAME -> $OUTNAME" - TEMP=$(tempfile --dir=$BASEDIR) + TEMP=$(tempfile --dir=$BASEDIR --mode=0644) markdown $FILE > $TEMP mv $TEMP $BASEDIR/../$OUTNAME done