Skip to content

Instantly share code, notes, and snippets.

View yaci's full-sized avatar

Jacek Maciejewski yaci

View GitHub Profile
@yaci
yaci / scar_tissue.md
Created May 28, 2023 12:17 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@yaci
yaci / eu-covid-certificate-qr-decoder.py
Last active February 18, 2022 10:16
Decode information from European covid19 travel certificates
#######
#
# REQUIRES: pip install cose #!!!!
#
# HOW TO USE:
# 1. Use your favourite QR scanner to scan the code from a certificate,
# you'll get a string that starts with "HC1:"
# 2. Run the script: python3 covid-qr-certificate-decoder.py
# 3. Paste the string when prompted
#
@yaci
yaci / measure-distance-between-elements.js
Last active March 15, 2021 18:46
Measures vertical distance between elements on a page.
/* 1. run the code in the console
* 2. Click on an element on a page
* 3. Click on another element
* 4. Distance between the two will be shown in the console
* NOTE: it measures only vertical distance (Y axis) NOT the horizontal one!
*/
var firstElement;
@yaci
yaci / annotate-elements.js
Created March 8, 2021 11:20
Annotates elements on page with their properties (e.g. font size, colour) so you don't have to open dev tools for testing/debugging
function getProp(elem, prop) {
const propValue = window.getComputedStyle(elem).getPropertyValue(prop);
return `${prop}: ${propValue}; `;
}
function annotateElements(elems) {
for (let e of elems) {
let sBuilder = "<span style='font-size: 8px;'>";
sBuilder += getProp(e, 'font-size');
//add more properties if needed e.g.:
@yaci
yaci / digany.sh
Last active March 16, 2019 21:29
ANY metatype for DNS queries is being phased out, so here is the reimplementation of "dig -t any domain.tld"
#! /bin/bash
# new DNS specification RFC8482 states that DNS servers do not need to respond to ANY metatype
# and can return NOTIMP (not implemented) response for such query. Many of us however, used
# `dig -t any domain.tld` command
# for various debugging purposes. Since more and more servers will be refusing such queries,
# the alternative is to query servers "manually" for every possible record type.
domain="$1"
@yaci
yaci / search-for-subdomains.sh
Last active March 12, 2019 11:36
Query crt.sh (certificate transparency logs) for subdomains of a given domain and checks if these domains are available to the public
#! /bin/bash
####
# READ THIS!
# You need to have jq installed to run this script.
# To run, execute ./search-for-subdomains.sh facebook.com
####
probeTimeoutInSeconds=10
@yaci
yaci / install.sh
Last active September 21, 2020 11:33
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common openssh-server
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce htop zsh
sudo docker info
sudo usermod -aG docker ubuntu
@yaci
yaci / create7zipArchive.sh
Last active August 26, 2017 00:50
Maximum compression using 7z on linux
7za a -t7z -m0=lzma2 -mx=9 -mfb=273 -md=256m -ms=on archiveName.7z inputFilesOrDir
# -md - dictionary size (256m dictionary requires 5gb+ RAM)
# -ms=on - solid archive
# to install 7z on ubuntu: apt-get install p7zip-full