Skip to content

Instantly share code, notes, and snippets.

@enixdark
enixdark / golang_job_queue.md
Created February 8, 2021 17:59 — forked from harlow/golang_job_queue.md
Job queues in Golang
@enixdark
enixdark / s3_multipart_upload.py
Created January 15, 2021 19:16 — forked from gamame/s3_multipart_upload.py
Example of Parallelized Multipart upload using boto
#!/usr/bin/env python
"""Split large file into multiple pieces for upload to S3.
S3 only supports 5Gb files for uploading directly, so for larger CloudBioLinux
box images we need to use boto's multipart file support.
This parallelizes the task over available cores using multiprocessing.
Usage:
s3_multipart_upload.py <file_to_transfer> <bucket_name> [<s3_key_name>]
@enixdark
enixdark / s3up.py
Created January 15, 2021 19:01 — forked from ryansch/s3up.py
Command-line s3 uploader that uses the MultiPart (chunked) S3 upload functionality to parallelize and speed up large file uploads.
#!/usr/bin/env python
# coding=utf-8
#
# s3up.py
# 2010-2011, Mike Tigas
# https://mike.tig.as/
#
# Usage:
# s3up filename
# Uploads the given file to the DEFAULT_BUCKET (see below)
@enixdark
enixdark / stream_response.py
Created January 15, 2021 18:53 — forked from obskyr/stream_response.py
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@enixdark
enixdark / gist:13a1ecd1ba265467e9ea0c64f28a16a8
Created December 30, 2020 09:50 — forked from tom-tan/gist:b5669b6dc1f1b897a39dd4eedecfbb9b
podman を Alpine 内で動かそうとしたメモ
KataContainers
- image coupled with kernel
- light vm layer
- can run in nested virturalization environments if hardware supports and you can enable it in bios (ex. only bare metal EC2 instances, limits many cloud providers)
- slower startup time
- OCI compliant
- previously known as ClearContainers by Intel
gvisor
- kernel implemented in userspace
@enixdark
enixdark / utf16_to_utf8.c
Created November 6, 2020 18:50 — forked from davidglezz/utf16_to_utf8.c
utf16_to_utf8 function, untested by me, but I hope it works well, comes from opusfile with some modifications.
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
static char* utf16_to_utf8 (const wchar_t *src)
{
size_t len = wcslen(src), si, di;
char *dst = (char*)malloc(sizeof(*dst)*(3*len+1));
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMDSKtPhV2NKgzA1xvchG6WYE3GkGTSvzZq3C8XUlEUa4+FvLz+VF2KqFNpkvjBtxxx3iWQxBYA6qz27CafkMpM7E+JDul1UQFVAtnbyNGXzyMCpP3nvqisDdQU8nxbRcvcm3V+PLgRdfseaO48hpXMQAFZnvFAhRbKYIlLMaop7X9u2SDlL/9ZeXhksB+/9W4p4cqVcjIRuTr2x5DFn2YgSvAcBx9fn5wP55ruSIKd0totg4yNL2v0ueQnkKgUSjtUeU5U7c/ns+tip3in3n8PSl1V8d+Zmhx8W5bvBNTqrQbioQh5Zr8aN8S3E0s4VlGA0zIsVJZDCBFrzGgxsMP cqshinn@Erlang
@enixdark
enixdark / README.md
Created August 4, 2020 02:19 — forked from pziecina/README.md
dwm configuration

dwm config

Install required packages:

apt-get install libxinerama-dev libx11-dev

Customization of [dwm], which base code of dwm may be found under:

git clone http://git.suckless.org/dwm