This file contains hidden or 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 | |
| # This is really dangerous command. | |
| # Please be CAREFUL | |
| TARGET_OSD_ID="$1" # 6 | |
| TARGET_HOST_NAME=$(ceph orch ps --daemon_type osd --format json| jq -r '.[] | select(.daemon_id == '\""$TARGET_OSD_ID"\"') | .hostname') | |
| TARGET_DAEMON_NAME=$(ceph orch ps --daemon_type osd --format json | jq -r '.[] | select(.daemon_id == '\""$TARGET_OSD_ID"\"') | .daemon_name') | |
| TARGET_OSD_DEV_PATH=$(ceph device ls-by-host "${TARGET_HOST_NAME}" --format json | jq -r '.[] | select(.daemons[] | contains('\""${TARGET_DAEMON_NAME}"\"')) | .location[] | .dev') | |
| # ceph orch ls --service_type osd --format json | jq -c '.[] | select(.spec.data_devices.paths != null) | select(.spec.data_devices.paths[] | contains('\"${TARGET_OSD_DEV_PATH}\"')) | select(.placement.hosts != null) | select(.placement.hosts[] | contains('\"${TARGET_HOST_NAME}\"'))' |
This file contains hidden or 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 | |
| version=$(git rev-parse HEAD | cut -c1-8) | |
| version="0.1.7-nightly-$version" | |
| sed -i "/EXTCTRL_VERSION = \"/c\ EXTCTRL_VERSION = \"$version\";" ./main.cpp |
This file contains hidden or 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
| # ceph orch apply -i add_osd.yaml | |
| service_type: osd | |
| service_id: osd_localhost | |
| placement: | |
| hosts: | |
| - node1 | |
| data_devices: | |
| paths: | |
| - /dev/sdb | |
| - /dev/sdc |
This file contains hidden or 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 | |
| function snakecase_to_camelCase() { | |
| local ret | |
| ret=$(echo $1 | sed -E 's/_(.)/\U\1/g') | |
| echo "$ret" | |
| } | |
| SomeString="snakecase_looks_very_bad" | |
| camelCase=$(snakecase_to_camelCase "$SomeString") |
This file contains hidden or 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
| function camelcase_to_snakecase() { | |
| local ret | |
| ret=$(echo "$1" | sed -r 's/([A-Z])/_\L\1/g' | sed 's/^_//') | |
| echo "$ret" | |
| } | |
| SomeString="helloWorldMyFriend" | |
| snake_case=$(camelcase_to_snakecase "${SomeString}") | |
| echo $snake_case |
This file contains hidden or 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 | |
| function all_uppercase() { | |
| local ret=${1^^} # Make input parameter Upper case. Should be declared in local variable. | |
| echo "$ret" # This is like return. | |
| } | |
| SomeString="HelloWorld" | |
| UpperCase=$(all_uppercase "${SomeString}") | |
| echo $UpperCase |
This file contains hidden or 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
| CREATE TYPE SUBUSER AS OBJECT ( | |
| ID VARCHAR2(200), | |
| PERMISSIONS VARCHAR2(12) | |
| ); | |
| CREATE TYPE SUBUSERS AS VARRAY(1000) OF SUBUSER; -- Nested Table type. | |
| CREATE TABLE USER ( | |
| UID VARCHAR2(50), | |
| SUBUSERS_COLUMN SUBUSERS -- An Instance of Nested Table |
This file contains hidden or 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 | |
| ########################### | |
| # Information | |
| # Host 1 (node1): 172.22.4.101 - admin | |
| # host 2 (node2): 172.22.4.102 | |
| # host 3 (node3): 172.22.4.103 | |
| # host 4 (node4): 172.22.4.104 | |
| # host 5 (node5): 172.22.4.105 | |
| ########################### |
This file contains hidden or 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 | |
| ########################### | |
| # Information | |
| # Host 1 (node1): 172.22.4.101 - admin | |
| # host 2 (node2): 172.22.4.102 | |
| # host 3 (node3): 172.22.4.103 | |
| # host 4 (node4): 172.22.4.104 | |
| # host 5 (node5): 172.22.4.105 | |
| ########################### |
This file contains hidden or 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 | |
| ################# README ################# | |
| # Please run this scripts on admin node! # | |
| # Please set whether all SSH keys are removed from all HOSTs | |
| ssh_remove=false | |
| ########################################## | |
| # https://www.flamingbytes.com/posts/uninstall-ceph/ | |
| ################################################# | |
| # Variable targetDisk should be configured. # |