Skip to content

Instantly share code, notes, and snippets.

@CodigoMatriz
CodigoMatriz / find_string_files.md
Created August 26, 2021 16:31
[Find string in files] #cli
grep -rnw '/path/to/somewhere/' -e 'pattern'
  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for match the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.
  • -e is the pattern used during the search
@CodigoMatriz
CodigoMatriz / decrypt_secret.sh
Created August 26, 2021 00:09
[Decrypt PGP encrypted IAM access key secret] #terraform
echo "{ENCRYPTED_SECRET}" | base64 --decode | gpg --decrypt
@CodigoMatriz
CodigoMatriz / sed_line_removal.md
Last active August 26, 2021 00:06
[Remove line with "sed"] Using sed to remove a line in a file #cli #sed

GNU sed

sed -i "37d" /path/to/file

sed in macOS runs a bit differently than GNU as you have to define a backup file extension before editing the original file:

sed -i.bak "37d" /path/to/file
@CodigoMatriz
CodigoMatriz / cloudSettings
Last active October 21, 2019 23:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-21T23:58:24.829Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am codigomatriz on github.
  • I am ar_adelgado (https://keybase.io/ar_adelgado) on keybase.
  • I have a public key ASAg8lSijFP6qoNnx7WuCX7yiOq4aswhAsl814Pgc4v0qQo

To claim this, I am signing this object: