Skip to content

Instantly share code, notes, and snippets.

View asciimoo's full-sized avatar

Adam Tauber asciimoo

  • Budapest, Hungary
View GitHub Profile
@adamkaplan
adamkaplan / Uncached DNS, new connection
Last active January 16, 2023 03:34
Use Curl to identify bottlenecks in your service layers.
# SSL request to hostname that is not in DNS
> curl -o /dev/null -w @curlformat https://beta.finance.yahoo.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 255k 0 255k 0 0 233k 0 --:--:-- 0:00:01 --:--:-- 233k
Size: 261255
DNS: 0.522
Connect: 0.536
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jboner
jboner / latency.txt
Last active April 28, 2024 13:12
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
@stef
stef / dump_schema.py
Created July 30, 2011 13:27
samples a list of data-structures and displays a statistical representation of the underlying data schema, also can compare 2 composite datastructures... somewhat
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of composite data analysis tools (cdat)
# composite data analysis tools (cdat) is free software: you can
# redistribute it and/or modify it under the terms of the GNU
# Affero General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option)
# any later version.