Effective Study Techniques
Studying effectively isn’t just about putting in the hours, it’s about using the right techniques. Research shows that some popular methods, like re-reading notes or highlighting, are far less effective than people assume. Instead, techniques that leverage how our brains naturally process and retain information yield far better results. The Problem with Common Study Habits Memory Palaces: The Ancient Greek Technique The Protégé Effect & The Feynman Technique The Zeigarnik Effect: Why Unfinished Tasks Stick Distributed Learning: The Power of Spacing Conclusion The Problem with Common Study Habits Ineffective techniques: Reading over and over, highlighting, using mnemonics for simple memorization, starting early without a plan, reading notes before and after class, listening to music while studying. ...
Stubborn Attachments
Stubborn Attachments is a book by Tyler Cowen that paints a picture of an altruistic and bright future for the human race. Cohen argues and highlights the importance of sustained economic growth, moral philosophy and consequentialism, radical uncertainty, rules-based ethics, that future generations matter deeply, and how we as a race must be stubbornly attached to certain core principles as the necessary pre-conditions for sustainable prosperity. Overview Supporting Arguments Fundamental Concepts Altruism Epistemic Nihilism Pluralism Utilitarianism Overview Cowen argues that long-term economic growth is the single most important factor that contributes to improving human welfare (1) under a form of moral philosophy and consequentialism he refers to as “wealth plus” utilitarianism, growth that values not just blind GDP but also leisure, environmental quality, and rights (2). Cohen then tackles the problem of uncertainty; our world and social fabric suffers from radical uncertainty; given the difficulty in precisely predicting the future (3) civilization has no choice but to follow simple, robust moral rules. He further ties off the problem of uncertainty, making the case that ethical decision-making should prioritise the well-being of future generations (4). Cohen concludes by arguing for commitment to free markets, rights, and rule of law as necessary conditions for sustainable prosperity. ...
Hiking Retrospectives
Getting out on the trail is one my favourite things to do, especially long multi-day hikes. I’ve got into the habbit of reflecting after each adventure, what worked well, what didn’t, potential opportunities or tips I discovered from other more experienced hikers. In software, some agile methods refer to this act as a retrospective and its a powerful way to get better at something. “At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly” - Agile Manifesto, 2001 ...
Clean Architecture
Thoughts and reflections from Uncle Bob’s Clean Architecture. SOLID Single Responsibility Principle SRP is commonly misconceived as doing one thing well. Instead is aimed at minimising the blast radius of change as the software itself relates to the real world concepts it represents. A module should have only one reason to change, which means it should be responsible to only one actor. This principle aims to avoid accidental duplication and ensure that changes in one part of the system don’t unnecessarily affect other parts. ...
Certified Kubernetes Administrator (CKA)
Architecture Glossary Certification tips Bookmarks kubectl imperative commands Docker vs containerD ctr nerdctl crictl etcd etcdctl kube-apiserver kube-controller-manager ReplicaSets Deployments Services Gems Architecture +----------------------+ | kube-apiserver | +----------+-----------+ | +------------------------+-----------------------+ | | +------+-------+ +--------+---------+ | etcd | | kube-scheduler | +--------------+ +------------------+ +--------------------------------------------------------+ | | +------+------------------+ +----------+-------+ | kube-controller-manager | | Cloud Controller | +--------------+----------+ +-------+----------+ << CONTROL PLANE COMPONENTS >> ------------------- << WORKER NODE COMPONENTS >> +--------------------+ +-------------------+ | Kubelet | | Kubelet | | kube-proxy | | kube-proxy | | Container runtime| | Container runtime| +--------------------+ +-------------------+ Node 1 Node 2 Glossary Term Definition cri Container Runtime Interface, the contract between k8s and the container runtime crictl ctr Debugging tool for containerD oci Open Container Initiative, formalised the specification of an imagespec and a runtimespec nerdctl Docker like CLI experience for containerD Certification tips Bookmarks https://kubernetes.io/docs/reference/kubectl/conventions/ ...
Rubiks Cube Algo
This algorithm is just muscle memory in my hands and wasn’t as easy to explain in words as I thought. To help teach my 5yo nephew I wanted clear, simple steps. Step 1: Form a Daisy Step 2: Fill in the White Corners (“Chase the White Dogs”) Step 3: Solve the Middle Row Step 4: Create a Yellow Plus Step 5: Align the Yellow Corners (“Feed the Yellow Fish”) Step 6: Match Top Corners Step 7: Solve the Final Layer Step 1: Form a Daisy Start by creating a white plus sign (the petals) on the yellow face (center). Align each white petal’s adjacent color with its matching middle-row center color. Once matched, rotate the petal 180° to move it to the bottom face. Repeat this process for all petals until you form a white cross on the bottom face. Step 2: Fill in the White Corners (“Chase the White Dogs”) Find any white corner pieces on the bottom layer (the “dogs”). Rotate the bottom layer to position a white corner directly below its matching color. For example, a white/green corner should be under the green side. Bring the corner into the white face by rotating the side it’s under downward, “scooping” the corner piece into place. Repeat until the entire white face is completed, and the bottom row edges align with their center colors. Step 3: Solve the Middle Row Identify edge pieces on the bottom layer that do not contain yellow (e.g., an orange/blue edge). Determine the direction the piece needs to move: left or right. Follow this sequence to place it: Turn the bottom layer away from the target destination. Rotate the bottom layer towards the destination. Move the corresponding side of the middle layer downward. Rotate the middle layer toward the destination. Move the same side of the middle layer upward. Restore the white cross if needed. Repeat until all middle-row edges are in place. Step 4: Create a Yellow Plus Use the FUR-RUF sequence: Front, Up, Right, Right, Up, Front. Repeat this pattern until you form a yellow cross on the top face. Step 5: Align the Yellow Corners (“Feed the Yellow Fish”) Look for a “yellow fish” pattern on the top face (a yellow triangle or “arrow”). Perform this sequence: Rotate the Right face clockwise twice. Rotate the Top face counter-clockwise once. Rotate the Right face clockwise again. Rotate the Top face clockwise once. Flip the cube so the yellow face remains on top, then rotate the Top face counter-clockwise. Step 6: Match Top Corners Find two adjacent corners with matching side colors. Position them so they face the correct side. Use this sequence to adjust the corners: Counter-clockwise, Clockwise, Counter-clockwise, Flip, Clockwise, Counter-clockwise, Counter-clockwise, Flip, Flip. Repeat as needed until all corners align with their sides. Step 7: Solve the Final Layer Finish the cube with this sequence: Flip, Clockwise x3, Counter-clockwise x5, Clockwise, Counter-clockwise. Adjust any remaining misaligned edges by repeating this pattern.
Elasticsearch Performance and Tuning
A dedicated performance course run by Matt Gregory from Elastic, an absolute legend with deep Elasticsearch expert. Contents Cool takeaways Tuning for Index Speed Increase the refresh interval Index architecting Bulk Hardware settings to improve performance Disable swapping Indexing Buffer size Best practices and scaling Disable replics for initial loads Use auto-generated IDs Use Cross Cluster Replication Thread Pools Memory Locking Transforms Tuning for search API settings and data modelling to improve search performance Search as few fields as possible One big copy_to field as opposed to individual text multi field Consider mapping identifiers as keywords Document modeling Consider mapping numeric fields as keyword Hardware settings to improve search Warm Up Global Ordinals Warm up filesystem Cache Use index sorting to speed up search Ways to improve searches must and should clauses filter and must not clauses node query cache shard request cache Aggregation performance Search rounded dates Force merge read only indices Search profiler and Explain API Search profiler Search profiler API ID Query section Timing breakdown Collection section Collectors reasons Rewrite section Explain and Tasks API Explain API Score Field length normalization and coordindation Other Query Parameters API Settings to improve indexing performance Hardware settings to improve performance Best Practices and scaling Transforms Cool takeaways Increase the refresh_interval from default 1s to something higher, like 10s. Index typings should be set to strict (default is dynamic) The took param measures raw cluster operation speed, kibana will also reveal a roundtrip time which includes the HTTP layer. Auto generated id’s are always faster One of Matt’s favourite APIs _cluster/allocation/explain Ensure the heap is beefed up a must clause is the first line of defence for scoring, should is then used as the second pass of scoring always format queries as a ‘bool’ Configuration management everywhere (Ansible, etc) dedicated monitoring cluster Tuning for Index Speed Cheatsheet: ...
Elasticsearch Engineer 8.1
Revised 2024 edition based on Elasticsearch 8.1. Recently the opportunity to attend the latest revision of the 4-day Elasticsearch engineer course, which I did in-person about 5 years ago in Sydney. Elasticsearch has often been an integral part of the data solutions I’ve been involved with and I’m quite fond of it. This time round the course only runs in a virtual class room format (using strigo.io) with our awesome trainers Krishna Shah and Kiju Kim. ...
Kustomize
Kustomize is built into kubectl with -k. Great samples on kubernetes.io/docs Kustomize provides a template-free way to customize kubernetes manifests Contents: Generating resources Setting cross cutting fields Composing and customizing resources Composing Customizing Patches Images Replacements Reference In a nutshell provides 3 key features: generating resources from other sources setting cross-cutting fields for resources composing and customizing collections of resources Generating resources To generate a ConfigMap from an .env file, add an entry to the envs list in configMapGenerator. Kustomize supports other formats such as .properties. ...
Python Packaging (2024)
sysconfig Project Structure Setup Script Distribution Archives Distribution sysconfig The process of bundling Python code into a format that eases distribution and sharing. First up, I find it helps to get a concrete understanding of how the specific python distro I’m working with is configured, of paricular interest are the various system paths that will be visited for package dependencies. The built-in sysconfig module neatly manages and surfaces this information. python -m sysconfig On a Windows system: ...