This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo port sync | |
sudo port upgrade outdated | |
sudo port uninstall inactive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" == "" ] ; then | |
echo $0 hostname.example.com | |
fi | |
host=`echo $1 | cut -d "@" -f 2` | |
ssh-keygen -R $host -f ~/.ssh/known_hosts | |
revp=`host $host | grep "has address" | sed -e "s/.*address //g"` | |
ssh-keygen -R $revp -f ~/.ssh/known_hosts 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cadir=/etc/openvpn/easy-rsa/ | |
openvpn_conf=/etc/openvpn/server.conf | |
rm -fr ${cadir} | |
grep ID=debian /etc/os-release 2>&1 >/dev/null | |
if [ $? -eq 0 ] ; then | |
os_family=debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
osds=$(echo /dev/sd{a..p}) | |
partition_no=1 | |
if [ "${1}" == "--yes-really-do-it" ] ; then | |
make_modifications=true | |
fi | |
run_or_print() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
num_partitions=16 | |
dev=/dev/nvme0n1 | |
# to mount disks: | |
# ceph-disk list | grep osd\. | awk '{print $1, $7}' | sed -e "s/osd\./\/var\/lib\/ceph\/osd\/ceph\-/" | |
let size=$(sudo parted ${dev} print | grep "Disk ${dev}" | sed -e "s/Disk.*: //" -e "s/GB//")/num_partitions | |
sudo parted -s ${dev} mklabel gpt | |
osds=$(mount | grep ceph\- | sed -e "s/.*ceph\-//" -e "s/ .*//") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
grep slow /var/log/ceph/ceph.log | cut -d " " -f 3 | sort | uniq -c | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for osd in $(ceph osd tree | awk '{print $3}' | grep ^osd | sort | uniq) ; do | |
ceph osd deep-scrub ${osd} | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for osd in $(systemctl --all | grep ceph-osd\@ | cut -d " " -f 3 | grep -v target) ; do | |
systemctl stop ${osd} | |
sleep 30 | |
systemctl start ${osd} | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
num_partitions=16 | |
dev=/dev/nvme0n1 | |
let size=$(sudo parted ${dev} print | grep "Disk ${dev}" | sed -e "s/Disk.*: //" -e "s/GB//")/num_partitions | |
sudo parted -s ${dev} mklabel gpt | |
start=0 | |
for part in $(seq 1 ${num_partitions}) ; do |