Sometimes while running a command inside of a docker container, the container itself will run out of disk space and things can fail (sometimes in strange ways). This is not a guide on how to allocate resources, but a quick cookbook on how to free up disk space inside a container. See below for links to more resources and reading.
I hereby claim:
- I am joshuagross on github.
- I am joshuagross (https://keybase.io/joshuagross) on keybase.
- I have a public key whose fingerprint is DC5B 28F6 29F9 D09B BFB9 7FC3 ABF0 5BA3 4B8D 6DFD
To claim this, I am signing this object:
... and a short description of interesting things learned within:
- 2015-12-25: Beautiful Decay of AOL: someone going over old AOL CDs and "reviewing" the contents of AOL pages.
- 2015-12-25: Specialising Dynamic Techniques for Implementing The Ruby Programming Language: Chris Seaton's PhD thesis - embracing metaprogramming in Ruby to optimize Ruby VMs.
- 2015-12-25: People around the world are eating banana peels because they know something that Westerners do not: basically eating banana peels is better for you and the environment.
- 2015-12-26: Amateur Hour: a guide to how training for beating amateur cycling records works. tl;dr: excruciating, requires intense focus. Train things at 90% of maximum for shorter intervals.
- 2015-12-26: [Attritional Interfaces](https://samgentle.com
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
# Copyright (c) 2016, Swift Navigation, All Rights Reserved. | |
# Released under MIT License. | |
# | |
# Find documentation of parameters here: | |
# http://aprs.gids.nl/nmea/#gga | |
# | |
# time_t is a `time_struct` (https://docs.python.org/2/library/time.html) | |
# alt_m, geoidal_sep_m are in meters | |
import time | |
from math import floor |
This is an error that seems to occur on OS X El Capitan. You may see errors like this that did not occur before:
$ ./my_python_script.py
Traceback (most recent call last):
File "./my_python_script.py", line 17, in <module>
import psycopg2
File "/Users/joshuagross/miniconda2/envs/my_env/lib/python2.7/site-packages/psycopg2/__init__.py", line 50, in
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
-- can be used in ghci | |
import qualified Data.ByteString as B | |
import Numeric (showHex) | |
import qualified Data.ByteString.Lazy as LBS | |
import qualified Data.Binary as B | |
-- encode some object to a binary ByteString | |
let s = (B.encode someObjectThatHasBinaryInstance) | |
let prettyPrint = P.concatMap ((\x -> "0x"++x++" ") . flip showHex "") . B.unpack :: B.ByteString -> String |
Add this line to a Dockerfile to install and configure DogStatsD
in the container. Requires that apt-get
is available on the system.
This script will install curl
in your environment but not
remove it; you should uninstall it if you don't want it available
in the container.
These script uses md5sum
to validate all external scripts that are
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
/** | |
* Copyright 2017, Joshua Gross, All Rights Reserved. | |
* Released under the MIT license. | |
*/ | |
/** | |
* Each BST is represented as its own root. | |
* BSTs have no rebalancing, so tree shape can get gnarly real quick! | |
*/ | |
function BST (key, value, left, right) { |
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
#!/usr/bin/env node | |
const mode = process.argv[2]; | |
const startDate = process.argv[3]; | |
const endDate = process.argv[4]; | |
const vacationDays = parseInt(process.argv[5], 10); | |
const sugar = require('sugar-date'); | |
const moment = require('moment'); | |
const parsedStartDate = moment(sugar.Date.create(startDate)); |
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
function transposeMatrix (m) { | |
return m.map((_, c) => m.map(r => r[c])); | |
} | |
console.log(transpose([[1,2,3],[4,5,6],[7,8,9]])); |