cfg = rs.conf()
cfg.members[0]["host"] = "[insert_correct_hostname_or_ip]:27017"
rs.reconfig(cfg)
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "os" | |
| "strings" | |
| "strconv" | |
| ) |
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
| func rotateString(s string, n int, encdec bool) (string, error) { | |
| l := len(s) | |
| if l < 1 { | |
| return "", fmt.Errorf("empty input") | |
| } | |
| if n < 1 || n > 6 { | |
| return "", fmt.Errorf("invalid shift n %d", n) | |
| } | |
| var out string | |
| switch encdec { |
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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| s := "He turned in the research paper on Friday; otherwise, he would have not passed the class." | |
| fmt.Printf("%s\nlenght:%d\n", s, len(s)) |
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
| #!/usr/bin/env bash | |
| declare -A CHART=( | |
| ["a"]="alpha" ["b"]="bravo" ["c"]="charlie" | |
| ["d"]="delta" ["e"]="echo" ["f"]="foxtrot" | |
| ["g"]="golf" ["h"]="hotel" ["i"]="india" | |
| ["j"]="juliet" ["k"]="kilo" ["l"]="lima" | |
| ["m"]="mike" ["n"]="november" ["o"]="oscar" | |
| ["p"]="papa" ["q"]="quebec" ["r"]="romeo" | |
| ["s"]="sierra" ["t"]="tango" ["u"]="uniform" |
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
| #!/usr/bin/env bash | |
| dict2json() { | |
| local _data="" | |
| trap 'if [[ -n "${_data}" ]]; then printf "{%s}" "${_data%?}" | jq -arc .; fi' RETURN | |
| case "${#@}" in | |
| 0) | |
| return | |
| ;; | |
| 1) |
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
| #!/usr/bin/env bash | |
| set -xeuo pipefail | |
| DISK="${1}" | |
| _DISKNAME="$(basename "${DISK}")" | |
| openssl rand 4096 >"${_DISKNAME}.key" | |
| yes YES | cryptsetup luksFormat -d "${_DISKNAME}.key" "${DISK}" || true |
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 -x | |
| sleep 15 | |
| _uqmi="/sbin/uqmi" | |
| ifdown WWAN || true | |
| _cleanup() { | |
| /usr/bin/killall "${_uqmi}" 2>/dev/null || true | |
| for i in $(/bin/ps www | /usr/bin/awk '/uqmi/ && /cdc-wdm0/ && !/awk/ {print $1}'); do |
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
| #!/usr/bin/env python3 | |
| # --- | |
| # Copyright 2020 glowinthedark | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # | |
| # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, |
OlderNewer