Skip to content

Instantly share code, notes, and snippets.

View scsmith's full-sized avatar

Steve Smith scsmith

View GitHub Profile
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@raggi
raggi / disk_writer.rb
Created April 2, 2011 18:02
An example to assist someone asking for help on the EM mailinglist. An eventmachine connection class that writes periodically to file.
class DiskWriter < EM::Connection
# A random stab in the dark at somethign that's loosely efficient. Assuming
# you have a larger page size than 4kb, you'll probably still want ruby to
# write a ton of pages at a time to anything resembling a spindle. On most
# systems, this will default to 64kb. It's possible you may get better
# performance going much higher. If you end up GC bound, or other operations
# are causing leak like behavior, then you may find higher tunings become
# less efficient in production over time. It is also worth noting that some
# versions ::Queue do not free their buffer pages.
DEFAULT_THRESHOLD = 16384 * `getconf PAGESIZE`.to_i
@jcarbaugh
jcarbaugh / gist:885876
Created March 24, 2011 21:01
MailHandler registration for posting by email with django-cloudmailin
handler = MailHandler()
handler.register_address(
address="000000000000000000@cloudmailin.com",
secret="secret-key-from-cloudmailin",
callback=create_post,
)
urlpatterns = patterns('',
url(r'^postbymail/$', mail_handler),
)