Skip to content

Instantly share code, notes, and snippets.

View Devp00l's full-sized avatar

Stephan Müller Devp00l

  • https://www.westermanngruppe.de/
  • Germany
View GitHub Profile
@Devp00l
Devp00l / search-and-replace.sh
Last active May 19, 2022 08:14
search and replace
#!/bin/bash
#$1 search-word
#$2 replace-word
for i in $(ack "$1" . -l); do
sed -i "s/$1/$2/g" $i
done
@Devp00l
Devp00l / deleteAllCephFsSnapshots.sh
Created December 16, 2019 16:50
A way to delete all CephFS snapshots in a given directory
#!/bin/bash
#$1 = CephFS directory
# Snapshots starting with underscore names are related to snapshots based in a higher directory and can't be used.
# Therefore they are filterd out with `grep`
find $1 -type d | while read i; do
ls --color=none $i/.snap | while read j; do
echo $i/.snap/$j
done