From: Ian Kelling Date: Thu, 18 Apr 2024 02:08:51 +0000 (-0400) Subject: consistent license, various updates X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=f898fa23c5a5f455bf300fb48e57641e290334fb;p=buildscripts consistent license, various updates --- diff --git a/README b/README index 281a524..ee00d0b 100644 --- a/README +++ b/README @@ -1,4 +1,38 @@ -Build and install misc software +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +The following is the GNU All-permissive License as recommended in + + +Copyright (C) 2024 Ian Kelling + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without any warranty. + +Ian's scripts to build and install misc software + +Most of these are not in use and may have bitrotted, grep -r my +distro-setup repo for the ones that are. Please email me if you have a patches, bugs, feedback, or republish this somewhere else: Ian Kelling . diff --git a/alacritty b/alacritty index dcf68f6..ca175c7 100755 --- a/alacritty +++ b/alacritty @@ -1,8 +1,27 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: GPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. -source /a/bin/errhandle/err +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +source /a/bin/bash-bear-trap/bash-bear source /a/bin/distro-functions/src/package-manager-abstractions diff --git a/bbb b/bbb index 73aac2a..e0dc87e 100755 --- a/bbb +++ b/bbb @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # misc interesting: # https://github.com/sergeyksv/tingodb diff --git a/debbugs b/debbugs new file mode 100644 index 0000000..3ddc2c4 --- /dev/null +++ b/debbugs @@ -0,0 +1,26 @@ +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# initial setup: +# as root +cp -ra /var/lib/debbugs /o +debbugsconfig diff --git a/elisp b/elisp index 087e53b..edd5208 100755 --- a/elisp +++ b/elisp @@ -1,5 +1,12 @@ #!/bin/bash -# Copyright (C) 2016 Ian Kelling +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +20,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi if [[ $1 == -u ]]; then diff --git a/emacs b/emacs index f4444f8..01a6600 100755 --- a/emacs +++ b/emacs @@ -1,5 +1,12 @@ #!/bin/bash -# Copyright (C) 2016 Ian Kelling +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +20,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi #set -x diff --git a/emacstrisquel7 b/emacstrisquel7 index 3abb069..d9f0d93 100644 --- a/emacstrisquel7 +++ b/emacstrisquel7 @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # one off for ted to get a newer emacs diff --git a/esniper b/esniper index a9bf588..f6f7ea8 100755 --- a/esniper +++ b/esniper @@ -1 +1,21 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/exim b/exim index 24ed030..34dd8d7 100644 --- a/exim +++ b/exim @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # libgcrypt-dev is a test dependency # libidn11-dev is some build dep for newer version not in diff --git a/go b/go index d948b9d..d58bca7 100755 --- a/go +++ b/go @@ -1,13 +1,32 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # usage: no args, run to install latest go. if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 -source /a/bin/errhandle/err +source /usr/local/lib/bash-bear force=false case $1 in @@ -19,6 +38,11 @@ e() { printf "$pre %s\n" "$*"; } err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $0: $*" >&2; } +if [[ ! -d /a/opt/go.git ]]; then + mkdir -p /a/opt + cd /a/opt + git clone --bare https://go.googlesource.com/go +fi m cd /a/opt/go.git @@ -54,6 +78,7 @@ fi if $up; then m git fetch --tags + mkdir -p ~/.local touch ~/.local/gofetch vers=($(git tag | sort -Vr | grep -E '^go[0-9.]+$' | head)) diff --git a/kitty b/kitty index 2fa8372..07a5e51 100755 --- a/kitty +++ b/kitty @@ -1,6 +1,27 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. -source /a/bin/errhandle/err +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +source /a/bin/bash-bear-trap/bash-bear if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi diff --git a/librecaptcha b/librecaptcha index cf7444a..6cb5531 100755 --- a/librecaptcha +++ b/librecaptcha @@ -1,5 +1,12 @@ #!/bin/bash -# Copyright (C) 2020 Ian Kelling +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +20,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi pi libgirepository1.0-dev python3-dev diff --git a/mblaze b/mblaze index 93226e4..adeb5b5 100755 --- a/mblaze +++ b/mblaze @@ -1,5 +1,29 @@ #!/bin/bash -f=/usr/local/lib/err;test -r $f || { echo "error: $0 no $f" >&2;exit 1;}; . $f +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e; . /usr/local/lib/bash-bear; set +e + +# I can't remember why I built this from source. +# It exists in the repo. Oh well. cd /a/opt/mblaze make diff --git a/misc b/misc index 7aba402..c304d61 100755 --- a/misc +++ b/misc @@ -1,16 +1,32 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR -# alternatively, using https://iankelling.org/git/?p=errhandle;a=tree -# source /path/errhandle/err -# on my machine -source /a/bin/errhandle/err +source /a/bin/bash-bear-trap/bash-bear # fuck pip. i hate it. # pip install --user -U pip diff --git a/mu4e b/mu4e index b87990c..5673bb5 100755 --- a/mu4e +++ b/mu4e @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi diff --git a/mumble b/mumble index b118cac..7362cf5 100755 --- a/mumble +++ b/mumble @@ -1,6 +1,25 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 diff --git a/navidrome b/navidrome index 16425d0..2956200 100755 --- a/navidrome +++ b/navidrome @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # example https://github.com/navidrome/navidrome/releases/download/v0.48.0/navidrome_0.48.0_Linux_x86_64.tar.gz up=$(wget -q -O- https://api.github.com/repos/navidrome/navidrome/releases/latest | jq -r .assets[].browser_download_url | grep Linux_x86_64) diff --git a/nodejs b/nodejs index fb3a4ec..192f1e9 100755 --- a/nodejs +++ b/nodejs @@ -1,4 +1,25 @@ #!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + #https://github.com/nodesource/distributions/blob/master/README.md KEYRING=/usr/share/keyrings/nodesource.gpg diff --git a/org-mode b/org-mode index c9d0b1d..60a3a8c 100755 --- a/org-mode +++ b/org-mode @@ -1,5 +1,12 @@ #!/bin/bash -# Copyright (C) 2016 Ian Kelling +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +20,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + # git clone git://orgmode.org/org-mode.git # texinfo is all that is technically needed, but having tex for math is good diff --git a/pithosfly b/pithosfly index 9df698f..8676ae0 100755 --- a/pithosfly +++ b/pithosfly @@ -1,6 +1,25 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi diff --git a/prom-node-exporter b/prom-node-exporter deleted file mode 100755 index c75b496..0000000 --- a/prom-node-exporter +++ /dev/null @@ -1,273 +0,0 @@ -#!/bin/bash - -if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi -shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 -set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR - -[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" - - -usage() { - cat </dev/null; then - apt-get -y install $p - fi - done -fi -if $do_setup && ! type -t rsync &>/dev/null; then - # note: we could use diff or cmp instead. - apt-get -y install rsync -fi - -sysd_reload=false -installed_file=false - -i() { # install file - local tmp tmpdir dest="$1" - local base="${dest##*/}" - local dir="${dest%/*}" - if [[ $dir != "$base" ]]; then - # dest has a directory component - mkdir -p "$dir" - fi - tmpdir=$(mktemp -d) - cat >$tmpdir/"$base" - tmp=$(rsync -ic $tmpdir/"$base" "$dest") - if [[ $tmp ]]; then - printf "%s\n" "$tmp" - installed_file=true - if [[ $dest == /etc/systemd/system/* ]]; then - sysd_reload=true - fi - fi - rm -rf $tmpdir -} - - -if $dl_bin; then - if [[ -s /usr/local/src/node-exporter-url ]]; then - installed_url=$(cat /usr/local/src/node-exporter-url) - fi - url=$(curl -s https://api.github.com/repos/prometheus/node_exporter/releases/latest | jq -r '.assets[].browser_download_url | match(".*linux-amd64.tar.gz$").string') - if [[ ! $url ]]; then - echo $0: error failed to get url - exit 1 - fi - if [[ $url != "$installed_url" ]]; then - tmpdir=$(mktemp -d) - cd $tmpdir - f=${url##*/} - wget -nv $url - tar -xf $f - dir=${f%.tar.gz} - install $dir/node_exporter /usr/local/bin/prometheus-node-exporter - printf "%s\n" "$url" >/usr/local/src/node-exporter-url - cd - rm -rf $tmpdir - fi -fi - -if ! $do_setup; then - exit 0 -fi - -# taken from postinstall script -if ! getent passwd prometheus &>/dev/null; then - adduser --quiet --system --home /var/lib/prometheus --no-create-home \ - --group --gecos "Prometheus daemon" prometheus -fi - - -# textfile collector dir -mkdir -p /var/lib/prometheus/node-exporter - -chown prometheus:prometheus /var/lib/prometheus - - -i /etc/default/prometheus-node-exporter < -# Author: Guillem Jover - -DESC="Prometheus exporter for machine metrics" -NAME=prometheus-node-exporter -USER=prometheus -GROUP=$USER -DAEMON=/usr/bin/$NAME -PIDFILE=/run/prometheus/$NAME.pid -LOGFILE=/var/log/prometheus/$NAME.log - -START_ARGS="--no-close --background --make-pidfile" -STOP_ARGS="--remove-pidfile" - -do_start_prepare() -{ - mkdir -p $(dirname $PIDFILE) -} - -do_start_cmd_override() -{ - start-stop-daemon --start --quiet --oknodo \ - --exec $DAEMON --pidfile $PIDFILE --user $USER --group $GROUP \ - --chuid $USER:$GROUP $START_ARGS -- $ARGS >>$LOGFILE 2>&1 -} - -do_stop_cmd_override() -{ - start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 \ - --exec $DAEMON --pidfile $PIDFILE --user $USER $STOP_ARGS -} - -alias do_reload=do_reload_sigusr1 -EOF - chmod +x /etc/init.d/prometheus-node-exporter - - mkdir -p /var/log/prometheus - chown prometheus:prometheus /var/log/prometheus - update-rc.d prometheus-node-exporter defaults - - running=false - if type -t pgrep &>/dev/null && pgrep -f prometheus-node-exporter &>/dev/null; then - running=true - fi - if $installed_file || ! $running; then - /etc/init.d/prometheus-node-exporter restart - fi - - i /etc/logrotate.d/prometheus-node-exporter <<'EOF' -/var/log/prometheus/prometheus-node-exporter.log { - weekly - rotate 10 - copytruncate - compress - delaycompress - notifempty - missingok -} -EOF - -fi diff --git a/prometheus b/prometheus deleted file mode 100755 index e7e3233..0000000 --- a/prometheus +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# I initially was using these -# https://github.com/cloudalchemy/ansible-prometheus -# https://github.com/cloudalchemy/ansible-alertmanager -# https://github.com/cloudalchemy/ansible-node-exporter -# https://github.com/cloudalchemy/ansible-grafana - -# As of trisquel 11, get upstream prom because it has the react ui, -# which has localtime, and general better usability. alertmanager, -# changelog seems to show good changes and surely things will just work -# better with a matching prometheus. - -if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi - -#rsync --delete consoles console_libraries /etc/prometheus - - -while read -r prog tool; do - cd /a/opt/${prog}dl - url=$(curl -s https://api.github.com/repos/prometheus/$prog/releases/latest | jq -r '.assets[].browser_download_url | match(".*linux-amd64.tar.gz$").string') - f=${url##*/} - if [[ -e $f ]]; then - timestamp=$(stat -c %Y $f) - else - timestamp=0 - fi - m wget -nv -N $url - new_timestamp=$(stat -c %Y $f) - if [[ $timestamp != $new_timestamp || ! -e /usr/local/bin/$prog ]]; then - ngset - to_rm=( !($f) ) - ngreset - if (( ${#to_rm[@]} )); then - rm -rf ${to_rm[@]} - fi - m ex $f - dir=${f%.tar.gz} - m sudo install $dir/$prog $dir/$tool /usr/local/bin - m sudo systemctl restart $prog - fi -done <<'EOF' -prometheus promtool -alertmanager amtool -EOF diff --git a/rust b/rust index 5ed2870..58009fe 100755 --- a/rust +++ b/rust @@ -1,11 +1,27 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. -# alternatively, using https://iankelling.org/git/?p=errhandle;a=tree -# source /path/errhandle/err -# on my machine -source /a/bin/errhandle/err +# Copyright 2024 Ian Kelling + +# 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, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +source /a/bin/bash-bear-trap/bash-bear source /a/bin/distro-functions/src/package-manager-abstractions PATH="$PATH:$HOME/.cargo/bin" @@ -17,7 +33,16 @@ hash -r if type -t rustc &>/dev/null; then rustup update else - curl https://sh.rustup.rs -sSf | bash -s -- -y + + # added stable due to this error +# Mar 11 00:13:15 info: no updatable toolchains installed +# Mar 11 00:13:15 info: checking for self-update +# Mar 11 00:13:15 info: cleaning up downloads & tmp directories +# Mar 11 00:13:15 error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured. +# Mar 11 00:13:15 help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain. +# Mar 11 00:13:15 /a/bin/buildscripts/rust:31: `cargo install-update -a' returned 1 + + curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain stable -y fi if ! which rg &>/dev/null; then @@ -32,3 +57,9 @@ if ! type -t cargo-install-update &>/dev/null; then fi cargo install-update -a + +# https://github.com/rust-lang/cargo/issues/3289 +# 149 mb on fresh install as of 07-2023 +if du -s -t 500M ~/.cargo/registry | grep . &>/dev/null; then + rm -rf ~/.cargo/registry +fi diff --git a/tor-browser b/tor-browser index 9883473..923c4e3 100755 --- a/tor-browser +++ b/tor-browser @@ -1,5 +1,12 @@ #!/bin/bash -# Copyright (C) 2016 Ian Kelling +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +20,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi diff --git a/update-builds b/update-builds deleted file mode 100755 index 091ee60..0000000 --- a/update-builds +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - - -x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*} -for x in *; do - if [[ $x == update-builds || ! -x $x || -d $x ]]; then - continue - fi - $x -u -done