apt install unattended-upgrades apt-config-auto-updatecat <<'EOF' | tee /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian";| #!/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, |
| #!/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 |
| #!/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 |
cfg = rs.conf()
cfg.members[0]["host"] = "[insert_correct_hostname_or_ip]:27017"
rs.reconfig(cfg)
| #!/usr/bin/env bash | |
| dict2json() { | |
| local _data="" | |
| trap 'if [[ -n "${_data}" ]]; then printf "{%s}" "${_data%?}" | jq -arc .; fi' RETURN | |
| case "${#@}" in | |
| 0) | |
| return | |
| ;; | |
| 1) |
| #!/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" |
| 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)) |
| 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 { |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "os" | |
| "strings" | |
| "strconv" | |
| ) |