Tuesday, 18 December 2018

Quickly ssh into repeatly new Linux instances with same IP without host key check

WARNING: this is extremely dangerous on networks not completely TRUSTED

Host 10.10.* *.mycompany.org
  User myuser
  IdentityFile /home/myuser/.ssh/my_ssh_key
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null

Monday, 26 November 2018

Total n00b’s guide to Big O, Big Ω, & Big θ

Crazy brillant!

https://medium.com/@.RT/total-n00bs-guide-to-big-o-big-%CF%89-big-%CE%B8-aa259ae8a1c2

Total n00b’s guide to Big O, Big Ω, & Big θ

Tuesday, 11 September 2018

tcpdump -nnXSs

Taken: https://www.askbjoernhansen.com/2007/07/12/how_to_dump_packets_with_tcpdump.html

I always forget the parameters for this and have to look them up in the man page, so enough of that:

 tcpdump -nnXSs 0 port 80


  • "-nn" makes it not lookup hostnames in DNS and service names (in /etc/services) for respectively faster and cleaner output. 
  • "-X" makes it print each packet in hex and ascii; that's really the useful bit for tracking headers and such 
  • "-S" print absolute rather than relative TCP sequence numbers - If I remember right this is so you can compare tcpdump outputs from multiple users doing this at once 
  • "-s 0" by default tcpdump will only capture the beginning of each packet, using 0 here will make it capture the full packets. We are debugging, right? 

Sunday, 9 September 2018

<description>[\w\s\n&\.\-,;]*</description>

Monday, 27 August 2018

perl cli regex

perl -pe 's/^(.+)\/([^\s]+)\-([v0-9.]+)\-*([Final|GA|M2|rc|beta|R5]*).jar$/$2\t$3\t$4/'

Saturday, 23 June 2018

key git book pages to read


  • https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
  • https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows

Sunday, 10 June 2018

packer: virtualbox

Prep
  • Vagrant
    • vagrant init hashicorp/precise64
    • vagrant up
    • vagrant destroy -f
Generate
  • Packer
    • find ~/.vagrant.d/ -name '*ovf' -ls | grep hashi
    • create ex001.json
      • see below
      • fix "source_path" to ovf file to match your system
    • packer validate ex001.json
    • packer build ex001.json
    • vagrant box add my-box-001 packer_virtualbox-ovf_virtualbox.box --force
Test
  • mkdir test001
  • cd test001
  • vagrant init
    • in generated "Vagrantfile", change 1st line to 2nd line
      •   config.vm.box = "base"
      •   config.vm.box = "my-box-001"
  • vagrant up
  • vagrant ssh
    • cat /var/tmp/welcome.txt
      • should say, "welcome001"
  • vagrant destroy -f
Cleanup
  • vagrant box remove my-box-001 --force
  • vagrant box remove hashicorp/precise64 --force


ex001.json

{
  "builders": [{
      "type": "virtualbox-ovf",
      "source_path": "<path to your home dir>/.vagrant.d//boxes/hashicorp-VAGRANTSLASH-precise64/1.1.0/virtualbox/box.ovf",
      "ssh_username": "vagrant",
      "ssh_password": "vagrant",
      "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
    }],
    "provisioners": [
        {
            "type": "shell",
            "inline":[ "echo welcome001 > /var/tmp/welcome.txt" ]
        }
    ],
    "post-processors": ["vagrant"]
}


Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...