From f6fa901a0906fc6ba8c6d851060d646c3049f8ea Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 18 Dec 2020 23:42:29 +0000 Subject: deploy: b7f4aee7a60b03db06475f2a017706494d9a2d44 --- print.html | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) (limited to 'print.html') diff --git a/print.html b/print.html index 7b8e3ac..d3416cd 100644 --- a/print.html +++ b/print.html @@ -83,7 +83,7 @@ @@ -159,6 +159,7 @@
  • git
  • awk
  • emacs
  • +
  • gpg
  • gdb
  • radare2
  • @@ -853,6 +854,7 @@ multiple times. Actions with those patterns are executed exactly onceFS field separator: regex to split records into fields, by default
  • NR number record: number of current record
  • +
  • NF number fields: number of fields in the current record
  • Special statements & functions

      @@ -890,6 +892,10 @@ For floats one can use %N.Mf, N is the total number in

      The pattern NR%2 == 0 matches every second record and the action { print $0 } prints the whole record.

      +

      Access last fields in records

      +
      echo 'a b c d e f' | awk '{ print $NF $(NF-1) }'
      +
      +

      Access last fields with arithmetic on the NR number of fields variable.

      Capture in variables

      # /proc/<pid>/status
       #   Name:    cat
      @@ -1122,6 +1128,103 @@ in the user variable and then print it.

      q quit
      +

      gpg(1)

      +
      gpg
      +  -o|--output                 Specify output file
      +  -a|--armor                  Create ascii output
      +  -u|--local-user <name>      Specify key for signing
      +  -r|--recipient              Encrypt for user
      +
      +

      Generate new keypair

      +
      gpg --full-generate-key
      +
      +

      List keys

      +
      gpg -k / --list-key               # public keys
      +gpg -K / --list-secret-keys       # secret keys
      +
      +

      Edit keys

      +
      gpg --edit-key <KEY ID>
      +
      +

      Gives prompt to modify KEY ID, common commands:

      +
      help         show help
      +save         save & quit
      +
      +list         list keys and user IDs
      +key <N>      select subkey <N>
      +uid <N>      select user ID <N>
      +
      +expire       change expiration of selected key
      +
      +adduid       add user ID
      +deluid       delete selected user ID
      +
      +addkey       add subkey
      +delkey       delete selected subkey
      +
      +

      Export & Import Keys

      +
      gpg --export --armor --output <KEY.PUB> <KEY ID>
      +gpg --import <FILE>
      +
      +

      Search & Send keys

      +
      gpg --keyserver <SERVER> --send-keys <KEY ID>
      +gpg --keyserver <SERVER> --search-keys <KEY ID>
      +
      +

      Encrypt (passphrase)

      +

      Encrypt file using passphrase and write encrypted data to <file>.gpg.

      +
      gpg --symmetric <file>
      +
      +# Decrypt using passphrase
      +gpg -o <file> --decrypt <file>.gpg
      +
      +

      Encrypt (public key)

      +

      Encrypt file with public key of specified recipient and write encrypted +data to <file>.gpg.

      +
      gpg --encrypt -r foo@bar.de <file>
      +
      +# Decrypt at foos side (private key required)
      +gpg -o <file> --decrypt <file>.gpg
      +
      +

      Signing

      +

      Generate a signed file and write to <file>.gpg.

      +
      gpg --sign -u foor@bar.de <file>
      +
      +# Verify
      +gpg --verify <file>
      +
      +# Extract content from signed file
      +gpg -o <file> --decrypt <file>.gpg
      +
      +
      +

      Without -u use first private key in list gpg -K for signing.

      +
      +

      Files can also be signed and encrypted at once, gpg will first sign the +file and then encrypt it.

      +
      gpg --sign --encrypt <file>
      +
      +

      Signing (detached)

      +

      Generate a detached signature and write to <file>.asc. +Send <file>.asc along with <file> when distributing.

      +
      gpg --detach-sign --armor -u foor@bar.de <file>
      +
      +# Verify
      +gpg --verify <file>.asc <file>
      +
      +
      +

      Without -u use first private key in list gpg -K for signing.

      +
      +

      Abbreviations

      +
        +
      • sec secret key
      • +
      • ssb secret subkey
      • +
      • pub public key
      • +
      • sub public subkey
      • +
      +

      Keyservers

      +
        +
      • http://pgp.mit.edu
      • +
      • http://keyserver.ubuntu.com
      • +
      • hkps://pgp.mailbox.org
      • +

      gdb(1)

      CLI

        gdb [opts] [prg [-c coredump | -p pid]]
      -- 
      cgit v1.2.3