Skip to content

Instantly share code, notes, and snippets.

View WinnerOK's full-sized avatar

Daniil Manakovskiy WinnerOK

  • Innopolis University
View GitHub Profile
@AndrewDavid
AndrewDavid / Multiple Deploy Keys in GitHub.md
Created November 27, 2019 15:34 — forked from mcfdn/Multiple Deploy Keys in GitHub.md
Using multiple GitHub deploy keys on a single server with a single user

Using multiple GitHub deploy keys on a single server with a single user

Within GitHub it is possible to set up two types of SSH key - account level SSH keys and and repository level SSH keys. These repository level SSH keys are known in GitHub as deploy keys.

Deploy keys are useful for deploying code because they do not rely on an individual user account, which is susceptible to change, to “store” the server keys.

There is, however, an ‘issue’ with using deploy keys; each key across all repositories on GitHub must be unique. No one key can be used more than once. This becomes a problem when deploying to repositories to the same server with the same user. If you create two keys, the SSH client will not know which key to use when connecting to GitHub.

One solution is to use an SSH config file to define which key to use in which situation. This isn’t as easy as it seems.. you might try something like this:

@eduzen
eduzen / Dockerfile
Created May 19, 2019 18:35
Dockerfile for django/python with multistage builds based on alpine
FROM python:3.7-alpine as base
ENV PYTHONDONTWRITEBYTECODE 1
COPY requirements.txt requirements_dev.txt ./
RUN apk add --update --no-cache --virtual .build-deps \
build-base \
postgresql-dev \
libffi-dev \
python3-dev \
@jboner
jboner / latency.txt
Last active May 8, 2024 03:00
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD