Skip to content

Instantly share code, notes, and snippets.

View ilpoldo's full-sized avatar

Leandro Pedroni ilpoldo

  • Double Negative
  • London, UK
View GitHub Profile
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@mgwidmann
mgwidmann / hotcode.ex
Last active September 25, 2022 19:57
Hot code swapping
# To show hot code uploading, we first need to build a simple phoenix project so we can see it happen in real time.
# Start by making a new phoenix project
$ mix phoenix.new hotcode
# Go into the directory
$ cd hotcode
# Add exrm dependency to mix.exs file
{:exrm, "~> 1.0.3"}
@rochacbruno
rochacbruno / ACCESS_ELASTIC.md
Last active May 3, 2024 19:15
Docker-compose wait-to-start

When unsing docker compose you can have a problem with the order of dependent linked containers

The solution is to start a script which tries to access a service and waits until it gets ready before loading your program

@datagrok
datagrok / README.md
Last active November 20, 2023 22:00
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@denji
denji / golang-tls.md
Last active April 29, 2024 03:39 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@steveklabnik
steveklabnik / Makefile
Last active December 23, 2015 21:19
I think this is actually how you Makefile
CHAPTERS=book/preamble.md \
$(wildcard book/chapter-*.md)
CONTENTS=book/title.txt \
$(CHAPTERS)
ALL_FILES=$(CHAPTERS) \
book/metadata.xml \
book/title.txt \
cover.png
@nvie
nvie / sift.py
Last active December 18, 2015 15:28
The sift itertool.
from collections import deque
from functools import wraps
def inversify(predicate):
"""Returns a predicate that is the inverses of the given predicate."""
@wraps(predicate)
def _inner(*args, **kwargs):
return not predicate(*args, **kwargs)
return _inner
@mbostock
mbostock / .block
Last active August 29, 2023 06:47
Hexagon Mesh
license: gpl-3.0

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@timurvafin
timurvafin / Gemfile
Created October 13, 2012 07:49
Get http requests benchmark: sync vs. celluloid vs. em
source :rubygems
gem 'celluloid'
gem 'em-synchrony'
gem 'em-http-request'