Each server autonomously detects & mitigates attacks. Realtime threat intelligence (top fingerprint permutations) gossiped within the data center as well as globally to improve mitigation efficacy
Each server autonomously detects & mitigates attacks. Realtime threat intelligence (top fingerprint permutations) gossiped within the data center as well as globally to improve mitigation efficacy
- CF's global anycast helps spreading the attack traffic
- dosd looks for patterns in sampled packets, generate permutations to find the fingerprint with highest mitigation efficacy
- mitigation rules applied based on fingerprint counts, rule times out to prevent false +ves
0.004% attack traffic:
- QOTD DDoS (reflect & amp, UDP/17)
- Echo DDoS (reflect & amp, UDP/TCP/7)
- NTP DDoS (reflect & amp, NTP `monlist` command)
- Mirai UDP attack (flood, botnet)
- Portmap DDoS (reflect & amp, UDP/111, RPC info)
- RIPv1 DDoS (reflect & amp, UDP/520, unauthenticated routing info)
The post gives an overview of the 7.3 Tbps DDoS attack which lasted 45s.
Target was a single IP over 21925 target ports, source port distribution was also similar. 99.996% of attack traffic was UDP DDoS (flood)
fibonacci function using Golden ratio
#ProblemSolving Golden ratio can be used to find the nth Fibonacci number!
is_rotated_sorted_array function
#ProblemSolving Given an array of integers, check if it was originally sorted in non-decreasing order, then rotated. One approach is to compare each element with its previous one and count sorting breaks; for sorted-rotated arrays, it should be 1 (or 0 if all elements are the same).
Program diameter_of_binary_tree
#ProblemSolving For finding the length of the diameter of a binary tree (i.e., length of the longest path between any two nodes), compute longest left path and longest right paths of each node and get maximum of sum of left & right paths recursively.
return_to_boundary_count function
#ProblemSolving Given a sequence of number of steps taken, positive values indicating movement to the right and negative to the left from the starting point boundary, find the number of times it returns to the boundary. One approach to solving this is using prefix sum.
Program to find middle node of a linked list using fast & slow pointers
#ProblemSolving The middle node of a singly linked list can be found using fast & slow pointers approach
This π―
Most people don't care about quality shkspr.mobi/blog/2024/12...
Program to check if 2 strings are isomorphic
#ProblemSolving To check if two strings are isomorphic (strings s and t are isomorphic if the characters in s can be replaced to get t), one approach is to create a pattern of indices corresponding to each unique character of a string and compare it with the other string.
Happy New Year! πβοΈ
2025
= (20+25)^2
= (1+2+3+4+5+6+7+8+9)^2
= 1^3+2^3+3^3+4^3+5^3+6^3+7^3+8^3+9^3
= 1+3+5+7+9+11+...+89 [sum of first 45 odd numbers]
= 5^2 * 9^2 [product of two squares]
= 5^2 + 20^2 + 40^2 [sum of 3 squares]
Program to find GCD of 2 strings
#ProblemSolving Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2. For this problem, the rejection criteria is strings concatenated in both orders are not the same. A string chunk of length equal to the GCD of the two lengths will be the result.
Fun facts about SQLite: avi.im/blag/2024/sq...
Bugs are not always meant to be fixed! Here is an example scenario from SQLite:
Function to check if the given n is power of 2
#ProblemSolving To find if the given number n is a power of 2, that is there exists an integer n such that n == 2^x, we can make use of the property that the bitwise AND with the preceding number is 0 only for all powers of 2 in binary representation.
For example:
15: 01111
16: 10000
AND: 00000
- Write integration tests for business logic not only with 100% coverage but with both +ve & -ve scenarios covered
- Aim for cloud platform independent deployment systems
- Security is "not a choice" for software development
- Analyze systems from both attackers POV as well as DevOps POV
(3/3)
My views perfectly align with the points in the post..
- Keep teams small
- Design simple straightforward architectures
- Use framework defaults as much as possible
- Avoid microservices, stick with monolith
- Proactively update dependency versions regularly
- Reject unstructured data inputs
(2/3)
Incredible read on the lessons from startup code audits: kenkantzer.com/learnings-fr...
From the post: "A useful rule of thumb for assessing an abstraction is to ask yourself: How often do I need to peek under the hood? Once per day? Once per month? Once per year? The less often you need to break the illusion, the better the abstraction."
"Future maintainers are the ones who have to peel back the layers, trace the indirections, and make sense of how things fit together. Theyβre the ones paying the real cost of unnecessary abstraction."
fhur.me/posts/2024/t...
Values in each step of computation
Here are the values in each steps of computation
add_binary function demonstrating use of XOR and AND with left bit shift in a loop
#ProblemSolving To find the sum of 2 binary numbers, bitwise operation is a good approach. Take XOR, which is the sum for the step, and take AND with a left shift, which is the carry for the step; repeat until the carry becomes zero.
Code for Floyd's cycle finding algorithm
Floyd's tortoise & hare algorithm example
#ProgrammingTips To determine if linked list has a cycle in it, Floyd's cycle-finding algorithm can be used (en.wikipedia.org/wiki/Cycle_d...). Implement slow and fast pointers, a cycle is confirmed when they meet.
I've seen many times where strictly following programming principles led to wrong abstractions and poor readability. It's hard to address this in code reviews because cognitive load is tough to generalize and needs to be considered case by case.
Cognitive overload increase while reading and understanding a codebase
Interesting read: minds.md/zakirullin/c...
Sample code demonstrating use of XOR to find the non-repeating integer
#ProgrammingTips In an integer list where every element appears twice except for one, XOR helps to find the unique element by canceling out the pairs.
An excellent primer to understand Turing machine!