Skip to content

Instantly share code, notes, and snippets.

@mihalyr
mihalyr / vim-text-objects.md
Last active January 10, 2021 17:43
VIM Text Objects

VIM text objects

Words

  • aw - a word with surrounding whitespace
  • iw - inner word (does not include surrounding whitespace)

Sentences: as, is

Paragraphs: ap, ip

@mihalyr
mihalyr / 0MulticastTesting.md
Created October 28, 2020 11:17
Multicast testing

IPv4 and IPv6 multicast testing script. Based on Multicast: From Theory to Practice in Linux Journal

Run on two separate machines with the same group/port as arguments to test multicast.

On Fedora if multicast is not enabled in the firewall this rule might help:

sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -s 192.168.0.0/24 -m addrtype --dst-type MULTICAST -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv6 filter INPUT 0 -s fe80::/64 -m addrtype --dst-type MULTICAST -j ACCEPT
@mihalyr
mihalyr / vim-all-the-righ-moves.md
Last active April 12, 2020 10:38
All the right moves

Source: https://vim.fandom.com/wiki/All_the_right_moves

Vim provides many ways to move the cursor. Becoming familiar with them leads to more effective text editing.

h   move one character left
j   move one row down
k   move one row up
l   move one character right
w   move to beginning of next word

IPv6 Address Types - https://www.ripe.net/participate/member-support/lir-basics/ipv6_reference_card.pdf

  • ::/128Unspecified, 0.0.0.0
  • ::1/128 Loopback, 127.0.0.1
  • ::ffff/96 IPv4 mapped, e.g. ::ffff:192.0.2.47
  • fc00::/7 Unique Local Addresses (ULAs), RFC 4193, home or enterprise local, not routed over public internet, IPv4 equivalent of private or RFC 1918 address space, such as 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
  • fe80::/10 Link-local Addresses, like 169.254.0.0/16
  • 2001:0000::/32 Teredo, IPv6 tunneling over IPv4 NATs
  • 2001:0002::/48 Benchmarking, reserved for use in documentation, should not be used, equivalent 192.18.0.0/15
  • 2001:0010::/28 Orchid, fixed-term experiment, only end to end basis routers should not see packets with these
@mihalyr
mihalyr / latency.txt
Last active February 10, 2020 19:17 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency numbers 2020
--------------------
Source: https://www.forrestthewoods.com/blog/memory-bandwidth-napkin-math/
L1 Latency: 1 ns
L2 Latency: 2.5 ns
L3 Latency: 10 ns
RAM Latency: 50 ns
(per thread)
@mihalyr
mihalyr / forensics-cheatsheet.md
Created January 29, 2020 14:15
Linux Compromise Assessment Command Cheat Sheet
@mihalyr
mihalyr / gpl-attribution-example.txt
Last active February 6, 2020 14:24
GPL Attribution Example
This is a GPL derivative work attribution example found here https://softwareengineering.stackexchange.com/questions/167935/proper-attribution-of-derived-work-in-a-gpl-project
// HgSharp
//
// Copyright 2005-2012 Matt Mackall <mpm@selenic.com> and Mercurial contributors
// Copyright 2011-2012 Anton Gogolev <anton.gogolev@hglabhq.com>
//
// The following code is a derivative work of the code from the Mercurial project,
// which is licensed GPLv2. This code therefore is also licensed under the terms
// of the GNU Public License, verison 2.