Parcourir la source

Merge pull request #85 from lbonanomi/master

sterilize shell history
pull/86/head
@trimstray il y a 5 ans
committed by GitHub
Parent
révision
74a1e358ae
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. +19
    -0
      README.md

+ 19
- 0
README.md Voir le fichier

@@ -1183,6 +1183,25 @@ column -c3 -s " " -t | \
sort -nr | nl | head -n 20
```

###### Sterilize bash history

```bash
function sterile() {
history | awk '$2 != "history" { $1=""; print $0 }' | egrep -vi "\
curl\b+.*(-E|--cert)\b+.*\b*|\
curl\b+.*--pass\b+.*\b*|\
curl\b+.*(-U|--proxy-user).*:.*\b*|\
curl\b+.*(-u|--user).*:.*\b*
.*(-H|--header).*(token|auth.*)\b+.*|\
wget\b+.*--.*password\b+.*\b*|\
http.?://.+:.+@.*\
" > $HOME/histbuff; history -r $HOME/histbuff;
}

export PROMPT_COMMAND="sterile"

```

###### Quickly backup a file

```bash


Chargement…
Annuler
Enregistrer