diff --git a/.Xdefaults b/.Xdefaults index be70d90..906455f 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -117,7 +117,7 @@ st*selectToClipboard: true st*disallowedWindowOps: 20,21,SetXprop ! st.termname: st-256color st.borderpx: 0 -st.font: Hack Nerd Font Mono:size=9:antialias=true:autohint=true +st.font: Hack Nerd Font Mono:pixelsize=12:antialias=true:autohint=true st.alpha: 0.9 st.alphaOffset: 0.0 st.alphaUnfocus: 0.0 @@ -132,6 +132,7 @@ Xft.antialias: 1 Xft.hinting: true !Xft.hintstyle: hintslight Xft.hintstyle: hintfull +/* This is the default DPI and unfortunately does not scale according to Gnome: */ Xft.dpi: 96 !Xft.rgba: rgb Xft.rgba: none diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0c07e72 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +# Using [[shell]] rather than [*.sh] will capture files with no extension +[[shell]] +# Used by shfmt +indent_style = space +indent_size = 4 +;shell_variant = posix +binary_next_line = true +switch_case_indent = true +space_redirects = true +;keep_padding = true +simplify = true +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0b487f6 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +[flake8] +extend-ignore = E203 +max-line-length = 88 +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.gitattributes b/.gitattributes index 37f0f82..67cfa50 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,83 @@ /config/shell_gpt/roles/veronica.json filter=git-crypt diff=git-crypt /config/weechat/sec.conf filter=git-crypt diff=git-crypt /scripts/supermicro_ipmi.sh filter=git-crypt diff=git-crypt + +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +# Images +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.gif filter=lfs diff=lfs merge=lfs -text +*.bmp filter=lfs diff=lfs merge=lfs -text +*.tiff filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text + +# Audio +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.m4a filter=lfs diff=lfs merge=lfs -text +*.flac filter=lfs diff=lfs merge=lfs -text + +# Video +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.mov filter=lfs diff=lfs merge=lfs -text +*.avi filter=lfs diff=lfs merge=lfs -text +*.flv filter=lfs diff=lfs merge=lfs -text +*.wmv filter=lfs diff=lfs merge=lfs -text +*.mpeg filter=lfs diff=lfs merge=lfs -text +*.mkv filter=lfs diff=lfs merge=lfs -text + +# Archives +*.zip filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text + +# Large data +*.csv filter=lfs diff=lfs merge=lfs -text +*.xml filter=lfs diff=lfs merge=lfs -text + +# Disabled because these are often used for settings: +# *.json filter=lfs diff=lfs merge=lfs -text + +# Executables and libraries +*.exe filter=lfs diff=lfs merge=lfs -text +*.dll filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text + +# Fonts +*.ttf filter=lfs diff=lfs merge=lfs -text +*.otf filter=lfs diff=lfs merge=lfs -text + +# 3D Models +*.obj filter=lfs diff=lfs merge=lfs -text +*.fbx filter=lfs diff=lfs merge=lfs -text +*.stl filter=lfs diff=lfs merge=lfs -text + +# Design files +*.psd filter=lfs diff=lfs merge=lfs -text +*.ai filter=lfs diff=lfs merge=lfs -text + +# Documents +*.pdf filter=lfs diff=lfs merge=lfs -text + +# Packet Captures +*.pcap filter=lfs diff=lfs merge=lfs -text +*.pcapng filter=lfs diff=lfs merge=lfs -text +*.cap filter=lfs diff=lfs merge=lfs -text +*.dmp filter=lfs diff=lfs merge=lfs -text +*.5vw filter=lfs diff=lfs merge=lfs -text +*.pkt filter=lfs diff=lfs merge=lfs -text +*.net filter=lfs diff=lfs merge=lfs -text + +# Various Binaries +*.bin filter=lfs diff=lfs merge=lfs -text +*.dat filter=lfs diff=lfs merge=lfs -text +*.bit filter=lfs diff=lfs merge=lfs -text +*.sqlite filter=lfs diff=lfs merge=lfs -text +*.db filter=lfs diff=lfs merge=lfs -text +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54b268e..ecc400e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,13 +2,10 @@ name: Lint Build Publish on: # yamllint disable-line rule:truthy - push: null - pull_request: null - -permissions: {} - + push: + pull_request: jobs: - build: + lint: name: Lint runs-on: ubuntu-latest @@ -31,10 +28,183 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # JSCPD is actually finding valid duplicates... but it sucks to fix right now. + VALIDATE_JSCPD: false + # Ignore files which are scratch notes, encrypted + # https://regex101.com/r/b2rUJw/2 + FILTER_REGEX_EXCLUDE: \.sample-secret\.md|\/config\/(shell_gpt\/roles\/|weechat\/.*(pl|py|lua)|awesome\/.*lua)|\/scripts\/supermicro_ipmi\.sh|notes\/.*\.md - name: Check .zshrc source idempotency run: ./test/source_idempotency.zsh + build-archlinux: + name: Arch Linux Docker Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: dotfiles + tags: latest,archlinux + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 + with: + context: . + file: ./Dockerfile.archlinux + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-fedora: + name: Fedora Docker Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: dotfiles + tags: fedora + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 + with: + context: . + file: ./Dockerfile.fedora + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-gentoo: + name: Gentoo Docker Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: dotfiles + tags: gentoo + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 + with: + context: . + file: ./Dockerfile.gentoo + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-debian: + name: Debian Docker Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: dotfiles + tags: debian + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 + with: + context: . + file: ./Dockerfile.debian + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-brew: + name: Brew Docker Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + - name: Log in to Docker Hub uses: docker/login-action@v3.1.0 with: @@ -45,13 +215,14 @@ jobs: id: meta uses: docker/metadata-action@v5.5.1 with: - images: dotfiles:latest + images: dotfiles + tags: brew - name: Build and push Docker image uses: docker/build-push-action@v5.3.0 with: context: . - file: ./Dockerfile + file: ./Dockerfile.brew push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 290ab41..bb2710b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,175 @@ config/weechat/*.log /.blackbox/secring.gpg /config/ranger/bookmarks /config/weechat/script/plugins.xml.gz + +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +# NOTE: You cannot add comments to the *end* of a line, only the beginning! +# https://git-scm.com/docs/gitignore + +# Build directories +/bin/ +/obj/ +/out/ +/build/ +/target/ + +# Rust / Cargo +## These are backup files generated by rustfmt +**/*.rs.bk + +## MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE specific files +/.idea/ +/.vscode/ +*.swp +*.swo +*~ +*.sublime-workspace + +# Compiled source +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Logs and databases +*.log +*.sql +*.sqlite +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +/node_modules/ +/jspm_packages/ +/bower_components/ + +## Grunt intermediate storage +.grunt + +# Python +*.py[cod] +__pycache__/ +*.pyc + +# Virtual environments +venv/ +## NOTE: Sometimes this is a file (not a directory) that acts as a pointer. +.venv + +# Runtime data +pids +*.pid +*.seed +.cache/ +.pytest_cache/ + +## mypy +.mypy_cache/ + +## poetry +poetry.lock + +## Jupyter Notebook +.ipynb_checkpoints + +## pyenv +.python-version + +## pipenv +Pipfile.lock + +# Coverage +## Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +## Coverage directory used by tools like istanbul +coverage + +## nyc test coverage +.nyc_output + +# NodeJS +## node-waf configuration +.lock-wscript + +## Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +## TypeScript v1 declaration files +typings/ + +## Optional npm cache directory +.npm + +## Optional eslint cache +.eslintcache + +## TernJS port file +.tern-port + +## parcel-bundler cache (https://parceljs.org/) +.cache + +## Yarn Integrity file +.yarn-integrity + +## next.js build output +.next + +## nuxt.js build output +.nuxt + +## vuepress build output +.vuepress/dist + +## Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Terraform +*.tfstate +*.tfstate.* + +## Local .terraform directories +**/.terraform/* + +## Ignore any .tfvars files that are generated automatically for each Terraform run. Most +## .tfvars files are managed as part of configuration and so should be included in +## version control. +## +## example.tfvars + +## Ignore override files as they are usually used to override resources locally and so +## are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json +## Include override files you do wish to add to version control using negated pattern +## +## !example_override.tf + +## Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +## example: *tfplan* +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.gitleaksignore b/.gitleaksignore new file mode 100644 index 0000000..cd3bb00 --- /dev/null +++ b/.gitleaksignore @@ -0,0 +1 @@ +/github/workspace/config/weechat/irc.conf:hashicorp-tf-password:59 diff --git a/.lcovrc.gcov.css b/.lcovrc.gcov.css index 6eb6a4b..b97bbb3 100644 --- a/.lcovrc.gcov.css +++ b/.lcovrc.gcov.css @@ -1,21 +1,22 @@ +/* stylelint-disable selector-class-pattern */ /* @import url("https://fonts.googleapis.com/css?family=Source Code Pro|Quicksand"); */ :root { - --textColor: #e2e2e2; - --mainBg: #1b1b1b; - --linkColor: #3294ff; + --text-color: #e2e2e2; + --main-background: #1b1b1b; + --link-color: #3294ff; --lighter: #ffffff05; --red: #ff511a; - --redBg: #ff511a22; + --red-background: #ff511a22; --yellow: #a68f01; - --yellowBg: #a68f0122; + --yellow-background: #a68f0122; --green: #4ca340; - --greenBg: #4ca34022; + --green-background: #4ca34022; } a, a:visited { - color: var(--linkColor); + color: var(--link-color); text-decoration: none; } @@ -24,9 +25,9 @@ body center table tbody tr:nth-child(even):not(:nth-child(2)) { } body { - font-family: "FreeSans", "Helvetica", "Roboto", sans-serif; - background-color: var(--mainBg); - color: var(--textColor); + font-family: FreeSans, Helvetica, Roboto, sans-serif; + background-color: var(--main-background); + color: var(--text-color); } center table { @@ -50,7 +51,7 @@ td.coverBar > table { /*code-related style is below this line*/ .source > a { - color: var(--textColor); + color: var(--text-color); font-family: "Hack Nerd Font Mono", "Source Code Pro", "Deja Vu Sans Mono", monospace; } @@ -68,11 +69,11 @@ span.lineCov, .coverLegendCov, .coverLegendCovHi, .tlaBgGNC { - background-color: var(--greenBg); + background-color: var(--green-background); } .coverLegendCovMed { - background-color: var(--yellowBg); + background-color: var(--yellow-background); color: var(--yellow); } @@ -94,7 +95,7 @@ span.lineNoCov, .coverLegendNoCov, .coverLegendCovLo, .tlaBgUNC { - background-color: var(--redBg); + background-color: var(--red-background); } .source { diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e2af32d..9b8d6df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +--- # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: @@ -6,7 +8,7 @@ repos: hooks: - id: check-json - id: pretty-format-json - args: ["--autofix"] + args: [--autofix] - id: check-yaml - id: check-toml - id: trailing-whitespace @@ -24,7 +26,81 @@ repos: hooks: - id: hadolint-docker + - repo: https://github.com/pecigonzalo/pre-commit-shfmt + rev: v2.2.0 + hooks: + - id: shell-fmt-docker + args: + - -w + - repo: https://github.com/koalaman/shellcheck-precommit rev: v0.9.0 hooks: - id: shellcheck + + - repo: https://github.com/ansible/ansible-lint + # put latest release tag from + # https://github.com/ansible-community/ansible-lint/releases/ + rev: v24.6.1 + hooks: + - id: ansible-lint + files: \.(yaml|yml)$ + args: [--fix, --format, pep8] + additional_dependencies: + - jmespath + + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + # See + # https://pycqa.github.io/isort/docs/configuration/black_compatibility.html + args: [--profile, black, --filter-files] + + # This mirror is about 2x faster because it is compiled with mypyc. + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.12.1 + hooks: + - id: black + args: [--line-length=88] + language_version: python3.12 + + # To ignore these, use `# noqa: E123` at the end of the line. + - repo: https://github.com/PyCQA/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + # See https://github.com/PyCQA/pycodestyle/issues/373 + # + # We are ignoring E501 because black already takes care of line length, + # and Flake8 is trigger happy. + args: + - --max-line-length=88 + - --extend-ignore=E203 + - --extend-ignore=E501 + + # To ignore these, use `# nosec` at the end of the line. + - repo: https://github.com/PyCQA/bandit + rev: 1.7.6 + hooks: + - id: bandit + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-check-blanket-noqa + - id: python-check-mock-methods + - id: python-no-eval + - id: python-no-log-warn + - id: python-check-blanket-type-ignore + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.8.0 + hooks: + - id: mypy + additional_dependencies: + - types-requests + - types-setuptools + - types-paramiko + - types-toml +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.tmux.conf b/.tmux.conf index d969d22..62754c5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,6 +1,3 @@ -# cat << EOF > /dev/null -# The above line allows us to embed bash at the end of the file. - # Automatically install TPM if not already installed. if "test ! -d ~/.tmux/plugins/tpm" \ "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'" @@ -95,12 +92,11 @@ set-option -g prefix C-a # Use zsh by default. #set-option -g default-shell /bin/zsh -# Instead of doing this, rely on $SHELL via `chsh -s "$(command -v zsh)"`. It's -# BSD friendly. +# Instead of doing this, rely on $SHELL. It's BSD friendly. # Key bindings. -bind-key v split-window -h -bind-key b split-window +bind-key v split-window -h -c "#{pane_current_path}" +bind-key b split-window -c "#{pane_current_path}" ## Resize with Alt-arrow. ## NOTE: Conflicts with Weechat! @@ -219,7 +215,7 @@ set-option -g status-position top ## Status bar formatting. set -g status-left '#[fg=colour232]#[bg=colour255]  #H:#S #[fg=colour255]#[bg=colour249]\ -#[fg=colour232]#[bg=colour249] 󰖩 #(cut -c3- ~/.tmux.conf | sh -s _ip_address) #{prefix_highlight}\ +#[fg=colour232]#[bg=colour249] 󰖩 #(cat ~/.tmux.sh | sh -s _ip_address) #{prefix_highlight}\ #[default]' set -g status-right '#[default]\ @@ -235,32 +231,3 @@ if "test ! -d ~/.tmux/plugins/tpm" \ # Must remain at bottom to kick off TPM. run -b '$HOME/.tmux/plugins/tpm/tpm' - -# Embedded bash script. -# EOF -# -# # Exit the script if any statement returns a non-true return value. -# set -e -# -# export LC_NUMERIC=C -# -# __newline=' -# ' -# -# _apply() { -# echo "Embedded bash applied." -# } -# -# _ip_address() { -# ip -brief -4 a show | awk -F'[\t\n/ ]+' '$2 == "UP" { print $3; exit}' -# } -# -# _used_cpu_percent() { -# top -bn1 | sed -n '/Cpu/p' | awk '{printf("%.1f", 100.0 - $8) }' -# } -# -# _used_memory_percent() { -# free | grep Mem | awk '{ printf("%.2f", $3/$2 * 100.0) }' -# } -# -# "$@" diff --git a/.tmux.sh b/.tmux.sh new file mode 100755 index 0000000..8a0ecc1 --- /dev/null +++ b/.tmux.sh @@ -0,0 +1,25 @@ +# Exit the script if any statement returns a non-true return value. +set -e + +export LC_NUMERIC=C + +__newline=' +' + +_apply() { + echo "Embedded bash applied." +} + +_ip_address() { + ip -brief -4 a show | awk -F'[\t\n/ ]+' '$2 == "UP" { print $3; exit}' +} + +_used_cpu_percent() { + top -bn1 | sed -n '/Cpu/p' | awk '{printf("%.1f", 100.0 - $8) }' +} + +_used_memory_percent() { + free | grep Mem | awk '{ printf("%.2f", $3/$2 * 100.0) }' +} + +"$@" diff --git a/.tmuxp/leviathan.yaml b/.tmuxp/leviathan.yaml new file mode 100644 index 0000000..6235cc4 --- /dev/null +++ b/.tmuxp/leviathan.yaml @@ -0,0 +1,51 @@ +--- +session_name: Leviathan +windows: + - window_name: SYS + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + panes: + - shell_command: sudo btop + focus: true + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - window_name: XMR / LLM + layout: main-vertical + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + panes: + - shell_command: ~/mine + focus: true + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - shell_command: tail -f /var/log/ollama/ollama.log + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - shell_command: tail -f /var/log/flamenco/flamenco.log + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - shell_command: kernlog + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - focus: true diff --git a/.tmuxp/main.yaml b/.tmuxp/main.yaml index 8cf91bb..ae8ab9b 100644 --- a/.tmuxp/main.yaml +++ b/.tmuxp/main.yaml @@ -1,9 +1,10 @@ +--- session_name: Main windows: - window_name: SYS environment: DISABLE_AUTO_TITLE: "true" - #focus: true + # focus: true options: allow-rename: false automatic-rename: false diff --git a/.tmuxp/maxocull.com.yaml b/.tmuxp/maxocull.com.yaml new file mode 100644 index 0000000..3703f5e --- /dev/null +++ b/.tmuxp/maxocull.com.yaml @@ -0,0 +1,39 @@ +--- +session_name: Entourage +windows: + - window_name: SYS + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + panes: + - shell_command: top + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + - window_name: DKR + layout: main-horizontal + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + panes: + - shell_command: ctop + focus: true + environment: + DISABLE_AUTO_TITLE: "true" + optionsa: + allow-rename: false + automatic-rename: false + - shell_command: docker-compose -f /opt/flotilla/docker-compose.yml logs -f + environment: + DISABLE_AUTO_TITLE: "true" + options: + allow-rename: false + automatic-rename: false + set-titles: false + - focus: true diff --git a/.warprc b/.warprc index fb4f654..4348a45 100644 --- a/.warprc +++ b/.warprc @@ -5,7 +5,7 @@ asc:~/aura/sc ch:~/.local/share/chezmoi cp:~/aura/sc/ran-cu-cp-service dl:~/Downloads -fal:~/aura/sc/integ-fos-ansible-library +fal:~/ansible_collections/aura/fos/roles fl:/opt/flotilla fos:~/aura/sc/fos-data-testsuite gvcf:~/aura/sc/gvcf-transcoder-service diff --git a/.xinitrc b/.xinitrc old mode 100644 new mode 100755 diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..97bf6c4 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,18 @@ +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +--- +extends: default + +rules: + # This should be 80, but it got WAY too annoying to deal with. + line-length: disable + + # These rules are required by ansible-lint: + comments: + min-spaces-from-content: 1 + comments-indentation: false + braces: + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/.zshrc b/.zshrc index e2c4f61..9b20f71 100644 --- a/.zshrc +++ b/.zshrc @@ -1,6 +1,8 @@ #!/usr/bin/env zsh # shellcheck shell=bash +DOTFILES_PATH="${HOME}/src/miscellaneous" + config_help=false config_benchmark=false if [[ -z "$zshrc_low_power" ]]; then @@ -37,28 +39,42 @@ zshrc_probe() { zshrc_enter_tmux() { if [[ -n "$(command -v tmux)" ]]; then - local session_count=$(tmux ls 2>/dev/null | grep "^Main" | wc -l) - if [[ "$session_count" -eq "0" ]]; then - if type tmuxp > /dev/null 2>&1; then - tmuxp load "${HOME}/.tmuxp/main.yaml" - else - tmux -2 new-session -s "Main" + local session_count=$(tmux ls 2>/dev/null | wc -l) + if type tmuxp > /dev/null 2>&1; then + if [[ -z "$TMUX" ]]; then + # If we haven't entered tmux yet, then load the tmuxp + # configuration for the current host, and attach if it already + # exists. + local host_config="${HOME}/.tmuxp/$(hostname).yaml" + if [ -s "${host_config}" ]; then + tmuxp load -y "${host_config}" + else + tmuxp load -y "${HOME}/.tmuxp/main.yaml" + fi + elif [[ -n "$TMUX" ]]; then + # If we are already in a tmux session, just display the banner for this shell. + zshrc_display_banner fi else - # Make sure we are not already in a tmux session - if [[ -z "$TMUX" ]]; then - # Session id is date and time to prevent conflict - # TODO: Make session number more... meaningful? - local session_id="$(date +%H%M%S)" - - # Create a new session (without attaching it) and link to base session - # to share windows - tmux -2 new-session -d -t Main -s "$session_id" - - # Attach to the new session & kill it once orphaned - tmux -2 attach-session -t "$session_id" \; set-option destroy-unattached + local session_count=$(tmux ls 2>/dev/null | wc -l) + if [[ "$session_count" -eq "0" ]]; then + tmux -2 new-session -s "Main" else - zshrc_display_banner + # Make sure we are not already in a tmux session + if [[ -z "$TMUX" ]]; then + # Session id is date and time to prevent conflict + # TODO: Make session number more... meaningful? + local session_id="$(date +%H%M%S)" + + # Create a new session (without attaching it) and link to base session + # to share windows + tmux -2 new-session -d -t Main -s "$session_id" + + # Attach to the new session & kill it once orphaned + tmux -2 attach-session -t "$session_id" \; set-option destroy-unattached + else + zshrc_display_banner + fi fi fi else @@ -293,7 +309,7 @@ zshrc_setup_completion() { bindkey "^I" expand-or-complete-with-dots # fi - zstyle :compinstall filename '/home/max/.zshrc' + zstyle :compinstall filename '~/.zshrc' if type rustup > /dev/null 2>&1; then if [[ ! -s "${HOME}/.zsh_completions/_rustup" ]]; then @@ -335,6 +351,28 @@ zshrc_setup_completion() { helm completion zsh > "${HOME}/.zsh_completions/_helm" fi fi + + if type docker > /dev/null 2>&1; then + if [ ! -s "${HOME}/.zsh_completions/_docker" ]; then + docker completion zsh > "${HOME}/.zsh_completions/_docker" + fi + fi + + #if type pipx > /dev/null 2>&1; then + #if [ ! -s "${HOME}/.zsh_completions/_pipx" ]; then + #register-python-argcomplete pipx > "${HOME}/.zsh_completions/_pipx" + #fi + #fi + + # Takes a lot of extra time ... + #if type molecule > /dev/null 2>&1; then + # Because it may be in a venv, we will have to do this on-demand. + #eval "$(_MOLECULE_COMPLETE=zsh_source molecule)" + + #if [ ! -s "${HOME}/.zsh_completions/_molecule" ]; then + #_MOLECULE_COMPLETE=zsh_source molecule > "${HOME}/.zsh_completions/_molecule" + #fi + #fi } zshrc_autoload() { @@ -1318,16 +1356,121 @@ zshrc_load_library() { fi } - enhance() { + image-boost() { mogrify -auto-gamma -auto-level -normalize $@ } - scale() { + image-optimize() { + for file in "$@"; do + # Strip metadata, reduce quality, and convert to sRGB. + magick "$file" -sampling-factor 4:2:0 -auto-orient -strip -quality 85 -interlace JPEG -colorspace sRGB "${file%.*}.jpg" + if [ "$file" != "${file%.*}.jpg" ]; then + rm "$file" + fi + done + } + + image-shrink() { + # Golden ratio + mogrify -resize 61.8% $@ + } + + image-enhance() { + image-shrink $@ + image-boost $@ + image-optimize $@ + } + + image-scale() { scale=$1 shift mogrify -scale $scale $@ } + audio-normalize() { + for file in "$@"; do + ffmpeg -i "$file" -filter:a loudnorm=I=-23:TP=-1.5:LRA=11 "normalized_${file}" + mv "normalized_${file}" "$file" + done + } + + # Adds reverb, slows down, and boosts the bass. + audio-boost() { + for file in "$@"; do + base="${file%.*}" + # SoX has limited output support, so we have to convert between FLAC and MP4. + ffmpeg -i "$file" "${base}.flac" + rm "$file" + + sox "${base}.flac" "boosted_${base}.flac" speed 0.85 reverb 50 equalizer 60 1q +6 + rm "${base}.flac" + + audio-optimize "boosted_${base}.flac" + mv "boosted_${base}.mp4" "${base}.mp4" + done + } + + audio-optimize() { + for file in "$@"; do + noextension="${file%.*}" + ffmpeg -i "$file" -c:a aac -b:a 192k -filter:a "volume=replaygain=track" "${noextension}.mp4" + rm "$file" + done + } + + audio-clip() { + file="$1" + start_secs="$2" + end_secs="$3" + ffmpeg -ss "$start_secs" -to "$end_secs" -i "$file" "clip_${start_secs}_${end_secs}_${file}" + } + + audio-enhance() { + audio-normalize $@ + audio-optimize $@ + } + + audio-remote-play() { + ssh "$1" "cat $2" | mpv - + } + + audio-fade() { + for file in "$@"; do + duration=$(ffprobe -v error -show_entries format=duration "$file" | awk -F'[= ]+' '/duration/{print $2}') + + fade_in_start=0 + fade_out_start="$(( duration - 1.0 ))" + + ffmpeg -i "$file" -af "afade=st=0:d=1:t=in,afade=st=${fade_out_start}:d=1:t=out" "faded_$file" + mv "faded_$file" "$file" + done + } + + video-enhance() { + # TODO: auto-pick threads + # TODO: crf to 20? + # + for file in "$@"; do + ffmpeg -i "$file" \ + -vf " + yadif, + format=yuv420p, + " \ + -c:v libvpx-vp9 -crf 32 -b:v 0 -threads 0 -speed 1 -tile-columns 4 -frame-parallel 1 \ + -an \ + -c:a libopus -b:a 128k -ar 48000 -ac 2 -af loudnorm \ + -y "enhanced_${file%.*}.webm" + done + } + + iperf-host() { + iperf3 -s + } + + iperf-client() { + iperf3 -c "$1" -P 8 -t 10 + } + poor_mans_scp_upload() { local source_file="$1" local target_user_at_host="$2" @@ -1524,6 +1667,51 @@ zshrc_load_library() { # Reset to default echo -e "\033[0mDefault Text" + echo "Example: \\\\033[1;34mBold Blue Text\\\\033[0m (Reset)" + echo "To type an ANSI color code in Vim, use \`Ctrl+v Esc\`, then enter the digits" + # :help i_CTRL-V_digit + } + + random_string() { + local length="${1:-16}" + tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w "$length" | head -n 1 + } + + ssh-copy-id-mikrotik() { + local userAtHost="$1" + local user=$(echo "$userAtHost" | cut -d "@" -f 1) + local key_filename="key_$(random_string 5).txt" + + ssh "$userAtHost" "/file add name=${key_filename} contents=\"$(cat ~/.ssh/id_rsa.pub)\"; /user ssh-keys import user=${user} public-key-file=${key_filename}; /file remove ${key_filename};" + } + + mtik-exec() { + local mtik_host="${1:-rb3011}" + local script_path="${2}" + local script_name="$(basename "$script_path")" + + # Create a temporary file to store our scripts. + ssh "$mtik_host" "/file/add type=directory name=scripts" > /dev/null + + # Upload the script to the MikroTik router, under the scripts folder. + scp "$script_path" "$mtik_host:/scripts/$script_name" + + # Connect to the MikroTik router and execute the script + ssh "$mtik_host" "/import scripts/$script_name" + } + + rf-link() { + iw dev "$(iw dev | grep Interface | awk '{ print $2 }' | head -n1)" link + } + + screen-rescale() { + local factor="$(zcalc -f -e "1 / ${1:-1}")" + local monitor="$(xrandr --listmonitors | awk '{ print $4}' | tail -n 1)" + xrandr --output "${monitor}" --scale "${factor}x${factor}" + } + + public-ip() { + curl -s https://ipinfo.io } } @@ -1572,8 +1760,7 @@ zshrc_set_aliases() { alias network-relocate='rsync -azP --delete --info=progress2' # Add progress indicator because I always forget. - alias ddd='dd iflag=nocache oflag=nocache bs=64K status=progress' - alias sudo ddd='sudo dd iflag=nocache oflag=nocache bs=64K status=progress' + alias ddd='sudo dd iflag=nocache oflag=nocache,sync bs=16M status=progress' if type gpg2 > /dev/null 2>&1; then alias gpg='gpg2 --with-subkey-fingerprints' @@ -1583,10 +1770,17 @@ zshrc_set_aliases() { alias please='sudo' # Docker commands - alias dcp='docker-compose -f /opt/docker-compose.yml ' - alias dcpull='docker-compose -f /opt/docker-compose.yml pull --parallel' - alias dclogs='docker-compose -f /opt/docker-compose.yml logs -tf --tail="50" ' - alias dtail='docker logs -tf --tail="50" "$@"' + ## Don't use the old version of compose, use the new, official one. + alias docker-compose="docker compose" + alias Dc='docker compose' + alias Dcrm='docker compose rm -sf' + alias Dcpl='docker compose pull --parallel' + alias Dcup='docker compose up -d' + alias Dcl='docker compose logs -tf --tail="50" ' + alias Dce="docker compose exec" + + alias Dr="docker run --rm -it" + alias Dtail='docker logs -tf --tail="50" "$@"' # Clipboard alias clip='xsel --clipboard --trim -i' @@ -1605,7 +1799,10 @@ zshrc_set_aliases() { alias dmenu="rofi -dmenu" fi - alias rcat='find . -type f -exec sh -c '\''for file; do printf "\033[0;92m=== BEGIN $file ===\033[0m\n"; cat "$file"; printf "\n\033[0;91m=== END $file ===\033[0m\n"; done'\'' sh {} +' + # "Recursive Cat" + # Used for feeding file data into an LLM + # Ignores hidden files. (like git) + alias rcat='find . -not -path "*/.*" -type f -exec sh -c '\''for file; do printf "\033[0;92m=== BEGIN $file ===\033[0m\n"; cat "$file"; printf "\n\033[0;91m=== END $file ===\033[0m\n"; done'\'' sh {} +' alias awsp="source _awsp" @@ -1632,6 +1829,7 @@ zshrc_set_aliases() { alias Gd='git diff' alias Gds='git diff --staged' + alias Gp='git pull && git push' alias Gpl='git pull' alias Gpu='git push' @@ -1642,6 +1840,16 @@ zshrc_set_aliases() { alias Grs='git restore --staged' alias kernlog='sudo dmesg --time-format iso --kernel -H --color=always -w | less +F' + + alias Eupdate='sudo emerge --sync' + alias Eupgrade='sudo emerge --ask --tree --update --verbose --deep --newuse @world' + alias Einstall='sudo emerge --ask --verbose --tree --noreplace' + alias Eclean='sudo emerge --ask --depclean' + alias Esearch='emerge --search' + + alias pytest='pytest --capture=tee-sys -vv' + + alias dex='dex-autostart' } zshrc_set_default_programs() { @@ -1687,7 +1895,7 @@ zshrc_set_default_programs() { export TERMINAL="$(which konsole)" fi - export P4IGNORE="/home/max/Perforce/mocull/Engineering/Software/Linux/Code/.p4ignore" + export P4IGNORE="~/Perforce/mocull/Engineering/Software/Linux/Code/.p4ignore" if type fastfetch > /dev/null 2>&1; then alias neofetch="fastfetch" @@ -1817,7 +2025,7 @@ zshrc_aura_shrc() { zshrc_update_or_append() { file="$1" - content="$2" + content="$(cat "$2")" static_marker="# MOCULL STATIC" start_marker="##### MOCULL AUTOGENERATED ### DO NOT EDIT #####" @@ -1846,19 +2054,56 @@ zshrc_update_or_append() { } zshrc_setup_repo() { - repo_dir=$(pwd) + local repo_dir="${PWD}" + + local templates="${DOTFILES_PATH}/templates" + FILE_CARGO_TOML_CLIPPY_LINTS="${templates}/Cargo.clippy.toml" + FILE_GITATTRIBUTES="${templates}/gitattributes" + FILE_GITIGNORE="${templates}/gitignore" + FILE_PRE_COMMIT_CONFIG_PYTHON="${templates}/pre-commit-config.python.yaml" + FILE_PRE_COMMIT_CONFIG_RUST="${templates}/pre-commit-config.rust.yaml" + FILE_PRE_COMMIT_CONFIG_HELM="${templates}/pre-commit-config.helm.yaml" + FILE_PRE_COMMIT_CONFIG_GENERAL="${templates}/pre-commit-config.general.yaml" + FILE_PYPROJECT="${templates}/pyproject.toml" + FILE_FLAKE8="${templates}/flake8" + FILE_YAMLLINT="${templates}/yamllint.yml" + FILE_EDITORCONFIG="${templates}/editorconfig" # Update .gitignore - #zshrc_update_or_append "$repo_dir/.gitignore" "$FILE_GITIGNORE" + zshrc_update_or_append "$repo_dir/.gitignore" "$FILE_GITIGNORE" # Update .gitattributes - #zshrc_update_or_append "$repo_dir/.gitattributes" "$FILE_GITATTRIBUTES" + zshrc_update_or_append "$repo_dir/.gitattributes" "$FILE_GITATTRIBUTES" + + # Update .yamllint.yml since all projects can use YAML + zshrc_update_or_append "$repo_dir/.yamllint.yml" "$FILE_YAMLLINT" + + # Every repo gets this. + zshrc_update_or_append "$repo_dir/.editorconfig" "$FILE_EDITORCONFIG" + + # Update .pre-commit-config.yaml based on project type + if [ -s "$repo_dir/Cargo.toml" ]; then + zshrc_update_or_append "$repo_dir/.pre-commit-config.yaml" "$FILE_PRE_COMMIT_CONFIG_RUST" + elif [ -s "$repo_dir/requirements.txt" ] || [ -n "$(find . -name '*.py' -print -quit)" ]; then + zshrc_update_or_append "$repo_dir/.pre-commit-config.yaml" "$FILE_PRE_COMMIT_CONFIG_PYTHON" + zshrc_update_or_append "$repo_dir/pyproject.toml" "$FILE_PYPROJECT" + zshrc_update_or_append "$repo_dir/.flake8" "$FILE_FLAKE8" + elif [ -n "$(find "$repo_dir" -iname "chart*.y*ml")" ]; then + zshrc_update_or_append "$repo_dir/.pre-commit-config.yaml" "$FILE_PRE_COMMIT_CONFIG_HELM" + else + zshrc_update_or_append "$repo_dir/.pre-commit-config.yaml" "$FILE_PRE_COMMIT_CONFIG_GENERAL" + fi # Install pre-commit hooks if .pre-commit-config.yaml exists and the hooks do not. if [ -s "$repo_dir/.pre-commit-config.yaml" ] && [ ! -s "${repo_dir}/.git/hooks/pre-commit" ]; then pre-commit install fi + # If we have Cargo.toml, then add clippy lints + if [ -s "$repo_dir/Cargo.toml" ]; then + zshrc_update_or_append "$repo_dir/Cargo.toml" "$FILE_CARGO_TOML_CLIPPY_LINTS" + fi + # Install git LFS if not already installed and pull objects if [ -s "$repo_dir/.gitattributes" ] && \ ! grep -q "git-lfs" "$repo_dir/.git/hooks/pre-push"; then @@ -1871,7 +2116,7 @@ zshrc_setup_repo() { zshrc_check_directory() { if [ -d "${PWD}/.git" ]; then # Is the root of a git repo. - if git remote -v | grep -qE "(Maxattax97|maxocull\\.com)"; then + if git remote -v | grep -qE "(Maxattax97|maxocull\\.com|alanocull\\.com)"; then zshrc_setup_repo echo "Personal repository detected and updated" fi diff --git a/Dockerfile.archlinux b/Dockerfile.archlinux new file mode 100644 index 0000000..72c6c05 --- /dev/null +++ b/Dockerfile.archlinux @@ -0,0 +1,50 @@ +# This is Arch Linux, a rolling release... it doesn't make sense to use +# anything other than latest. +# checkov:skip=CKV_DOCKER_7:Arch Linux is a rolling release +# hadolint ignore=DL3007 +FROM archlinux:latest + +RUN pacman -Syu --noconfirm \ + base-devel \ + curl \ + git \ + sudo \ + coreutils \ + --needed + +RUN useradd -m max && \ + echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +USER max + +# Skip using WORKDIR because we want to keep this overlay as lean as possible. +# hadolint ignore=DL3003 +RUN git clone https://aur.archlinux.org/yay.git /tmp/yay && \ + cd /tmp/yay && \ + makepkg -si --noconfirm + +USER root +RUN rm -rf /tmp/yay +USER max +ENV USER=max + +# NOTE: This is dangerous because it will include decrypted secrets in the image! +#RUN mkdir -p /home/max/src/miscellaneous +#COPY --chown=max . /home/max/src/miscellaneous/ + +RUN mkdir -p /home/max/src && \ + git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous + +# Overwrite the install script with the latest one in the repository. +COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh + +WORKDIR /home/max/src/miscellaneous +RUN /bin/sh -o pipefail -c "yes | \ + AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ + pacman -Scc --noconfirm && \ + yay -Scc --noconfirm && \ + rm -rf /home/max/.cache/yay/* && \ + rm -rf /var/cache/pacman/pkg/*" + +WORKDIR /home/max +ENTRYPOINT ["/bin/zsh"] +HEALTHCHECK NONE diff --git a/Dockerfile.brew b/Dockerfile.brew new file mode 100644 index 0000000..dd153b9 --- /dev/null +++ b/Dockerfile.brew @@ -0,0 +1,35 @@ +# NOTE: This is based on an Ubuntu image, not a macOS image! +# hadolint ignore=DL3007 +FROM homebrew/brew:latest + +# This is a very up-to-date image, so we aren't going to lock package versions. +# hadolint ignore=DL3041 +RUN brew install \ + curl \ + git \ + coreutils && \ + brew cleanup + +RUN useradd -m max && \ + echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +USER max +ENV USER=max + +# NOTE: This is dangerous because it will include decrypted secrets in the image! +#RUN mkdir -p /home/max/src/miscellaneous +#COPY --chown=max . /home/max/src/miscellaneous/ + +RUN mkdir -p /home/max/src && \ + git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous + +# Overwrite the install script with the latest one in the repository. +COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh + +WORKDIR /home/max/src/miscellaneous +RUN /bin/sh -o pipefail -c "yes | \ + AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ + brew cleanup" + +WORKDIR /home/max +ENTRYPOINT ["/bin/zsh"] +HEALTHCHECK NONE diff --git a/Dockerfile.debian b/Dockerfile.debian new file mode 100644 index 0000000..66b3a7d --- /dev/null +++ b/Dockerfile.debian @@ -0,0 +1,36 @@ +FROM debian:sid-slim + +# This is a very up-to-date image, so we aren't going to lock package versions. +# hadolint ignore=DL3008 +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + curl \ + git \ + sudo \ + coreutils && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN useradd -m max && \ + echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +USER max +ENV USER=max + +# NOTE: This is dangerous because it will include decrypted secrets in the image! +#RUN mkdir -p /home/max/src/miscellaneous +#COPY --chown=max . /home/max/src/miscellaneous/ + +RUN mkdir -p /home/max/src && \ + git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous + +# Overwrite the install script with the latest one in the repository. +COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh + +WORKDIR /home/max/src/miscellaneous +RUN /bin/sh -o pipefail -c "yes | \ + AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ + apt-get clean" + +WORKDIR /home/max +ENTRYPOINT ["/bin/zsh"] +HEALTHCHECK NONE diff --git a/Dockerfile b/Dockerfile.fedora similarity index 53% rename from Dockerfile rename to Dockerfile.fedora index b67b8c9..d90214d 100644 --- a/Dockerfile +++ b/Dockerfile.fedora @@ -1,34 +1,34 @@ -FROM archlinux:latest +FROM fedora:rawhide -RUN pacman -Syu --noconfirm \ - base-devel \ +# This is a very up-to-date image, so we aren't going to lock package versions. +# hadolint ignore=DL3041 +RUN dnf install -y \ curl \ git \ sudo \ - coreutils \ - --needed + coreutils && \ + dnf clean all RUN useradd -m max && \ echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers USER max - -RUN git clone https://aur.archlinux.org/yay.git /tmp/yay && \ - cd /tmp/yay && \ - makepkg -si --noconfirm && \ - rm -rf /tmp/yay +ENV USER=max # NOTE: This is dangerous because it will include decrypted secrets in the image! #RUN mkdir -p /home/max/src/miscellaneous #COPY --chown=max . /home/max/src/miscellaneous/ -RUN mkdir -p /home/max/src -RUN git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous +RUN mkdir -p /home/max/src && \ + git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous # Overwrite the install script with the latest one in the repository. COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh WORKDIR /home/max/src/miscellaneous -RUN yes | AUTOMATED=1 /home/max/src/miscellaneous/install.sh +RUN /bin/sh -o pipefail -c "yes | \ + AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ + dnf clean all" WORKDIR /home/max ENTRYPOINT ["/bin/zsh"] +HEALTHCHECK NONE diff --git a/Dockerfile.gentoo b/Dockerfile.gentoo new file mode 100644 index 0000000..42d7709 --- /dev/null +++ b/Dockerfile.gentoo @@ -0,0 +1,49 @@ +FROM gentoo/stage3:amd64-openrc + +# Copy our configurations in so it builds faster. +COPY --chown=root:root config/portage/make.conf /etc/portage/make.conf +COPY --chown=root:root config/portage/repos.conf/ /etc/portage/repos.conf/ + +# Update the release key. +RUN curl -o /usr/share/openpgp-keys/gentoo-release.asc https://qa-reports.gentoo.org/output/service-keys.gpg + +# Update the system and select a profile. +RUN emerge --sync && \ + emerge --tree --update --deep --newuse @world && \ + emerge --depclean && \ + eselect profile set default/linux/amd64/23.0 && \ + emerge --tree --update --deep --newuse @world && \ + emerge --depclean + +# This is a very up-to-date image, so we aren't going to lock package versions. +# hadolint ignore=DL3041 +RUN emerge --tree --noreplace \ + net-misc/curl \ + dev-vcs/git \ + app-admin/sudo \ + sys-apps/coreutils && \ + emerge --depclean + +RUN useradd -m max && \ + echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +USER max +ENV USER=max + +# NOTE: This is dangerous because it will include decrypted secrets in the image! +#RUN mkdir -p /home/max/src/miscellaneous +#COPY --chown=max . /home/max/src/miscellaneous/ + +RUN mkdir -p /home/max/src && \ + git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous + +# Overwrite the install script with the latest one in the repository. +COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh + +WORKDIR /home/max/src/miscellaneous +RUN /bin/sh -o pipefail -c "yes | \ + AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ + emerge --verbose --depclean" + +WORKDIR /home/max +ENTRYPOINT ["/bin/zsh"] +HEALTHCHECK NONE diff --git a/README.md b/README.md index f9f9dd5..372972b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # `dotfiles` -[![Super-Linter](https://github.com/Maxattax97/miscellaneous/actions/workflows/ci.yaml/badge.svg)](https://github.com/marketplace/actions/super-linter) +[![Build Status](https://github.com/Maxattax97/miscellaneous/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/Maxattax97/miscellaneous/actions/workflows/ci.yaml) ## Screenshots @@ -18,16 +18,16 @@ ## Installation -``` -$ ./install.sh +```bash +./install.sh ``` ### `zsh` Open a fresh shell and let the zsh plugins automatically install. You may have to restart your shell, sometimes it breaks. -``` -$ zsh +```bash +zsh ``` ### `tmux` @@ -38,8 +38,8 @@ In tmux, you must install your plugins with the key combination `Ctrl-a I`. Open neovim to have it automatically install plugins. It will also automatically update every week. -``` -$ nvim +```bash +nvim ``` ## Updating @@ -85,4 +85,4 @@ This repository contains configurations for: Environment inspired by [Bresilla](https://github.com/bresilla/dotfiles/). -Check out my website at [maxocull.com](https://www.maxocull.com/)! +Check out my site at [maxocull.com](https://www.maxocull.com/)! diff --git a/TODO.md b/TODO.md index 4cdee3e..1e70f2f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,10 +1,10 @@ # Neovim - Switch the completion engine - - https://github.com/williamboman/mason.nvim - - https://github.com/hrsh7th/nvim-cmp + - [mason.nvim](https://github.com/williamboman/mason.nvim) + - [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - Go back to vim-plug - - https://github.com/junegunn/vim-plug + - [vim-plug](https://github.com/junegunn/vim-plug) - Fix ansible-languageserver-protocol, yaml-language-server, yamllint - k8s - docker diff --git a/archiso/10-archiso.sh b/archiso/10-archiso.sh old mode 100644 new mode 100755 diff --git a/archiso/20-chroot.sh b/archiso/20-chroot.sh old mode 100644 new mode 100755 diff --git a/archiso/30-root.sh b/archiso/30-root.sh old mode 100644 new mode 100755 diff --git a/archiso/40-user.sh b/archiso/40-user.sh old mode 100644 new mode 100755 index 32ba335..e205f38 --- a/archiso/40-user.sh +++ b/archiso/40-user.sh @@ -88,42 +88,76 @@ ls src cp 0001-Fix-wide-glyphs-truncation.diff src/ makepkg -si ls -: 1665413591:0;cat ~/.Xdefaults -: 1665413631:0;cd ~/src/miscellaneous -: 1665413631:0;ls -: 1665413638:0;cd assets -: 1665413639:0;ls -: 1665413640:0;cd .. -: 1665413641:0;ls -: 1665413654:0;yay -Ss redrum -: 1665413831:0;ls -: 1665413838:0;rg -i redrum -: 1665413862:0;nvm -: 1665413867:0;npm -: 1665413869:0;nvm ls -: 1665413876:0;nvm installl --lts -: 1665413894:0;nvm list-remote -: 1665413928:0;nvm installl --lts=gallium -: 1665413932:0;nvm installl gallium -: 1665413942:0;nvm installl --lts -: 1665413967:0;nvm installl lts/gallium -: 1665413990:0;nvm ls-remote --lts=gallium -: 1665414009:0;nvm install --lts=Gallium -: 1665414022:0;nvm install --lts=gallium -: 1665414030:0;nvm ls -: 1665414041:0;nvm alias default lts/gallium -: 1665414043:0;nvm ls -: 1665414052:0;nvm use default -: 1665414054:0;nvm ls -: 1665414074:0;nvim install.sh -: 1665414225:0;./install.sh -: 1665414301:0;./install.sh -: 1665414410:0;cat ~/.histfile -: 1665414427:0;bash -c 'cp ~/.histfile /arch_install/mocull_install_zsh.log' -: 1665414429:0;sudo bash -c 'cp ~/.histfile /arch_install/mocull_install_zsh.log' -: 1665414436:0;sudo bash -c 'cp /home/max/.histfile /arch_install/mocull_install_zsh.log' -: 1665414444:0;sudo bash -c 'cp /home/mocull/.histfile /arch_install/mocull_install_zsh.log' - +: 1665413591:0 + cat ~/.Xdefaults +: 1665413631:0 + cd ~/src/miscellaneous +: 1665413631:0 + ls +: 1665413638:0 + cd assets +: 1665413639:0 + ls +: 1665413640:0 + cd .. +: 1665413641:0 + ls +: 1665413654:0 + yay -Ss redrum +: 1665413831:0 + ls +: 1665413838:0 + rg -i redrum +: 1665413862:0 + nvm +: 1665413867:0 + npm +: 1665413869:0 + nvm ls +: 1665413876:0 + nvm installl --lts +: 1665413894:0 + nvm list-remote +: 1665413928:0 + nvm installl --lts=gallium +: 1665413932:0 + nvm installl gallium +: 1665413942:0 + nvm installl --lts +: 1665413967:0 + nvm installl lts/gallium +: 1665413990:0 + nvm ls-remote --lts=gallium +: 1665414009:0 + nvm install --lts=Gallium +: 1665414022:0 + nvm install --lts=gallium +: 1665414030:0 + nvm ls +: 1665414041:0 + nvm alias default lts/gallium +: 1665414043:0 + nvm ls +: 1665414052:0 + nvm use default +: 1665414054:0 + nvm ls +: 1665414074:0 + nvim install.sh +: 1665414225:0 + ./install.sh +: 1665414301:0 + ./install.sh +: 1665414410:0 + cat ~/.histfile +: 1665414427:0 + bash -c 'cp ~/.histfile /arch_install/mocull_install_zsh.log' +: 1665414429:0 + sudo bash -c 'cp ~/.histfile /arch_install/mocull_install_zsh.log' +: 1665414436:0 + sudo bash -c 'cp /home/max/.histfile /arch_install/mocull_install_zsh.log' +: 1665414444:0 + sudo bash -c 'cp /home/mocull/.histfile /arch_install/mocull_install_zsh.log' # Part 3 cat /arch_install/mocull_install.log @@ -391,355 +425,702 @@ lspci -k | grep -A 2 -E "(VGA|3D)" x11perf nvidia-smi nvtop -: 1665421382:0;nvtop -: 1665421655:0;sudo xrandr -q -: 1665421671:0;cd /etc/X11 -: 1665421672:0;ls -: 1665421673:0;cat 10-xorg.bak -: 1665421692:0;X -configure -: 1665421694:0;sudo X -configure -: 1665421720:0;echo $DISPLAY -: 1665421727:0;Xorg -configure -: 1665421729:0;sudo Xorg -configure -: 1665421749:0;diff /etc/X11/xorg.conf.bak /root/xorg.conf.new -: 1665421752:0;ls -: 1665421754:0;ls /root -: 1665421757:0;sudo ls /root -: 1665421759:0;sudo ls /root/ -: 1665421773:0;sudo X -configure -: 1665421779:0;nvim 10-xorg.bak -: 1665421800:0;sudo xrandr -q -: 1665421807:0;sudo DISPLAY=:0 xrandr -q -: 1665421811:0;ISPLAY=:0 xrandr -q -: 1665421817:0;DISPLAY=:0 xrandr -q -: 1665422001:0;pacman -Ss nvidia -: 1665422037:0;ls -: 1665422039:0;cd xorg.conf.d -: 1665422040:0;ls -: 1665422041:0;cd .. -: 1665422041:0;ls -: 1665422065:0;sudo pacman -Rsu nvidia-dkms -: 1665422097:0;pacman -Ss nvidia -: 1665422104:0;pacman -Syu nvidia-open-dkms -: 1665422107:0;sudo pacman -Syu nvidia-open-dkms -: 1665422156:0;sudoedit /etc/pacman.d/hooks/nvidia.hook -: 1665422168:0;mkinitcpio -P -: 1665422171:0;sudo mkinitcpio -P -: 1665422190:0;sudoedit /etc/pacman.conf -: 1665422203:0;sudoedit /etc/mkinitcpio.conf -: 1665422286:0;sudo reboot 0 -: 1665422391:0;htop -: 1665422392:0;weechat -: 1665422392:0;ls -: 1665422392:0;newsboat -: 1665422393:0;ctop -: 1665422393:0;gotop -: 1665422396:0;xrandr -q -: 1665422398:0;sudoxrandr -q -: 1665422401:0;sudo xrandr -q -: 1665422408:0;DISPLAY=:0 xrandr -q -: 1665422416:0;sudo pacman -Rsu nvidia-open-dkms -: 1665422445:0;sudoedit /etc/pacman.d/hooks/nvidia.hook -: 1665422460:0;sudo pacman -Syu nvidia-dkms -: 1665422511:0;sudoedit /etc/mkinitcpio.conf -: 1665422575:0;mkinitcpio -P -: 1665422577:0;sudo mkinitcpio -P -: 1665422591:0;pacman -Ss intel_lpss -: 1665422594:0;pacman -Ss intel-lpss -: 1665422596:0;pacman -Ss intel -: 1665422694:0;sudo pacman -Syu nvidia-dkms -: 1665422789:0;pacman -Rsu nvidia-dkms -: 1665422791:0;sudo pacman -Rsu nvidia-dkms -: 1665422802:0;sudo pacman -Syu nvidia-lts -: 1665422817:0;sudoedit /etc/mkinitcpio.conf -: 1665422822:0;sudoedit /etc/pacman.d/hooks/nvidia.hook -: 1665422828:0;mkinitcpio -P -: 1665422833:0;sudo mkinitcpio -P -: 1665422845:0;sudo reboot 0 -: 1665422896:0;ctop -: 1665422896:0;htop -: 1665422897:0;newsboat -: 1665422898:0;gotop -: 1665422898:0;weechat -: 1665422915:0;ls -: 1665422917:0;cd /etc/X11 -: 1665422918:0;ls -: 1665422920:0;cd xorg.conf.d -: 1665422920:0;ls -: 1665422922:0;cd .. -: 1665422922:0;ls -: 1665422949:0;cat 20-nvidia.bak -: 1665422955:0;lspci -: 1665422959:0;lspci -k | grep -A 2 -E "(VGA|3D)" -: 1665422976:0;cat 10-xorg.bak -: 1665422981:0;ls -: 1665422997:0;sudo cp 20-nvidia.bak xorg.conf.d/20-nvidia.conf -: 1665423001:0;ls -: 1665423002:0;cd xorg.conf.d -: 1665423003:0;ls -: 1665423005:0;cat 20-nvidia.conf -: 1665423008:0;sudo reboot 0 -: 1665423039:0;weechat -: 1665423039:0;ctop -: 1665423040:0;htop -: 1665423040:0;gotop -: 1665423041:0;newsboat -: 1665423069:0;DISPLAY=:0 xrandr -q -: 1665423098:0;ls -: 1665423100:0;cd /etc/X11 -: 1665423100:0;ls -: 1665423102:0;cd xorg.conf.d -: 1665423102:0;ls -: 1665423106:0;sudoedit 20-nvidia.conf -: 1665423140:0;ls -: 1665423142:0;cd /etc/X11 -: 1665423142:0;ls -: 1665423144:0;cat 10-xorg.bak -: 1665423360:0;xrandr --list-providers -: 1665423365:0;xrandr --listproviders -: 1665423369:0;DISPLAY=:0 xrandr --listproviders -: 1665423413:0;sudo reboot 0 -: 1665423456:0;htop -: 1665423456:0;weechat -: 1665423456:0;newsboat -: 1665423457:0;gotop -: 1665423457:0;ctop -: 1665423477:0;cat /var/log/Xorg.0.log -: 1665423502:0;cat /var/log/Xorg.1.log -: 1665423557:0;rm /var/log/Xorg.0.log /var/log/Xorg.1.log /var/log/Xorg.0.log.old -: 1665423560:0;sudo rm /var/log/Xorg.0.log /var/log/Xorg.1.log /var/log/Xorg.0.log.old -: 1665423564:0;sudo reboot 0 -: 1665423596:0;gotop -: 1665423596:0;newsboat -: 1665423596:0;ctop -: 1665423597:0;htop -: 1665423597:0;weechat -: 1665423615:0;ls -: 1665423618:0;cd /var/log -: 1665423618:0;ls -: 1665423654:0;cd / -: 1665423656:0;ls -: 1665423661:0;cd /etc/X11 -: 1665423661:0;ls -: 1665423663:0;cd xorg.conf.d -: 1665423663:0;ls -: 1665423665:0;cat 20-nvidia.conf -: 1665423675:0;mv 20-nvidia.conf ../30-max.bak -: 1665423678:0;sudo mv 20-nvidia.conf ../30-max.bak -: 1665423684:0;ls -: 1665423685:0;cd .. -: 1665423685:0;ls -: 1665423799:0;xrandr --listproviders -: 1665423801:0;sudo reboot 0 -: 1665423846:0;ctop -: 1665423847:0;htop -: 1665423847:0;newsboat -: 1665423848:0;gotop -: 1665423848:0;weechat -: 1665423858:0;cd .local/share -: 1665423859:0;ls -: 1665423860:0;cd xorg -: 1665423861:0;ls -: 1665423868:0;cat Xorg.0.log -: 1665423870:0;ls -: 1665423877:0;rm Xorg.0.log.old Xorg.1.log Xorg.1.log.old -: 1665423877:0;ls -: 1665423879:0;cat Xorg.0.log -: 1665423897:0;less Xorg.0.log -: 1665424201:0;ls /etc/modprobe.d -: 1665424207:0;ls /usr/lib/modprobe.d -: 1665424215:0;sudoedit /usr/lib/modprobe.d/nvidia-utils.conf -: 1665424221:0;sudoedit /usr/lib/modprobe.d/systemd.conf -: 1665424227:0;sudoedit /usr/lib/modprobe.d/README -: 1665424285:0;nvim /etc/mkinitcpio.conf -: 1665424291:0;nvim /etc/mkinitcpio.d/linux-lts.preset -: 1665424298:0;nvim /etc/mkinitcpio.conf -: 1665424319:0;sudoedit /etc/mkinitcpio.conf -: 1665424341:0;lsmod -: 1665424347:0;lsmod | grep -i intel -: 1665424349:0;lsmod | grep -i intel_agp -: 1665424366:0;sudo mkinitcpio -P -: 1665424497:0;yay -S mkinitcpio-numlock -: 1665424517:0;pacman -Ss i915 -: 1665424544:0;pacman -S linux-firmware -: 1665424546:0;sudo pacman -S linux-firmware -: 1665424693:0;sudoedit /etc/mkinitcpio.conf -: 1665424726:0;sudo mkinitcpio -P -: 1665424738:0;sudo reboot 0 -: 1665424784:0;gotop -: 1665424784:0;weechat -: 1665424785:0;newsboat -: 1665424785:0;ctop -: 1665424785:0;htop -: 1665424813:0;redrum --help -: 1665424822:0;redrum -: 1665424918:0;ls -: 1665424922:0;cd src/miscellaneous -: 1665424922:0;ls -: 1665424924:0;cd config -: 1665424925:0;ls -: 1665424927:0;cat redrum.ini -: 1665424954:0;ls -: 1665425076:0;nvtop -: 1665425156:0;ls -: 1665425161:0;git status -: 1665425165:0;git diff -: 1665425177:0;git reset redrum.ini -: 1665425179:0;git status -: 1665425182:0;git restore redrum.ini -: 1665425184:0;git status -: 1665425186:0;redrum -: 1665425202:0;ps -aux | grep -i picom -: 1665425218:0;nvim ~/.config/sxhkd/sxhkdrc -: 1665425230:0;ls ~/.cache/max_enable_picom -: 1665425232:0;cat ~/.cache/max_enable_picom -: 1665425241:0;nvim ~/.config/sxhkd/sxhkdrc -: 1665425268:0;nvim ~/.config/bspwm/bspwmrc -: 1665425283:0;cd /var -: 1665425284:0;ls -: 1665425286:0;cd log -: 1665425287:0;ls -: 1665425290:0;cd private -: 1665425290:0;ls -: 1665425292:0;cd .. -: 1665425292:0;ls -: 1665425295:0;cd /tmp -: 1665425295:0;ls -: 1665425297:0;cd bspwm_logs -: 1665425297:0;ls -: 1665425300:0;cat picom.log -: 1665425318:0;nvim ~/.config/bspwm/bspwmrc -: 1665425354:0;ls -: 1665425356:0;cat brave.log -: 1665425358:0;l -: 1665425359:0;ls -: 1665425360:0;cat dunst.log -: 1665425364:0;ls -: 1665425370:0;cat nitrogen.log -: 1665425373:0;cat nm_applet.log -: 1665425375:0;cat pcmanfm.log -: 1665425379:0;ls -: 1665425381:0;cat picom.log -: 1665425383:0;cat st.log -: 1665425389:0;cat sxhkd.log -: 1665425392:0;cat xrdb.log -: 1665425420:0;ip a -: 1665425653:0;pacman -Ss chromium firefox -: 1665425656:0;pacman -Ss chromium -: 1665425663:0;pacman -Ss firefox -: 1665425671:0;sudo pacman -Syu chromium firefox -: 1665425908:0;chromium --disable-gpu-vsync -: 1665425921:0;chromium --use-gl=egl -: 1665425936:0;chromium --use-gl=swiftshader -: 1665426228:0;sudoedit /etc/X11/xorg.conf.d/90-tap-click.conf -: 1665426275:0;xinput list -: 1665426297:0;xinput list-props 11 -: 1665426311:0;xinput list-props 16 -: 1665426339:0;xinput list-props 18 -: 1665426367:0;sudo xinput list-props 18 -: 1665426375:0;sudo xinput list-props 18 | grep -i input -: 1665426378:0;sudo xinput list-props 18 | grep -i syn -: 1665426581:0;brave --use-gl=swiftshader -: 1665426595:0;brave --use-vulkan -: 1665426612:0;brave --help -: 1665426626:0;brave --use-gl=egl -: 1665426644:0;brave --use-gl=egl --use-vulkan -: 1665426659:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist -: 1665426672:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy -: 1665426680:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu -: 1665426702:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization -: 1665426715:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization -: 1665426734:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames -: 1665426751:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences -: 1665426766:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds -: 1665426781:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer -: 1665426840:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization -: 1665426923:0;vulkaninfo -: 1665426933:0;vulkaninfo -: 1665426991:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization -: 1665426999:0;sudo reboot 0 -: 1665427085:0;htop -: 1665427085:0;newsboat -: 1665427085:0;ctop -: 1665427085:0;weechat -: 1665427086:0;gotop -: 1665427111:0;killall brave -: 1665427114:0;brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization -: 1665427143:0;brave --help | grep -i hardware -: 1665427148:0;chromium --help -: 1665427151:0;man chromium -: 1665427296:0;chromium --use-gl=egl --ignore-gpu-blocklist --enable-gpu-rasterization -: 1665427378:0;chromium --use-gl=egl --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy -: 1665427392:0;chromium --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy -: 1665427411:0;chromium --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy --disable-gpu-driver-bug-workarounds -: 1665427551:0;chromium --disable-gpu-vsync -: 1665427770:0;chromium -: 1665427997:0;brave -: 1665428045:0;brave --disable-gpu-vsync -: 1665428144:0;brave --use-gl=swiftshader -: 1665428318:0;brave --use-gl=swiftshader --disable-gpu-vsync -: 1665428449:0;xrandr -q -: 1665428471:0;brave --use-gl=swiftshader --disable-gpu-vsync -: 1665428518:0;brave --use-gl=swiftshader -: 1665428573:0;brave -: 1665430731:0;xrandr --props -: 1665430756:0;nvidia-settings -: 1665430986:0;nvim /usr/share/drirc.d/00-mesa-defaults.conf\ - -: 1665431100:0;xrandr --props -: 1665431112:0;xrandr --props --help -: 1665431157:0;sudo nvidia-settings -: 1665431210:0;xrandr -q -: 1665431214:0;xrandr --props -: 1665431346:0;sudoedit /etc/modprobe.d/blacklist-i915.conf -: 1665431361:0;sudoedit /etc/mkinitcpio.conf -: 1665431372:0;sudo mkinitcpio -P -: 1665431390:0;nvtop -: 1665431439:0;sudo reboot 0 -: 1665431490:0;newsboat -: 1665431490:0;htop -: 1665431491:0;weechat -: 1665431491:0;gotop -: 1665431491:0;ctop -: 1665431491:0;xrandr --props -: 1665431495:0;DISPLAY=:0 xrandr --props -: 1665431538:0;sudo reboot 0 -: 1665431597:0;htop -: 1665431597:0;ctop -: 1665431598:0;gotop -: 1665431598:0;newsboat -: 1665431599:0;weechat -: 1665431642:0;killall nextcloud -: 1665431674:0;xrandr --props -: 1665431800:0;nvtop -: 1665431822:0;brave --disable-gpu-vsync -: 1665431841:0;killall brave -: 1665431843:0;chromium -: 1665431855:0;brave -: 1665432140:0;xrandr --output 'eDP-1' -r 60 -: 1665432147:0;xrandr --output 'eDP2' -r 60 -: 1665432165:0;xrandr --props -: 1665432207:0;xrandr --output 'eDP2' --rate 60 -: 1665432211:0;xrandr --props -: 1665432228:0;xrandr --output 'eDP2' --mode 1920x1080 --rate 60 -: 1665432231:0;xrandr --props -: 1665432558:0;sudo systemctl enable xdg-user-dirs-update.service -: 1665432592:0;xdg-user-dirs-update -: 1665432593:0;ls -: 1665432648:0;ping google.com -: 1665432733:0;systemctl suspend -: 1665432735:0;sudo systemctl suspend -: 1665432850:0;sudoedit /etc/mkinitcpio.conf -: 1665432860:0;sudo mkinitcpio -P -: 1665433158:0;sudoedit /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf -: 1665433184:0;sudoedit /etc/pacman.conf -: 1665433530:0;sudo systemctl status chrony -: 1665433665:0;sudo systemctl enable thermald -: 1665433670:0;sudo systemctl start thermald -: 1665433673:0;sudo systemctl status thermald -: 1665433755:0;sudo systemctl enable tlp -: 1665433758:0;sudo systemctl start tlp -: 1665433778:0;sudo cp ~/.histfile /arch_install/mocull_install_zsh_2.log +: 1665421382:0 + nvtop +: 1665421655:0 + sudo xrandr -q +: 1665421671:0 + cd /etc/X11 +: 1665421672:0 + ls +: 1665421673:0 + cat 10-xorg.bak +: 1665421692:0 + X -configure +: 1665421694:0 + sudo X -configure +: 1665421720:0 + echo $DISPLAY +: 1665421727:0 + Xorg -configure +: 1665421729:0 + sudo Xorg -configure +: 1665421749:0 + diff /etc/X11/xorg.conf.bak /root/xorg.conf.new +: 1665421752:0 + ls +: 1665421754:0 + ls /root +: 1665421757:0 + sudo ls /root +: 1665421759:0 + sudo ls /root/ +: 1665421773:0 + sudo X -configure +: 1665421779:0 + nvim 10-xorg.bak +: 1665421800:0 + sudo xrandr -q +: 1665421807:0 + sudo DISPLAY=:0 xrandr -q +: 1665421811:0 + ISPLAY=:0 xrandr -q +: 1665421817:0 + DISPLAY=:0 xrandr -q +: 1665422001:0 + pacman -Ss nvidia +: 1665422037:0 + ls +: 1665422039:0 + cd xorg.conf.d +: 1665422040:0 + ls +: 1665422041:0 + cd .. +: 1665422041:0 + ls +: 1665422065:0 + sudo pacman -Rsu nvidia-dkms +: 1665422097:0 + pacman -Ss nvidia +: 1665422104:0 + pacman -Syu nvidia-open-dkms +: 1665422107:0 + sudo pacman -Syu nvidia-open-dkms +: 1665422156:0 + sudoedit /etc/pacman.d/hooks/nvidia.hook +: 1665422168:0 + mkinitcpio -P +: 1665422171:0 + sudo mkinitcpio -P +: 1665422190:0 + sudoedit /etc/pacman.conf +: 1665422203:0 + sudoedit /etc/mkinitcpio.conf +: 1665422286:0 + sudo reboot 0 +: 1665422391:0 + htop +: 1665422392:0 + weechat +: 1665422392:0 + ls +: 1665422392:0 + newsboat +: 1665422393:0 + ctop +: 1665422393:0 + gotop +: 1665422396:0 + xrandr -q +: 1665422398:0 + sudoxrandr -q +: 1665422401:0 + sudo xrandr -q +: 1665422408:0 + DISPLAY=:0 xrandr -q +: 1665422416:0 + sudo pacman -Rsu nvidia-open-dkms +: 1665422445:0 + sudoedit /etc/pacman.d/hooks/nvidia.hook +: 1665422460:0 + sudo pacman -Syu nvidia-dkms +: 1665422511:0 + sudoedit /etc/mkinitcpio.conf +: 1665422575:0 + mkinitcpio -P +: 1665422577:0 + sudo mkinitcpio -P +: 1665422591:0 + pacman -Ss intel_lpss +: 1665422594:0 + pacman -Ss intel-lpss +: 1665422596:0 + pacman -Ss intel +: 1665422694:0 + sudo pacman -Syu nvidia-dkms +: 1665422789:0 + pacman -Rsu nvidia-dkms +: 1665422791:0 + sudo pacman -Rsu nvidia-dkms +: 1665422802:0 + sudo pacman -Syu nvidia-lts +: 1665422817:0 + sudoedit /etc/mkinitcpio.conf +: 1665422822:0 + sudoedit /etc/pacman.d/hooks/nvidia.hook +: 1665422828:0 + mkinitcpio -P +: 1665422833:0 + sudo mkinitcpio -P +: 1665422845:0 + sudo reboot 0 +: 1665422896:0 + ctop +: 1665422896:0 + htop +: 1665422897:0 + newsboat +: 1665422898:0 + gotop +: 1665422898:0 + weechat +: 1665422915:0 + ls +: 1665422917:0 + cd /etc/X11 +: 1665422918:0 + ls +: 1665422920:0 + cd xorg.conf.d +: 1665422920:0 + ls +: 1665422922:0 + cd .. +: 1665422922:0 + ls +: 1665422949:0 + cat 20-nvidia.bak +: 1665422955:0 + lspci +: 1665422959:0 + lspci -k | grep -A 2 -E "(VGA|3D)" +: 1665422976:0 + cat 10-xorg.bak +: 1665422981:0 + ls +: 1665422997:0 + sudo cp 20-nvidia.bak xorg.conf.d/20-nvidia.conf +: 1665423001:0 + ls +: 1665423002:0 + cd xorg.conf.d +: 1665423003:0 + ls +: 1665423005:0 + cat 20-nvidia.conf +: 1665423008:0 + sudo reboot 0 +: 1665423039:0 + weechat +: 1665423039:0 + ctop +: 1665423040:0 + htop +: 1665423040:0 + gotop +: 1665423041:0 + newsboat +: 1665423069:0 + DISPLAY=:0 xrandr -q +: 1665423098:0 + ls +: 1665423100:0 + cd /etc/X11 +: 1665423100:0 + ls +: 1665423102:0 + cd xorg.conf.d +: 1665423102:0 + ls +: 1665423106:0 + sudoedit 20-nvidia.conf +: 1665423140:0 + ls +: 1665423142:0 + cd /etc/X11 +: 1665423142:0 + ls +: 1665423144:0 + cat 10-xorg.bak +: 1665423360:0 + xrandr --list-providers +: 1665423365:0 + xrandr --listproviders +: 1665423369:0 + DISPLAY=:0 xrandr --listproviders +: 1665423413:0 + sudo reboot 0 +: 1665423456:0 + htop +: 1665423456:0 + weechat +: 1665423456:0 + newsboat +: 1665423457:0 + gotop +: 1665423457:0 + ctop +: 1665423477:0 + cat /var/log/Xorg.0.log +: 1665423502:0 + cat /var/log/Xorg.1.log +: 1665423557:0 + rm /var/log/Xorg.0.log /var/log/Xorg.1.log /var/log/Xorg.0.log.old +: 1665423560:0 + sudo rm /var/log/Xorg.0.log /var/log/Xorg.1.log /var/log/Xorg.0.log.old +: 1665423564:0 + sudo reboot 0 +: 1665423596:0 + gotop +: 1665423596:0 + newsboat +: 1665423596:0 + ctop +: 1665423597:0 + htop +: 1665423597:0 + weechat +: 1665423615:0 + ls +: 1665423618:0 + cd /var/log +: 1665423618:0 + ls +: 1665423654:0 + cd / +: 1665423656:0 + ls +: 1665423661:0 + cd /etc/X11 +: 1665423661:0 + ls +: 1665423663:0 + cd xorg.conf.d +: 1665423663:0 + ls +: 1665423665:0 + cat 20-nvidia.conf +: 1665423675:0 + mv 20-nvidia.conf ../30-max.bak +: 1665423678:0 + sudo mv 20-nvidia.conf ../30-max.bak +: 1665423684:0 + ls +: 1665423685:0 + cd .. +: 1665423685:0 + ls +: 1665423799:0 + xrandr --listproviders +: 1665423801:0 + sudo reboot 0 +: 1665423846:0 + ctop +: 1665423847:0 + htop +: 1665423847:0 + newsboat +: 1665423848:0 + gotop +: 1665423848:0 + weechat +: 1665423858:0 + cd .local/share +: 1665423859:0 + ls +: 1665423860:0 + cd xorg +: 1665423861:0 + ls +: 1665423868:0 + cat Xorg.0.log +: 1665423870:0 + ls +: 1665423877:0 + rm Xorg.0.log.old Xorg.1.log Xorg.1.log.old +: 1665423877:0 + ls +: 1665423879:0 + cat Xorg.0.log +: 1665423897:0 + less Xorg.0.log +: 1665424201:0 + ls /etc/modprobe.d +: 1665424207:0 + ls /usr/lib/modprobe.d +: 1665424215:0 + sudoedit /usr/lib/modprobe.d/nvidia-utils.conf +: 1665424221:0 + sudoedit /usr/lib/modprobe.d/systemd.conf +: 1665424227:0 + sudoedit /usr/lib/modprobe.d/README +: 1665424285:0 + nvim /etc/mkinitcpio.conf +: 1665424291:0 + nvim /etc/mkinitcpio.d/linux-lts.preset +: 1665424298:0 + nvim /etc/mkinitcpio.conf +: 1665424319:0 + sudoedit /etc/mkinitcpio.conf +: 1665424341:0 + lsmod +: 1665424347:0 + lsmod | grep -i intel +: 1665424349:0 + lsmod | grep -i intel_agp +: 1665424366:0 + sudo mkinitcpio -P +: 1665424497:0 + yay -S mkinitcpio-numlock +: 1665424517:0 + pacman -Ss i915 +: 1665424544:0 + pacman -S linux-firmware +: 1665424546:0 + sudo pacman -S linux-firmware +: 1665424693:0 + sudoedit /etc/mkinitcpio.conf +: 1665424726:0 + sudo mkinitcpio -P +: 1665424738:0 + sudo reboot 0 +: 1665424784:0 + gotop +: 1665424784:0 + weechat +: 1665424785:0 + newsboat +: 1665424785:0 + ctop +: 1665424785:0 + htop +: 1665424813:0 + redrum --help +: 1665424822:0 + redrum +: 1665424918:0 + ls +: 1665424922:0 + cd src/miscellaneous +: 1665424922:0 + ls +: 1665424924:0 + cd config +: 1665424925:0 + ls +: 1665424927:0 + cat redrum.ini +: 1665424954:0 + ls +: 1665425076:0 + nvtop +: 1665425156:0 + ls +: 1665425161:0 + git status +: 1665425165:0 + git diff +: 1665425177:0 + git reset redrum.ini +: 1665425179:0 + git status +: 1665425182:0 + git restore redrum.ini +: 1665425184:0 + git status +: 1665425186:0 + redrum +: 1665425202:0 + ps -aux | grep -i picom +: 1665425218:0 + nvim ~/.config/sxhkd/sxhkdrc +: 1665425230:0 + ls ~/.cache/max_enable_picom +: 1665425232:0 + cat ~/.cache/max_enable_picom +: 1665425241:0 + nvim ~/.config/sxhkd/sxhkdrc +: 1665425268:0 + nvim ~/.config/bspwm/bspwmrc +: 1665425283:0 + cd /var +: 1665425284:0 + ls +: 1665425286:0 + cd log +: 1665425287:0 + ls +: 1665425290:0 + cd private +: 1665425290:0 + ls +: 1665425292:0 + cd .. +: 1665425292:0 + ls +: 1665425295:0 + cd /tmp +: 1665425295:0 + ls +: 1665425297:0 + cd bspwm_logs +: 1665425297:0 + ls +: 1665425300:0 + cat picom.log +: 1665425318:0 + nvim ~/.config/bspwm/bspwmrc +: 1665425354:0 + ls +: 1665425356:0 + cat brave.log +: 1665425358:0 + l +: 1665425359:0 + ls +: 1665425360:0 + cat dunst.log +: 1665425364:0 + ls +: 1665425370:0 + cat nitrogen.log +: 1665425373:0 + cat nm_applet.log +: 1665425375:0 + cat pcmanfm.log +: 1665425379:0 + ls +: 1665425381:0 + cat picom.log +: 1665425383:0 + cat st.log +: 1665425389:0 + cat sxhkd.log +: 1665425392:0 + cat xrdb.log +: 1665425420:0 + ip a +: 1665425653:0 + pacman -Ss chromium firefox +: 1665425656:0 + pacman -Ss chromium +: 1665425663:0 + pacman -Ss firefox +: 1665425671:0 + sudo pacman -Syu chromium firefox +: 1665425908:0 + chromium --disable-gpu-vsync +: 1665425921:0 + chromium --use-gl=egl +: 1665425936:0 + chromium --use-gl=swiftshader +: 1665426228:0 + sudoedit /etc/X11/xorg.conf.d/90-tap-click.conf +: 1665426275:0 + xinput list +: 1665426297:0 + xinput list-props 11 +: 1665426311:0 + xinput list-props 16 +: 1665426339:0 + xinput list-props 18 +: 1665426367:0 + sudo xinput list-props 18 +: 1665426375:0 + sudo xinput list-props 18 | grep -i input +: 1665426378:0 + sudo xinput list-props 18 | grep -i syn +: 1665426581:0 + brave --use-gl=swiftshader +: 1665426595:0 + brave --use-vulkan +: 1665426612:0 + brave --help +: 1665426626:0 + brave --use-gl=egl +: 1665426644:0 + brave --use-gl=egl --use-vulkan +: 1665426659:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist +: 1665426672:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy +: 1665426680:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu +: 1665426702:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization +: 1665426715:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization +: 1665426734:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames +: 1665426751:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences +: 1665426766:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds +: 1665426781:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer +: 1665426840:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization +: 1665426923:0 + vulkaninfo +: 1665426933:0 + vulkaninfo +: 1665426991:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization +: 1665426999:0 + sudo reboot 0 +: 1665427085:0 + htop +: 1665427085:0 + newsboat +: 1665427085:0 + ctop +: 1665427085:0 + weechat +: 1665427086:0 + gotop +: 1665427111:0 + killall brave +: 1665427114:0 + brave --use-gl=egl --use-vulkan --ignore-gpu-blocklist --enable-zero-copy --enable-unsafe-webgpu --enable-oop-rasterization --enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --disable-sync-preferences --disable-gpu-driver-bug-workarounds --disable-software-rasterizer --enable-features=Vulkan,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization +: 1665427143:0 + brave --help | grep -i hardware +: 1665427148:0 + chromium --help +: 1665427151:0 + man chromium +: 1665427296:0 + chromium --use-gl=egl --ignore-gpu-blocklist --enable-gpu-rasterization +: 1665427378:0 + chromium --use-gl=egl --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy +: 1665427392:0 + chromium --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy +: 1665427411:0 + chromium --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy --disable-gpu-driver-bug-workarounds +: 1665427551:0 + chromium --disable-gpu-vsync +: 1665427770:0 + chromium +: 1665427997:0 + brave +: 1665428045:0 + brave --disable-gpu-vsync +: 1665428144:0 + brave --use-gl=swiftshader +: 1665428318:0 + brave --use-gl=swiftshader --disable-gpu-vsync +: 1665428449:0 + xrandr -q +: 1665428471:0 + brave --use-gl=swiftshader --disable-gpu-vsync +: 1665428518:0 + brave --use-gl=swiftshader +: 1665428573:0 + brave +: 1665430731:0 + xrandr --props +: 1665430756:0 + nvidia-settings +: 1665430986:0 + nvim /usr/share/drirc.d/00-mesa-defaults.conf +: 1665431100:0 + xrandr --props +: 1665431112:0 + xrandr --props --help +: 1665431157:0 + sudo nvidia-settings +: 1665431210:0 + xrandr -q +: 1665431214:0 + xrandr --props +: 1665431346:0 + sudoedit /etc/modprobe.d/blacklist-i915.conf +: 1665431361:0 + sudoedit /etc/mkinitcpio.conf +: 1665431372:0 + sudo mkinitcpio -P +: 1665431390:0 + nvtop +: 1665431439:0 + sudo reboot 0 +: 1665431490:0 + newsboat +: 1665431490:0 + htop +: 1665431491:0 + weechat +: 1665431491:0 + gotop +: 1665431491:0 + ctop +: 1665431491:0 + xrandr --props +: 1665431495:0 + DISPLAY=:0 xrandr --props +: 1665431538:0 + sudo reboot 0 +: 1665431597:0 + htop +: 1665431597:0 + ctop +: 1665431598:0 + gotop +: 1665431598:0 + newsboat +: 1665431599:0 + weechat +: 1665431642:0 + killall nextcloud +: 1665431674:0 + xrandr --props +: 1665431800:0 + nvtop +: 1665431822:0 + brave --disable-gpu-vsync +: 1665431841:0 + killall brave +: 1665431843:0 + chromium +: 1665431855:0 + brave +: 1665432140:0 + xrandr --output 'eDP-1' -r 60 +: 1665432147:0 + xrandr --output 'eDP2' -r 60 +: 1665432165:0 + xrandr --props +: 1665432207:0 + xrandr --output 'eDP2' --rate 60 +: 1665432211:0 + xrandr --props +: 1665432228:0 + xrandr --output 'eDP2' --mode 1920x1080 --rate 60 +: 1665432231:0 + xrandr --props +: 1665432558:0 + sudo systemctl enable xdg-user-dirs-update.service +: 1665432592:0 + xdg-user-dirs-update +: 1665432593:0 + ls +: 1665432648:0 + ping google.com +: 1665432733:0 + systemctl suspend +: 1665432735:0 + sudo systemctl suspend +: 1665432850:0 + sudoedit /etc/mkinitcpio.conf +: 1665432860:0 + sudo mkinitcpio -P +: 1665433158:0 + sudoedit /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf +: 1665433184:0 + sudoedit /etc/pacman.conf +: 1665433530:0 + sudo systemctl status chrony +: 1665433665:0 + sudo systemctl enable thermald +: 1665433670:0 + sudo systemctl start thermald +: 1665433673:0 + sudo systemctl status thermald +: 1665433755:0 + sudo systemctl enable tlp +: 1665433758:0 + sudo systemctl start tlp +: 1665433778:0 + sudo cp ~/.histfile /arch_install/mocull_install_zsh_2.log ls sudo systemctl mask systemd-rfkill.service @@ -774,87 +1155,171 @@ systemctl --user start pipewire-pulse.service pactl info brave firefox -: 1665435361:0;sudo reboot 0 -: 1665435409:0;newsboat -: 1665435409:0;gotop -: 1665435410:0;ctop -: 1665435410:0;htop -: 1665435410:0;weechat -: 1665435461:0;xev -: 1665435515:0;pactl -: 1665435523:0;pactl -- set-sink-volume 0 +10% -: 1665435529:0;pactl -- set-sink-volume 0 +5% -: 1665435539:0;nvim miscellaneous/config/sxhkd/sxhkdrc -: 1665435548:0;nvim ~/src/miscellaneous/config/sxhkd/sxhkdrc -: 1665435707:0;thermald --help -: 1665435713:0;sudo systemctl status thermald -: 1665435763:0;thermald --help -: 1665435780:0;thermald status -: 1665435785:0;sudo thermald -: 1665435788:0;sudo thermald --help -: 1665435793:0;ps -aux | grep -i thermald -: 1665435967:0;cd src/miscellaneous -: 1665435968:0;git pull -: 1665435973:0;sudo pacman -Syu -: 1665435978:0;ls -: 1665436002:0;sudo cp config/chrony.conf /etc/chrony.conf -: 1665436005:0;sudoedit /etc/chrony.conf -: 1665436466:0;sudo systemctl stop systemd-timesyncd.service -: 1665436470:0;sudo systemctl disable systemd-timesyncd.service -: 1665436486:0;sudo systemctl enable chronyd.service -: 1665436502:0;sudo systemctl enable chronyd.service -: 1665436509:0;sudo systemctl start chronyd.service -: 1665436513:0;sudo systemctl status chronyd.service -: 1665436536:0;sudoedit /etc/chrony.conf -: 1665436546:0;diff /etc/chrony.conf.pacnew /etc/chrony.conf -: 1665436550:0;nvim -d /etc/chrony.conf.pacnew /etc/chrony.conf -: 1665436575:0;sudoedit -d /etc/chrony.conf.pacnew /etc/chrony.conf -: 1665436653:0;sudoedit /etc/X11/xorg.conf.d/90-tap-click.conf -: 1665437030:0;cd /etc/X11/xorg.conf.d -: 1665437031:0;ls -: 1665437036:0;sudo mv 90-tap-click.conf 30-touchpad.conf -: 1665437040:0;ls -: 1665437230:0;lsblk --discard -: 1665437276:0;sudo systemctl status fstrim.timer -: 1665437281:0;sudo systemctl enable fstrim.timer -: 1665437282:0;sudo systemctl status fstrim.timer -: 1665437290:0;sudo systemctl start fstrim.service -: 1665437294:0;sudo systemctl status fstrim.service -: 1665437309:0;cat /etc/fstab -: 1665437479:0;ls -: 1665437483:0;sudo reboot 0 -: 1665437595:0;htop -: 1665437595:0;weechat -: 1665437596:0;newsboat -: 1665437596:0;ctop -: 1665437597:0;gotop -: 1665437664:0;ls -: 1665437669:0;cd src -: 1665437669:0;ls -: 1665437671:0;cd miscellaneous -: 1665437671:0;ls -: 1665437673:0;cd config -: 1665437673:0;ls -: 1665437687:0;ls /etc/X11 -: 1665437690:0;ls /etc/X11/xorg.conf.d -: 1665437698:0;mkdir -p X11/xorg.conf.d -: 1665437701:0;cd X11/xorg.conf.d -: 1665437701:0;ls -: 1665437708:0;sudo cp /etc/X11/xorg.conf.d/30-touchpad.conf . -: 1665437713:0;sudo chown mocull:mocull 30-touchpad.conf -: 1665437714:0;ls -: 1665437715:0;ls -lah -: 1665437717:0;cat 30-touchpad.conf -: 1665437722:0;cd .. -: 1665437723:0;ls -: 1665437724:0;cd .. -: 1665437724:0;ls -: 1665437727:0;cat chrony.conf -: 1665437742:0;sudo cp /etc/chrony.conf ./chrony.conf -: 1665437747:0;sudo chown mocull:mocull chrony.conf -: 1665437751:0;cat chrony.conf -: 1665437753:0;git status -: 1665437756:0;cd .. -: 1665437756:0;ls -: 1665437760:0;git diff -: 1665437785:0;sudo cp ~/.histfile /arch_install/mocull_install_zsh_3.log +: 1665435361:0 + sudo reboot 0 +: 1665435409:0 + newsboat +: 1665435409:0 + gotop +: 1665435410:0 + ctop +: 1665435410:0 + htop +: 1665435410:0 + weechat +: 1665435461:0 + xev +: 1665435515:0 + pactl +: 1665435523:0 + pactl -- set-sink-volume 0 +10% +: 1665435529:0 + pactl -- set-sink-volume 0 +5% +: 1665435539:0 + nvim miscellaneous/config/sxhkd/sxhkdrc +: 1665435548:0 + nvim ~/src/miscellaneous/config/sxhkd/sxhkdrc +: 1665435707:0 + thermald --help +: 1665435713:0 + sudo systemctl status thermald +: 1665435763:0 + thermald --help +: 1665435780:0 + thermald status +: 1665435785:0 + sudo thermald +: 1665435788:0 + sudo thermald --help +: 1665435793:0 + ps -aux | grep -i thermald +: 1665435967:0 + cd src/miscellaneous +: 1665435968:0 + git pull +: 1665435973:0 + sudo pacman -Syu +: 1665435978:0 + ls +: 1665436002:0 + sudo cp config/chrony.conf /etc/chrony.conf +: 1665436005:0 + sudoedit /etc/chrony.conf +: 1665436466:0 + sudo systemctl stop systemd-timesyncd.service +: 1665436470:0 + sudo systemctl disable systemd-timesyncd.service +: 1665436486:0 + sudo systemctl enable chronyd.service +: 1665436502:0 + sudo systemctl enable chronyd.service +: 1665436509:0 + sudo systemctl start chronyd.service +: 1665436513:0 + sudo systemctl status chronyd.service +: 1665436536:0 + sudoedit /etc/chrony.conf +: 1665436546:0 + diff /etc/chrony.conf.pacnew /etc/chrony.conf +: 1665436550:0 + nvim -d /etc/chrony.conf.pacnew /etc/chrony.conf +: 1665436575:0 + sudoedit -d /etc/chrony.conf.pacnew /etc/chrony.conf +: 1665436653:0 + sudoedit /etc/X11/xorg.conf.d/90-tap-click.conf +: 1665437030:0 + cd /etc/X11/xorg.conf.d +: 1665437031:0 + ls +: 1665437036:0 + sudo mv 90-tap-click.conf 30-touchpad.conf +: 1665437040:0 + ls +: 1665437230:0 + lsblk --discard +: 1665437276:0 + sudo systemctl status fstrim.timer +: 1665437281:0 + sudo systemctl enable fstrim.timer +: 1665437282:0 + sudo systemctl status fstrim.timer +: 1665437290:0 + sudo systemctl start fstrim.service +: 1665437294:0 + sudo systemctl status fstrim.service +: 1665437309:0 + cat /etc/fstab +: 1665437479:0 + ls +: 1665437483:0 + sudo reboot 0 +: 1665437595:0 + htop +: 1665437595:0 + weechat +: 1665437596:0 + newsboat +: 1665437596:0 + ctop +: 1665437597:0 + gotop +: 1665437664:0 + ls +: 1665437669:0 + cd src +: 1665437669:0 + ls +: 1665437671:0 + cd miscellaneous +: 1665437671:0 + ls +: 1665437673:0 + cd config +: 1665437673:0 + ls +: 1665437687:0 + ls /etc/X11 +: 1665437690:0 + ls /etc/X11/xorg.conf.d +: 1665437698:0 + mkdir -p X11/xorg.conf.d +: 1665437701:0 + cd X11/xorg.conf.d +: 1665437701:0 + ls +: 1665437708:0 + sudo cp /etc/X11/xorg.conf.d/30-touchpad.conf . +: 1665437713:0 + sudo chown mocull:mocull 30-touchpad.conf +: 1665437714:0 + ls +: 1665437715:0 + ls -lah +: 1665437717:0 + cat 30-touchpad.conf +: 1665437722:0 + cd .. +: 1665437723:0 + ls +: 1665437724:0 + cd .. +: 1665437724:0 + ls +: 1665437727:0 + cat chrony.conf +: 1665437742:0 + sudo cp /etc/chrony.conf ./chrony.conf +: 1665437747:0 + sudo chown mocull:mocull chrony.conf +: 1665437751:0 + cat chrony.conf +: 1665437753:0 + git status +: 1665437756:0 + cd .. +: 1665437756:0 + ls +: 1665437760:0 + git diff +: 1665437785:0 + sudo cp ~/.histfile /arch_install/mocull_install_zsh_3.log diff --git a/bin/ctlpanel b/bin/ctlpanel index 1ebe3d2..f1ac06f 100755 --- a/bin/ctlpanel +++ b/bin/ctlpanel @@ -1,6 +1,6 @@ #!/bin/bash -dont_join=${1:-0}; +dont_join=${1:-0} session="CtlPanel" w_htop="Htop" @@ -16,41 +16,41 @@ w_monero="Monero" network_interface="eno1" -tmux has-session -t "CtlPanel" 2>/dev/null +tmux has-session -t "CtlPanel" 2> /dev/null if [ "$?" -eq 1 ]; then - tmux new-session -d -s "$session" -n "$w_htop" - tmux new-window -n "$w_network" -t "$session" - tmux new-window -n "$w_logs" -t "$session" - tmux new-window -n "$w_minecraft" -t "$session" -c "/home/resolute/minecraft" - tmux new-window -n "$w_minecraft_mod" -t "$session" -c "/home/resolute/minecraft" - tmux new-window -n "$w_terraria" -t "$session" -c "/home/resolute/terraria/tmodloader" - tmux new-window -n "$w_course_watcher" -t "$session" -c "/home/resolute/src/purdue-course-watcher" - tmux new-window -n "$w_gekko" -t "$session" -c "/home/resolute/src/gekko" - tmux new-window -n "$w_monero" -t "$session" - tmux new-window -t "$session" # Open a bash terminal at the end. - - tmux split-window -h -t "$session:$w_network" - - tmux send-keys -t "$session:$w_htop" "htop" C-m - tmux send-keys -t "$session:$w_network.0" "speedometer -r $network_interface -t $network_interface" C-m - tmux send-keys -t "$session:$w_network.1" "clear && sudo iftop" C-m - tmux send-keys -t "$session:$w_logs" "clear && journalctl --system -f" C-m - tmux send-keys -t "$session:$w_minecraft" "cd main/ && clear && ./run.sh" C-m - tmux send-keys -t "$session:$w_minecraft_mod" "cd mainSpigot/ && clear && ./run.sh" C-m - tmux send-keys -t "$session:$w_terraria" "clear && ./tModLoaderServer # Disabled in ctlpanel" #C-m - tmux send-keys -t "$session:$w_factorio" "clear && journalctl -f -u factorio.service" C-m - tmux send-keys -t "$session:$w_course_watcher" "clear && node index.js # Disabled in ctlpanel" #C-m - tmux send-keys -t "$session:$w_gekko" "clear && node gekko --ui # Disabled in ctlpanel" #C-m - tmux send-keys -t "$session:$w_monero" "clear && xmrig -o gulf.moneroocean.stream:10008 -u 46cWMT5YP2A8a8bSDzj3r7C7XkCkTWvJz2FFDjqnk8hnATYCrBJD22R1cyZJwK4tDTNGHFMTuSkCbNZeaYjhPADx9QisCcA -p Resolute --cpu-priority 1 -k # Disabled in ctlpanel" #C-m - - if [ "$dont_join" -ne 1 ]; then - echo "Attaching to CtlPanel session ..." - tmux -2 attach-session -t "$session:$w_htop" - fi + tmux new-session -d -s "$session" -n "$w_htop" + tmux new-window -n "$w_network" -t "$session" + tmux new-window -n "$w_logs" -t "$session" + tmux new-window -n "$w_minecraft" -t "$session" -c "/home/resolute/minecraft" + tmux new-window -n "$w_minecraft_mod" -t "$session" -c "/home/resolute/minecraft" + tmux new-window -n "$w_terraria" -t "$session" -c "/home/resolute/terraria/tmodloader" + tmux new-window -n "$w_course_watcher" -t "$session" -c "/home/resolute/src/purdue-course-watcher" + tmux new-window -n "$w_gekko" -t "$session" -c "/home/resolute/src/gekko" + tmux new-window -n "$w_monero" -t "$session" + tmux new-window -t "$session" # Open a bash terminal at the end. + + tmux split-window -h -t "$session:$w_network" + + tmux send-keys -t "$session:$w_htop" "htop" C-m + tmux send-keys -t "$session:$w_network.0" "speedometer -r $network_interface -t $network_interface" C-m + tmux send-keys -t "$session:$w_network.1" "clear && sudo iftop" C-m + tmux send-keys -t "$session:$w_logs" "clear && journalctl --system -f" C-m + tmux send-keys -t "$session:$w_minecraft" "cd main/ && clear && ./run.sh" C-m + tmux send-keys -t "$session:$w_minecraft_mod" "cd mainSpigot/ && clear && ./run.sh" C-m + tmux send-keys -t "$session:$w_terraria" "clear && ./tModLoaderServer # Disabled in ctlpanel" #C-m + tmux send-keys -t "$session:$w_factorio" "clear && journalctl -f -u factorio.service" C-m + tmux send-keys -t "$session:$w_course_watcher" "clear && node index.js # Disabled in ctlpanel" #C-m + tmux send-keys -t "$session:$w_gekko" "clear && node gekko --ui # Disabled in ctlpanel" #C-m + tmux send-keys -t "$session:$w_monero" "clear && xmrig -o gulf.moneroocean.stream:10008 -u 46cWMT5YP2A8a8bSDzj3r7C7XkCkTWvJz2FFDjqnk8hnATYCrBJD22R1cyZJwK4tDTNGHFMTuSkCbNZeaYjhPADx9QisCcA -p Resolute --cpu-priority 1 -k # Disabled in ctlpanel" #C-m + + if [ "$dont_join" -ne 1 ]; then + echo "Attaching to CtlPanel session ..." + tmux -2 attach-session -t "$session:$w_htop" + fi else - if [ "$dont_join" -ne 1 ]; then - echo "Entering a child CtlPanel session ..." - tmux -2 new-session -t "$session:$w_htop" - fi + if [ "$dont_join" -ne 1 ]; then + echo "Entering a child CtlPanel session ..." + tmux -2 new-session -t "$session:$w_htop" + fi fi diff --git a/bin/find-online b/bin/find-online index 1044493..c169484 100755 --- a/bin/find-online +++ b/bin/find-online @@ -5,8 +5,7 @@ friends=("aneusted" "aurnes" "yu646" "dkrolopp" "girishg" "liu2034" "buckmast" " echo "Scanning for online users ..." count=0 -for user in "${friends[@]}" -do +for user in "${friends[@]}"; do if [ "$USER" != "$user" ]; then if [ ! -z "$(w | grep "$user")" ]; then echo "$user is online." diff --git a/bin/gspeak b/bin/gspeak index fbd15f1..0ae4c1d 100755 --- a/bin/gspeak +++ b/bin/gspeak @@ -4,7 +4,6 @@ # TalkToDanF@gmail.com # ################################# - INPUT=$* STRINGNUM=0 @@ -13,27 +12,25 @@ echo "---------------------------" echo "Speech Script by Dan Fountain" echo "TalkToDanF@gmail.com" echo "---------------------------" -for key in "${!ary[@]}" - do +for key in "${!ary[@]}"; do SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}" LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]}) #echo "word:$key, ${ary[$key]}" #echo "adding to: $STRINGNUM" if [[ "$LENGTH" -lt "100" ]]; then - #echo starting new line - SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]} + #echo starting new line + SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]} else - STRINGNUM=$(($STRINGNUM+1)) - SHORTTMP[$STRINGNUM]="${ary[$key]}" - SHORT[$STRINGNUM]="${ary[$key]}" + STRINGNUM=$(($STRINGNUM + 1)) + SHORTTMP[$STRINGNUM]="${ary[$key]}" + SHORT[$STRINGNUM]="${ary[$key]}" fi done -for key in "${!SHORT[@]}" - do +for key in "${!SHORT[@]}"; do #echo "line: $key is: ${SHORT[$key]}" - echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))" + echo "Playing line: $(($key + 1)) of $(($STRINGNUM + 1))" NEXTURL=$(echo ${SHORT[$key]} | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g') mpg123 -q "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$NEXTURL&tl=En-us" done diff --git a/bin/idle-mine b/bin/idle-mine index 1cf7878..35148f4 100755 --- a/bin/idle-mine +++ b/bin/idle-mine @@ -1,7 +1,7 @@ #!/bin/bash POOL="gulf.moneroocean.stream:20008" -POOL_PASSWORD="MaxattaxOpenSUSE" +POOL_PASSWORD="MaxattaxOpenSUSE" # gitleaks:allow WALLET="46cWMT5YP2A8a8bSDzj3r7C7XkCkTWvJz2FFDjqnk8hnATYCrBJD22R1cyZJwK4tDTNGHFMTuSkCbNZeaYjhPADx9QisCcA" USE_CPU=0 @@ -55,14 +55,14 @@ getCharging() { getActiveSSHSessions() { lines="$(ps aux | grep sshd | wc -l)" - echo "$(( (lines - 1) / 2 ))" + echo "$(((lines - 1) / 2))" } getLockedTime() { # Time is in milliseconds. rawTime="" if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then - rawTime="$(dbus-send --session --dest=org.gnome.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/gnome/ScreenSaver org.gnome.ScreenSaver.GetActiveTime | grep uint32 | awk '{ printf $2 };')" + rawTime="$(dbus-send --session --dest=org.gnome.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/gnome/ScreenSaver org.gnome.ScreenSaver.GetActiveTime | grep uint32 | awk '{ printf $2 };')" else rawTime="$(dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.GetActiveTime | grep uint32 | awk '{ printf $2 };')" fi @@ -102,7 +102,7 @@ initMining() { USE_GPU=0 fi - tmux has-session -t "$session" 2>/dev/null + tmux has-session -t "$session" 2> /dev/null if [ "$?" -ne 1 ]; then log "An idling tmux session already exists; exiting" @@ -220,7 +220,6 @@ tick() { IN_USE=0 fi - if [ -n "$DEBUG" ]; then echo "MINING: $MINING | IN_USE: $IN_USE | LOCKED_TIME: $(getLockedTime) | IDLE_TO_START: $IDLE_TO_START" fi diff --git a/config/SpaceVim.d/SpaceVim.d b/config/SpaceVim.d/SpaceVim.d deleted file mode 120000 index 1df05e4..0000000 --- a/config/SpaceVim.d/SpaceVim.d +++ /dev/null @@ -1 +0,0 @@ -/home/max/src/miscellaneous/config/SpaceVim.d \ No newline at end of file diff --git a/config/SpaceVim.d/autoload/bootstrap.vim b/config/SpaceVim.d/autoload/bootstrap.vim deleted file mode 100644 index e6339d2..0000000 --- a/config/SpaceVim.d/autoload/bootstrap.vim +++ /dev/null @@ -1,174 +0,0 @@ -" TODO LIST -" Spell checking: spell spelllang=en_us -" Cursor line wrapping -" Merge configuration with Neovim Studio -" Plugins: vim-sleuth, vim-lastplace - -func! bootstrap#before() abort - set modeline - set modelines=5 - - let g:vim_arduino_library_path = '/home/max/.local/share/arduino/' - " let g:vim_arduino_serial_port = /my/serial/port - - let g:startify_custom_header = [ - \ ' _ __ _ ', - \ ' / | / /__ ____ _ __(_)___ ___ ', - \ ' / |/ / _ \/ __ \ | / / / __ `__ \', - \ ' / /| / __/ /_/ / |/ / / / / / / /', - \ ' /_/_||||_||/\____/|___/|||/ /_/ /_/ ', - \ ' / ___// /___ ______/ (_)___ ', - \ ' \__ \/ __/ / / / __ / / __ \ ', - \ ' ___/ / /_/ /_/ / /_/ / / /_/ / ', - \ ' /____/\__/\__,_/\__,_/_/\____/ ', - \ ' ', - \ ] - - " Disable concealing of Markdown characters for displaying. - let g:vim_markdown_conceal = 0 - - " Use Galactic's airline theme. - let g:airline_theme='galactic' - let g:gitgutter_realtime = 0 - let g:airline#extensions#tmuxline#enabled = 0 - let g:airline#extensions#bookmark#enabled = 0 - let g:airline#extensions#fugitiveline#enabled = 0 - let g:airline#extensions#hunks#enabled = 0 - - let g:bootstrap_pre_exec = 1 -endf - -func! bootstrap#after() abort - " Keep lines above or below the cursor at all times. - set scrolloff=7 - set colorcolumn=80,125 - - " Wrap around lines in insert mode. - set whichwrap+=<,>,h,l,[,] - - " Raise cmdheight so echodoc can display function parameters. - set cmdheight=2 - - " Default to case insensitive searches. - set ignorecase - set smartcase - - " Decrease idle time. - set updatetime=350 - - " Enable automated fixing. - let g:ale_fixers = { - \ '*': ['remove_trailing_lines', 'trim_whitespace'], - \ 'javascript': ['eslint'], - \ 'typescript': ['eslint'], - \ 'jsx': ['eslint'], - \ 'python': ['black'], - \} - - " Automatically fix on save. - let g:ale_fix_on_save = 1 - - " Disable ALE for C/C++, Python, use LSP exclusively. - let g:ale_linters = { - \ 'c': [], - \ 'cpp': [], - \ 'python': [], - \ 'java': [], - \ 'json': [], - \ 'javascript': [], - \ 'typescript': [], - \ 'jsx': [], - \ 'css': [], - \ 'html': [], - \ 'ruby': [], - \ 'rust': [], - \ 'go': [], - \ 'yaml': [], - \} - - " let g:ale_sign_column_always = 1 - - " let g:signify_sign_add = '+' - " let g:signify_sign_delete = '_' - " let g:signify_sign_delete_first_line = '‾' - let g:signify_sign_change = '~' - " let g:signify_sign_changedelete = g:signify_sign_change - - call SpaceVim#mapping#space#def('nmap', ['c', ''], 'NERDCommenterToggle', 'toggle the comments on the selected line(s)', 0, 1) - let g:_spacevim_mappings_space.l.c = {'name' : '+coc.nvim'} - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 'd'], 'CocList diagnostics', 'show diagnostics', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 'c'], 'CocList extensions', 'list commands', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 'e'], 'CocList extensions', 'list extensions', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 'o'], 'CocList outline', 'list document symbols', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 's'], 'CocList -I symbols', 'list workspace symbols', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l', 'c', 'j'], 'CocNext', 'perform default action', 1) - - " nnoremap lh :call LanguageClient_textDocument_hover() - " nnoremap ld :call LanguageClient_textDocument_definition() - " nnoremap lr :call LanguageClient_textDocument_rename() - - inoremap coc#refresh() - - call coc#config('coc.preferences', { - \ "autoTrigger": "always", - \ "maxCompleteItemCount": 10, - \ "codeLens.enable": 1, - \ "diagnostic.virtualText": 1, - \}) - - " \ 'coc-prettier', - " \ 'coc-imselect', - " \ 'coc-wxml', - " \ 'coc-stylelint', - " \ 'coc-weather', - " \ 'coc-emoji', - " \ 'coc-ultisnips', - " let s:coc_extensions = [ - " \ 'coc-dictionary', - " \ 'coc-json', - " \ 'coc-tag', - " \ 'coc-tslint', - " \ 'coc-eslint', - " \ 'coc-css', - " \ 'coc-html', - " \ 'coc-pyls', - " \ 'coc-solargraph', - " \ 'coc-vetur', - " \ 'coc-json', - " \ 'coc-tsserver', - " \ 'coc-jest', - " \ 'coc-java', - " \ 'coc-rls', - " \ 'coc-highlight', - " \ 'coc-gocode', - " \ 'coc-omni', - " \ 'coc-word', - " \ 'coc-neosnippet', - " \ 'coc-yaml', - " \ 'coc-emmet', - " \ 'coc-snippets', - " \ 'coc-pairs', - " \ 'coc-lists', - " \ 'coc-yank', - " \ 'coc-vimtex', - " \ 'coc-tslint-plugin', - " \] - - " for extension in s:coc_extensions - " call coc#add_extension(extension) - " endfor - - " Jump to next item in snippets with Tab. - " let g:UltiSnipsJumpForwardTrigger="" - " let g:UltiSnipsJumpBackwardTrigger="" - " imap (neosnippet_jump) - - let g:AutoHighlight_ClearOnCursorMoved = 1 - let g:AutoHighlight_ClearOnWindowExit = 1 - - if g:bootstrap_pre_exec - echom('Pre-execution bootstrap completed.') - endif - - echom('Post-execution bootstrap complete.') -endf diff --git a/config/SpaceVim.d/init.toml b/config/SpaceVim.d/init.toml deleted file mode 100644 index 748cadb..0000000 --- a/config/SpaceVim.d/init.toml +++ /dev/null @@ -1,191 +0,0 @@ -#============================================================================= -# dark_powered.toml --- dark powered configuration example for SpaceVim -# Copyright (c) 2016-2017 Wang Shidong & Contributors -# Author: Wang Shidong < wsdjeg at 163.com > -# URL: https://spacevim.org -# License: GPLv3 -#============================================================================= - -# All SpaceVim option below [option] section -[options] - # Bootstrap hooks - bootstrap_before = "bootstrap#before" - bootstrap_after = "bootstrap#after" - - # Aesthetic - colorscheme = "galactic" # "NeoSolarized" - colorscheme_default = "desert" - background = "dark" - enable_guicolors = true - statusline_separator = "arrow" - statusline_inactive_separator = "arrow" - enable_tabline_filetype_icon = true - enable_statusline_display_mode = false # ??? - error_symbol = "x" - warning_symbol = "!" - info_symbol = "i" - buffer_index_type = 2 - - # Automation - autocomplete_parens = true - autocomplete_method = "coc" # :call coc#util#build() - windows_smartclose = "" - - # Tooling - filemanager = "nerdtree" - - # Code - enable_neomake = false - enable_ale = true - lint_on_the_fly = true - default_indent = 4 - expand_tab = true - max_column = 80 - - # Plugins - disabled_plugins = [ - "Clamp", # Prefer ~clangd~ cquery via LSP - "javacomplete2" # Prefer eclipse jdt - ] - -[[custom_plugins]] - name = "tpope/vim-sleuth" -[[custom_plugins]] - name = "sheerun/vim-polyglot" -[[custom_plugins]] - name = "sirtaj/vim-openscad" -[[custom_plugins]] - name = "tpope/vim-abolish" -[[custom_plugins]] - name = "tclem/vim-arduino" -[[custom_plugins]] - name = "tmux-plugins/vim-tmux-focus-events" -[[custom_plugins]] - name = "lygaret/autohighlight.vim" -[[custom_plugins]] - name = "lifepillar/vim-colortemplate" -[[custom_plugins]] - name = "flazz/vim-colorschemes" -[[custom_plugins]] - name = "maxattax97/vim-galactic" - -[[layers]] - # Disable statusline in favor of airline. - name = "core#statusline" - enable = false -[[layers]] - name = "autocomplete" - auto-completion-return-key-behavior = "smart" - auto-completion-tab-key-behavior = "cycle" - auto-completion-delay = 10 - # TODO: Battery conservation by delayed autocompletion. - # https://github.com/w0rp/ale#faq-my-battery-is-sad - # TODO: Install LSP's -[[layers]] - # SPC ' - name = "shell" - default_position = "top" - default_height = 65 -[[layers]] - name = "colorscheme" -[[layers]] - # SPC g . - name = "VersionControl" -[[layers]] - # SPC g - name = "git" -[[layers]] - # SPC g h - name = "github" - # TODO: Setup Github token login -[[layers]] - # SPC e - # Install: npm install -g eslint eslint-config-airbnb - name = "checkers" - # TODO: Battery conservation by delayed linting. -[[layers]] - name = "ui" -[[layers]] - name = "tools" -[[layers]] - # Install: dnf install global global-ctags - name = "tags" -[[layers]] - # CTL p - name = "denite" -[[layers]] - # SPC d - name = "debug" -[[layers]] - name = "edit" -[[layers]] - # SPC f - name = "sudo" -[[layers]] - # CTL - name = "tmux" - -[[layers]] - name = "lsp" - filetypes = [ - ## "python" # Install: pip install --user 'python-language-server[all]' - ## "openscad", - ## "json", - # "sh", # Install: npm install -g bash-language-server - # "dockerfile", # Install: npm install -g dockerfile-language-server-nodejs - # "javascript", # Install: npm install -g javascript-typescript-langserver - # "c", # Install: cquery (https://github.com/cquery-project) - # "cpp", - # "java" # Install: eclipse-jdt (https://github.com/eclipse/eclipse.jdt.ls) - ] - [layers.override_cmd] - ## python = ["pyls", "--check-parent-process"] - # json = ["python3", "/home/max/src/pygls/examples/json-extension/server/__main__.py"] - # openscad = ["tcp://127.0.0.1:2087"] - # dockerfile = ["docker-langserver", "--stdio"] - # c = ["cquery", "--log-file=/tmp/cquery.log", '--init={"cacheDirectory":"/tmp/cquery/", "completion": {"filterAndSort": false}}'] - # cpp = ["cquery", "--log-file=/tmp/cquery.log", '--init={"cacheDirectory":"/tmp/cquery/", "completion": {"filterAndSort": false}}'] - # java = ["eclipse-jdt"] - # TODO: Battery saving techniques. -[[layers]] - # Install: pip install flake8 yapf autoflake isort - enable = false - name = "lang#python" - format-on-save = 1 -[[layers]] - name = "lang#java" - enable = false -#[[layers]] - ## Install: dnf install clang clang-libs - #name = "lang#c" - #clang_executable = "/usr/bin/clang" - #libclang_path = "/usr/lib64/libclang.so.7" - #[layer.clang_std] - #c = "gnu11" - #cpp = "gnu++11" - #objc = "gnu11" - #objcpp = "gnu++11" -[[layers]] - enable = false - name = "lang#sh" -[[layers]] - # SPC j - enable = false - name = "lang#javascript" -[[layers]] - # Install: npm install -g remark remark-cli remark-stringify - enable = false - name = "lang#markdown" -[[layers]] - # Install: npm install -g typescript javascript-typescript-langserver - enable = false - name = "lang#typescript" -[[layers]] - # Install: curl https://sh.rustup.rs -sSf | sh - # Install: rustup component add rust-src - # Install: cargo install racer - enable = false - name = "lang#rust" - recommended-style = true -[[layers]] - name = "lang#r" diff --git a/config/awesome/scripts/locker.sh b/config/awesome/scripts/locker.sh index 1ff4bb8..d52a9b0 100755 --- a/config/awesome/scripts/locker.sh +++ b/config/awesome/scripts/locker.sh @@ -1,4 +1,4 @@ #!/bin/bash exec xautolock -detectsleep \ - -time 10 -locker "light-locker-command -l" \ + -time 10 -locker "light-locker-command -l" diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 48bc26c..2355849 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -14,7 +14,7 @@ bspc config top_padding 20 bspc config split_ratio 0.50 bspc config borderless_monocle true bspc config gapless_monocle true -bspc config automatic_scheme alternate +bspc config automatic_scheme alternate # Use `xprop` to find these, use 2nd entry of WM_CLASS. bspc rule -a Gimp desktop='^8' state=floating follow=on @@ -35,8 +35,7 @@ bspc rule -a Yad state=floating sticky bspwm_log_root="/tmp/bspwm_logs" -function runOnce() -{ +function runOnce() { cmd="${1}" fork="${2}" logfile="${3}" diff --git a/config/btop/btop.conf b/config/btop/btop.conf index c86f8e6..4b71e07 100644 --- a/config/btop/btop.conf +++ b/config/btop/btop.conf @@ -72,7 +72,7 @@ proc_colors = True proc_gradient = True #* If process cpu usage should be of the core it's running on or usage of the total available cpu power. -proc_per_core = False +proc_per_core = True #* Show process memory as bytes instead of percent. proc_mem_bytes = True diff --git a/config/chrony.conf b/config/etc/chrony.conf similarity index 96% rename from config/chrony.conf rename to config/etc/chrony.conf index fca496f..a2efb8e 100644 --- a/config/chrony.conf +++ b/config/etc/chrony.conf @@ -37,7 +37,27 @@ ! server 1.pool.ntp.org iburst ! server 2.pool.ntp.org iburst -# NTS +# Max's local mikrotik router +server 192.168.1.1 iburst trust prefer + +# High-profile NTP servers +server tick.cerias.purdue.edu iburst trust +server tock.cerias.purdue.edu iburst trust +server time.nist.gov iburst trust +server tick.usno.navy.mil iburst trust +server tock.usno.navy.mil iburst trust + +# Popular, high-precision NTP servers +server time.apple.com iburst +server ntp1.net.berkeley.edu iburst +server ntp2.net.berkeley.edu iburst +server clock.isc.org iburst +server time.google.com iburst + +# Pools +pool us.pool.ntp.org iburst + +# Network Time Security (NTS) servers server time.cloudflare.com iburst nts server sth1.nts.netnod.se iburst nts server sth2.nts.netnod.se iburst nts @@ -47,7 +67,6 @@ server ptbtime1.ptb.de iburst nts server ptbtime2.ptb.de iburst nts server ptbtime3.ptb.de iburst nts - ####################################################################### ### AVOIDING POTENTIALLY BOGUS CHANGES TO YOUR CLOCK # diff --git a/config/dnf.conf b/config/etc/dnf/dnf.conf similarity index 100% rename from config/dnf.conf rename to config/etc/dnf/dnf.conf diff --git a/config/etc/issue b/config/etc/issue new file mode 100644 index 0000000..2c4ccfe --- /dev/null +++ b/config/etc/issue @@ -0,0 +1,8 @@ +################################################################################ +# This system is restricted to authorized individuals. Actual or attempted # +# unauthorized use of this system will result in criminal and/or civil # +# prosecution. We reserve the right to view, monitor, and record activity # +# without notice or permission. Any information obtained in connection to # +# criminal activity on this system is subject to review by law enforcement. If # +# you are not an authorized user of this system, disconnect immediately. # +################################################################################ diff --git a/config/etc/issue.net b/config/etc/issue.net deleted file mode 100644 index 139b7bc..0000000 --- a/config/etc/issue.net +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# This system is restricted to authorized individuals. Actual or attempted # -# unauthorized use of this system will result in criminal and/or civil # -# prosecution. We reserve the right to view, monitor, and record activity # -# without notice or permission. Any information obtained in connection to # -# criminal activity on this system is subject to review by law enforcement. If # -# you are not an authorized user of this system, disconnect immediately. # -################################################################################ diff --git a/config/etc/issue.net b/config/etc/issue.net new file mode 120000 index 0000000..95d9832 --- /dev/null +++ b/config/etc/issue.net @@ -0,0 +1 @@ +issue \ No newline at end of file diff --git a/config/etc/motd b/config/etc/motd new file mode 100644 index 0000000..c1528d2 --- /dev/null +++ b/config/etc/motd @@ -0,0 +1,10 @@ +Welcome back to ! + +, . + + + + +Hardware:  +Domain:  +Location:  diff --git a/config/pacman.conf b/config/etc/pacman.conf similarity index 100% rename from config/pacman.conf rename to config/etc/pacman.conf diff --git a/config/pacman.d/hooks/nvidia.hook b/config/etc/pacman.d/hooks/nvidia.hook similarity index 100% rename from config/pacman.d/hooks/nvidia.hook rename to config/etc/pacman.d/hooks/nvidia.hook diff --git a/config/pacman.d/hooks/refind.hook b/config/etc/pacman.d/hooks/refind.hook similarity index 100% rename from config/pacman.d/hooks/refind.hook rename to config/etc/pacman.d/hooks/refind.hook diff --git a/config/systemd/zram-generator.conf b/config/etc/systemd/zram-generator.conf similarity index 100% rename from config/systemd/zram-generator.conf rename to config/etc/systemd/zram-generator.conf diff --git a/config/xdg/reflector/reflector.conf b/config/etc/xdg/reflector/reflector.conf similarity index 100% rename from config/xdg/reflector/reflector.conf rename to config/etc/xdg/reflector/reflector.conf diff --git a/config/gtk-3.0/bookmarks b/config/gtk-3.0/bookmarks index e54ebd3..6103a58 100644 --- a/config/gtk-3.0/bookmarks +++ b/config/gtk-3.0/bookmarks @@ -1,7 +1,5 @@ -file:///home/max/Downloads Downloads -file:///home/max/Documents Documents -file:///home/max/Pictures Pictures -file:///home/max/Videos Videos -file:///home/max/src src -file:///home/max/Nextcloud Nextcloud -davs://max@cloud.maxocull.com/remote.php/dav/files/max max on cloud.maxocull.com +file:///home/mocull/src src +file:///home/mocull/aura/sc aura-sc +file:///home/mocull/aura/sc/fos-data-testsuite/archives Test Archives +file:///home/mocull/Nextcloud Nextcloud +nfs://maxocull.com/src/flamenco flamenco@maxocull.com diff --git a/config/gtk-3.0/gtk.css b/config/gtk-3.0/gtk.css index 6a56664..00dbd39 100644 --- a/config/gtk-3.0/gtk.css +++ b/config/gtk-3.0/gtk.css @@ -1,4 +1,5 @@ +/* stylelint-disable selector-type-no-unknown */ /* For tiling WM's */ .solid-csd headerbar .title { - font-size: 0; + font-size: 0; } diff --git a/config/i3/init b/config/i3/init index 4601505..6a3aaae 100755 --- a/config/i3/init +++ b/config/i3/init @@ -9,7 +9,7 @@ export ETH_INTERFACE=enp0s31f6 # Compton killall -q compton -while pgrep -x compton >/dev/null; do sleep 0.1s; done +while pgrep -x compton > /dev/null; do sleep 0.1s; done #compton -f -D 2 -i 0.85 -z \ #--backend glx --glx-no-stencil --glx-no-rebind-pixmap --glx-swap-method exchange \ #-b @@ -17,7 +17,7 @@ compton --opengl --vsync opengl-swc --paint-on-overlay -cCG -r 10 -o 0.5 -l-12 - # Polybar killall -q polybar -while pgrep -x polybar >/dev/null; do sleep 0.1s; done +while pgrep -x polybar > /dev/null; do sleep 0.1s; done polybar main & @@ -28,6 +28,6 @@ polybar main & # ckb-next killall -q ckb-next -while pgrep -x ckb-next >/dev/null; do sleep 0.1s; done +while pgrep -x ckb-next > /dev/null; do sleep 0.1s; done ckb-next -b & diff --git a/config/newsboat/urls b/config/newsboat/urls index 7fed141..8fa372a 100644 --- a/config/newsboat/urls +++ b/config/newsboat/urls @@ -3,8 +3,8 @@ ## Reuters All #https://news.google.com/rss/search?q=when:24h+allinurl:reuters.com&ceid=US:en&hl=en-US&gl=US "~Reuters" "news" "politics" "economics" "world" -## Reuters Top News -https://rss.maxocull.com/?action=display&bridge=Reuters&feed=home%2Ftopnews&format=Atom "~Reuters" "news" "politics" "economics" "world" +## Reuters Top News: Broken, hasn't updated for years +#https://rss.maxocull.com/?action=display&bridge=ReutersBridge&feed=home%2Ftopnews&format=Atom "~Reuters" "news" "politics" "economics" "world" ## WikiNews https://en.wikinews.org/w/index.php?title=Special:NewsFeed&feed=atom&categories=Published¬categories=No%20publish%7CArchived%7CAutoArchived%7Cdisputed&namespace=0&count=30&hourcount=124&ordermethod=categoryadd&stablepages=only "~WikiNews" "news" "politics" "economics" "world" ## Associated Press @@ -40,19 +40,19 @@ https://www.troyhunt.com/rss/ "~Troy Hunt" "security" "computer" ## Schneier https://schneier.com/blog/atom.xml "~Schneier" "security" "computer" ## Cryptocurrency -https://coindesk.com/rss "~CoinDesk" "economics" "computer" +https://www.coindesk.com/arc/outboundfeeds/rss/ "~CoinDesk" "economics" "computer" ## Popular Mechanics http://www.popularmechanics.com/rss/ "~Popular Mechanics" "stem" ## Scientific American -http://rss.sciam.com/ScientificAmerican-News "~Scientific American" "stem" +https://rss.maxocull.com/?action=display&bridge=ScientificAmericanBridge&parseIssues=10&format=Atom "~Scientific American" "stem" ## Sky & Telescope https://www.skyandtelescope.com/astronomy-news/feed/ "~Sky and Telescope" "astronomy" "stem" -## Dark Reading -https://www.darkreading.com/rss_simple.asp "~Dark Reading" "security" "computer" -## Naked Security -https://nakedsecurity.sophos.com/feed "~Naked Security" "security" "computer" -## Arch Linux -https://www.archlinux.org/feeds/news/ "~Arch Linux" "security" "computer" +## Dark Reading: Broken, even on RSS Bridge +#https://www.darkreading.com/rss_simple.asp "~Dark Reading" "security" "computer" +## Sophos, in replacement of Naked Security +https://news.sophos.com/en-us/category/threat-research/feed "~Sophos Threat Research" "security" "computer" +## Arch Linux: Broken +#https://www.archlinux.org/feeds/news/ "~Arch Linux" "security" "computer" ## NASA https://www.nasa.gov/rss/dyn/breaking_news.rss "~NASA" "astronomy" "stem" ## Biomed Central (BMC) @@ -63,19 +63,21 @@ http://feeds.nature.com/nature/rss/current "~Nature" "stem" "academia" https://tools.cdc.gov/podcasts/feed.asp?feedid=183 "~CDC" "stem" ## Cryptome -https://rss.maxocull.com/?action=display&bridge=Cryptome&n=20&format=Atom "~Cryptome" "politics" "computer" "security" +https://rss.maxocull.com/?action=display&bridge=CryptomeBridge&n=20&format=Atom "~Cryptome" "politics" "computer" "security" ## Have I Been Pwned https://rss.maxocull.com/?action=display&bridge=HaveIBeenPwned&order=dateAdded&item_limit=20&format=Atom "~Have I Been Pwned" "computer" "security" ## OpenWRT https://rss.maxocull.com/?action=display&bridge=OpenwrtSecurity&format=Atom "~OpenWRT" "computer" "security" ## r/WallStreetBets https://rss.maxocull.com/?action=display&bridge=Reddit&context=single&r=wallstreetbets&format=Atom "~r/WallStreetBets" "economics" "meme" -## WikiLeaks -https://rss.maxocull.com/?action=display&bridge=WikiLeaks&category=-Leaks-&teaser=on&format=Atom "~WikiLeaks" "politics" "security" "news" "world" +## WikiLeaks: Broken, hasn't updated for years +#https://rss.maxocull.com/?action=display&bridge=WikiLeaks&category=-Leaks-&teaser=on&format=Atom "~WikiLeaks" "politics" "security" "news" "world" ## @elonmusk https://rss.maxocull.com/?action=display&bridge=Twitter&context=By+username&u=elonmusk&norep=on&nopic=on&noimgscaling=on&format=Atom "~@elonmusk" "memes" ## Reddit Memes https://rss.maxocull.com/?action=display&bridge=Reddit&context=multi&rs=memeeconomy%2C+dankmemes%2C+politicalcompassmemes%2C+libertarianmemes%2C+voluntaristmemes&format=Atom "~Reddit Memes" "memes" +## LWN.net +https://lwn.net/headlines/rss "~LWN.net" "computer" "security" ## Daily Deals https://camelcamelcamel.com/top_drops/feed?t=daily& "~Electronics Deals" "computer" diff --git a/config/nvim/coc-settings.json b/config/nvim/coc-settings.json index 4e8e378..83df620 100644 --- a/config/nvim/coc-settings.json +++ b/config/nvim/coc-settings.json @@ -72,6 +72,7 @@ } }, "prettier.printWidth": 80, + "pyright.inlayHints.parameterTypes": false, "python.linting.pep8Enabled": true, "python.linting.pylintEnabled": false, "python.pythonPath": "python3", diff --git a/config/nvim/includes/language_servers.vim b/config/nvim/includes/language_servers.vim index 3471e3e..282e821 100644 --- a/config/nvim/includes/language_servers.vim +++ b/config/nvim/includes/language_servers.vim @@ -25,8 +25,8 @@ let g:coc_global_extensions = [ \ 'coc-tslint-plugin', \ 'coc-tsserver', \ 'coc-vetur', - \ 'coc-vimtex', \ 'coc-vimlsp', + \ 'coc-vimtex', \ 'coc-yaml', \ 'coc-yank', \] @@ -41,6 +41,7 @@ let g:coc_global_extensions = [ "\ 'coc-neco', " Install via plugin manager. "\ 'coc-neoinclude', " Install via plugin manager. "\ 'coc-word', + "\ 'coc-xml', " it's lame " INSTALL: go get golang.org/x/tools/cmd/gopls " INSTALL: pacman -Syu lua53 luarocks diff --git a/config/nvim/includes/plugin_settings.vim b/config/nvim/includes/plugin_settings.vim index 8ae4824..543a208 100644 --- a/config/nvim/includes/plugin_settings.vim +++ b/config/nvim/includes/plugin_settings.vim @@ -13,11 +13,12 @@ let g:ale_virtualtext_prefix = ' ]] ' let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], \ 'javascript': ['eslint'], -\ 'typescript': ['eslint'], -\ 'jsx': ['eslint'], \ 'json': ['jq'], +\ 'jsx': ['eslint'], \ 'python': ['black'], \ 'rust': ['rustfmt'], +\ 'typescript': ['eslint'], +\ 'xml': ['xmllint'], \ 'yaml': [], \} @@ -25,17 +26,17 @@ let g:ale_fixers = { let g:ale_linters = { \ 'c': [], \ 'cpp': [], -\ 'python': [], +\ 'css': [], +\ 'go': [], +\ 'html': [], \ 'java': [], -\ 'json': [], \ 'javascript': [], -\ 'typescript': [], +\ 'json': [], \ 'jsx': [], -\ 'css': [], -\ 'html': [], +\ 'python': [], \ 'ruby': [], \ 'rust': [], -\ 'go': [], +\ 'typescript': [], \ 'yaml': [], \} @@ -307,4 +308,10 @@ let g:list_of_insert_keys = [] let g:list_of_disabled_keys = [] let g:hardtime_timeout = 2000 let g:hardtime_maxcount = 0 + +" Add spaces after the comment leader. +let g:NERDSpaceDelims = 1 + +" Preserve indentation when block commenting +let g:NERDDefaultAlign = 'left' " }}} diff --git a/config/nvim/includes/plugins.vim b/config/nvim/includes/plugins.vim index 2e38f7e..8a3c80f 100644 --- a/config/nvim/includes/plugins.vim +++ b/config/nvim/includes/plugins.vim @@ -63,7 +63,9 @@ call dein#add('github/copilot.vim') call dein#add('vim-test/vim-test') " Submit metrics to Activity Watcher. -call dein#add('ActivityWatch/aw-watcher-vim') +if executable('aw-qt') + call dein#add('ActivityWatch/aw-watcher-vim') +endif " }}} " Tim Pope Collection {{{ @@ -199,6 +201,11 @@ call dein#add('gurpreetatwal/vim-avro') call dein#add('urbit/hoon.vim') call dein#add('kalafut/vim-taskjuggler') + +call dein#add('momota/cisco.vim') + +" Display ANSI color codes +call dein#add('powerman/vim-plugin-AnsiEsc') " }}} " Aesthetics {{{ diff --git a/config/portage/make.conf b/config/portage/make.conf new file mode 100644 index 0000000..c855579 --- /dev/null +++ b/config/portage/make.conf @@ -0,0 +1,32 @@ +# These warnings indicate likely runtime problems with LTO, so promote them +# to errors. If a package fails to build with these, LTO should not be used there. +WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" + +COMMON_FLAGS="-O2 -march=native -pipe -fomit-frame-pointer -flto=auto ${WARNING_FLAGS}" +CFLAGS="${COMMON_FLAGS}" +CXXFLAGS="${COMMON_FLAGS}" +FCFLAGS="${COMMON_FLAGS}" +FFLAGS="${COMMON_FLAGS}" + +# This sets the language of build output to English. +# Please keep this setting intact when reporting bugs. +LC_MESSAGES=C.utf8 + +#SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" + +AUTOCLEAN="yes" +PORTAGE_SCHEDULING_POLICY="idle" +PORTAGE_TMPDIR="/var/tmp" +PORTAGE_NICENESS="10" +FEATURES="parallel-install parallel-fetch ccache" +MAKEOPTS="-j16 -l16" +EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 16" +CCACHE_SIZE="1G" + +GENTOO_MIRRORS="rsync://mirror.clarkson.edu/gentoo/ \ + rsync://rsync.gtlib.gatech.edu/gentoo \ + rsync://mirrors.mit.edu/gentoo-distfiles/ \ + rsync://mirrors.rit.edu/gentoo/" + +ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE NVIDIA-CUDA NVIDIA-SDK NVIDIA-cuDNN NVIDIA-r1 NVIDIA-r2" +GRUB_PLATFORMS="efi-64" diff --git a/config/portage/repos.conf/gentoo.conf b/config/portage/repos.conf/gentoo.conf new file mode 100644 index 0000000..cb88d68 --- /dev/null +++ b/config/portage/repos.conf/gentoo.conf @@ -0,0 +1,43 @@ +[DEFAULT] +main-repo = gentoo + +#[gentoo] +#priority = -1000 +#location = /var/db/repos/gentoo +#sync-type = git +#sync-uri = https://anongit.gentoo.org/git/repo/gentoo.git +#sync-depth = 1 +#auto-sync = yes + +#[gentoo] +#auto-sync = yes +#location = /var/db/repos/gentoo +#sync-depth = 1 +#sync-git-verify-commit-signature = yes +#sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc +#sync-openpgp-key-refresh-retry-count = 40 +#sync-openpgp-key-refresh-retry-delay-exp-base = 2 +#sync-openpgp-key-refresh-retry-delay-max = 60 +#sync-openpgp-key-refresh-retry-delay-mult = 4 +#sync-openpgp-key-refresh-retry-overall-timeout = 1200 +#sync-openpgp-keyserver = hkps://keys.gentoo.org +#sync-type = git +#sync-uri = https://github.com/gentoo-mirror/gentoo.git +#sync-webrsync-verify-signature = yes + +[gentoo] +location = /var/db/repos/gentoo +sync-type = rsync +sync-uri = rsync://rsync.us.gentoo.org/gentoo-portage +auto-sync = yes +sync-rsync-verify-jobs = 1 +sync-rsync-verify-metamanifest = yes +sync-rsync-verify-max-age = 3 +sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc +sync-openpgp-keyserver = hkps://keys.gentoo.org +sync-openpgp-key-refresh-retry-count = 40 +sync-openpgp-key-refresh-retry-overall-timeout = 1200 +sync-openpgp-key-refresh-retry-delay-exp-base = 2 +sync-openpgp-key-refresh-retry-delay-max = 60 +sync-openpgp-key-refresh-retry-delay-mult = 4 +sync-webrsync-verify-signature = yes diff --git a/config/rofi/menu/MAIN b/config/rofi/menu/MAIN index 9b8f82e..9730fc0 100755 --- a/config/rofi/menu/MAIN +++ b/config/rofi/menu/MAIN @@ -23,46 +23,46 @@ $task $proj $usem" | rofi "${ROFI_OPTIONS[@]}" -dmenu -i -p "search: ") -if [ "$another" == "$file" ] ; then +if [ "$another" == "$file" ]; then $HOME/.config/rofi/menu/locate -elif [ "$another" == "$task" ] ; then +elif [ "$another" == "$task" ]; then $HOME/.config/rofi/menu/task -elif [ "$another" == "$book" ] ; then +elif [ "$another" == "$book" ]; then $HOME/.config/rofi/menu/books -elif [ "$another" == "$note" ] ; then +elif [ "$another" == "$note" ]; then $HOME/.config/rofi/menu/note -elif [ "$another" == "$locl" ] ; then +elif [ "$another" == "$locl" ]; then exec $HOME/.config/rofi/menu/marks $HOME/sets/.notes/localhost.wiki -elif [ "$another" == "$clip" ] ; then +elif [ "$another" == "$clip" ]; then rofi "${ROFI_OPTIONS[@]}" -modi "clipboard:greenclip print" -show clipboard -elif [ "$another" == "$usem" ] ; then +elif [ "$another" == "$usem" ]; then appname=$(cat $HOME/.config/applist | grep "\S" | rofi "${ROFI_OPTIONS[@]}" -threads 0 -dmenu -i -p 'apps:') thelink=$(echo $appname | cut -d'+' -f3 | tr -d ' ') [[ ! -n $appname ]] && exit regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' - [[ $thelink =~ $regex ]]&& brave $thelink || $edit_with -e nvim ~/.config/applist + [[ $thelink =~ $regex ]] && brave $thelink || $edit_with -e nvim ~/.config/applist -elif [ "$another" == "$cont" ] ; then +elif [ "$another" == "$cont" ]; then exec $HOME/.config/rofi/menu/contacts -elif [ "$another" == "$proj" ] ; then +elif [ "$another" == "$proj" ]; then pather=$(/env/go/bin/proji ls | head -n-1 | tail -n+4 | cut -d "|" -f3-5 | tr "|" "\t" | rofi "${ROFI_OPTIONS[@]}" -threads 0 -dmenu -i -p 'projects:' | cut -f2) nameer=$(basename $pather) [[ $pather ]] && sed -e "s|.*root.*| root: $pather|" -e "1cname: \"$nameer\"" $HOME/.config/tmux/PRO.yml > $HOME/.config/tmux/prot.yml && /env/cpp/bin/tmass -l $HOME/.config/tmux load prot && kitty --class=til tmux attach -t $nameer # kitty --class=til tmux attach -t $nameer -elif [ "$another" == "$pass" ] ; then +elif [ "$another" == "$pass" ]; then exec $HOME/.config/rofi/menu/pass -elif [ -z "$another" ] ; then - echo "variable empty" && exit 1 +elif [ -z "$another" ]; then + echo "variable empty" && exit 1 else - exec nohup $another > /dev/null 2>&1 & + exec nohup $another > /dev/null 2>&1 & fi diff --git a/config/rofi/menu/sxhkd-help b/config/rofi/menu/sxhkd-help index f18f9c9..5b00159 100755 --- a/config/rofi/menu/sxhkd-help +++ b/config/rofi/menu/sxhkd-help @@ -1,5 +1,5 @@ #!/usr/bin/env bash -ROFI_OPTIONS=( -theme $HOME/.config/rofi/bar.theme.rasi -theme-str "*{accent: ${color1:-#3294ff}; font: \"Hack 12\";}") +ROFI_OPTIONS=(-theme $HOME/.config/rofi/bar.theme.rasi -theme-str "*{accent: ${color1:-#3294ff}; font: \"Hack 12\";}") options="$(awk '/^[a-z]/ && last {print $0,"\t",last} {last=""} /^#/{last=$0}' $HOME/.config/sxhkd/sxhkdrc | column -t -s $'\t')" chosen="$(echo -e "$options" | rofi "${ROFI_OPTIONS[@]}" -dmenu)" # -selected-row 2 diff --git a/config/rofi/menu/system b/config/rofi/menu/system index 6a8ab43..09d6e6e 100755 --- a/config/rofi/menu/system +++ b/config/rofi/menu/system @@ -1,5 +1,5 @@ #!/usr/bin/env bash -ROFI_OPTIONS=( -theme $HOME/.config/rofi/bar.theme.rasi -theme-str "*{accent: ${color1:-#3294ff};}") +ROFI_OPTIONS=(-theme $HOME/.config/rofi/bar.theme.rasi -theme-str "*{accent: ${color1:-#3294ff};}") shutdown="shutdown" reboot="reboot" @@ -15,21 +15,21 @@ YESNO="no\nyes" case $chosen in $shutdown) - [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && systemctl poweroff + [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && systemctl poweroff ;; $reboot) - [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && systemctl reboot + [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && systemctl reboot ;; $lock) - loginctl lock-session ${XDG_SESSION_ID-} + loginctl lock-session ${XDG_SESSION_ID-} ;; $suspend) - systemctl suspend + systemctl suspend ;; $hibernate) - systemctl hibernate + systemctl hibernate ;; $logout) - [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && loginctl terminate-session ${XDG_SESSION_ID-} + [ $(echo -e $YESNO | rofi "${ROFI_OPTIONS[@]}" -theme-str "*{accent: #e53714;}" -dmenu -i -p "Proceed?") == "yes" ] && loginctl terminate-session ${XDG_SESSION_ID-} ;; esac diff --git a/config/ssh/aws-ssm-ec2-proxy-command.sh b/config/ssh/aws-ssm-ec2-proxy-command.sh index d0e8298..afd8b32 100755 --- a/config/ssh/aws-ssm-ec2-proxy-command.sh +++ b/config/ssh/aws-ssm-ec2-proxy-command.sh @@ -40,18 +40,17 @@ ssh_public_key_path="$4" ssh_public_key="$(cat "${ssh_public_key_path}")" ssh_public_key_timeout=60 -if [[ "${ec2_instance_id}" == *"${REGION_SEPARATOR}"* ]] -then - export AWS_DEFAULT_REGION="${ec2_instance_id##*${REGION_SEPARATOR}}" - ec2_instance_id="${ec2_instance_id%%${REGION_SEPARATOR}*}" +if [[ "${ec2_instance_id}" == *"${REGION_SEPARATOR}"* ]]; then + export AWS_DEFAULT_REGION="${ec2_instance_id##*${REGION_SEPARATOR}}" + ec2_instance_id="${ec2_instance_id%%${REGION_SEPARATOR}*}" fi ->/dev/stderr echo "Add public key ${ssh_public_key_path} for ${ssh_user} at instance ${ec2_instance_id} for ${ssh_public_key_timeout} seconds" +echo "Add public key ${ssh_public_key_path} for ${ssh_user} at instance ${ec2_instance_id} for ${ssh_public_key_timeout} seconds" > /dev/stderr aws ssm send-command \ - --instance-ids "${ec2_instance_id}" \ - --document-name 'AWS-RunShellScript' \ - --comment "Add an SSH public key to authorized_keys for ${ssh_public_key_timeout} seconds" \ - --parameters commands="\" + --instance-ids "${ec2_instance_id}" \ + --document-name 'AWS-RunShellScript' \ + --comment "Add an SSH public key to authorized_keys for ${ssh_public_key_timeout} seconds" \ + --parameters commands="\" mkdir -p ~${ssh_user}/.ssh && cd ~${ssh_user}/.ssh || exit 1 authorized_key='${ssh_public_key} ssm-session' @@ -63,8 +62,8 @@ aws ssm send-command \ mv .authorized_keys authorized_keys \"" ->/dev/stderr echo "Start ssm session to instance ${ec2_instance_id}" +echo "Start ssm session to instance ${ec2_instance_id}" > /dev/stderr aws ssm start-session \ - --target "${ec2_instance_id}" \ - --document-name 'AWS-StartSSHSession' \ - --parameters "portNumber=${ssh_port}" + --target "${ec2_instance_id}" \ + --document-name 'AWS-StartSSHSession' \ + --parameters "portNumber=${ssh_port}" diff --git a/config/ssh/config b/config/ssh/config index 17c823b..f375bca 100644 --- a/config/ssh/config +++ b/config/ssh/config @@ -13,28 +13,40 @@ Host * AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa -Host maxocull.com +Host entourage maxocull.com HostName maxocull.com User entourage - IdentityFile ~/.ssh/id_rsa + ForwardX11 yes + ForwardX11Trusted yes + +Host git.alanocull.com pi.alanocull.com git.maxocull.com + HostName git.alanocull.com + Port 2212 Host leviathan - HostName 192.168.1.72 + HostName 192.168.1.11 #ProxyJump maxocull.com User max - IdentityFile ~/.ssh/id_rsa + ForwardX11 yes + ForwardX11Trusted yes + +Host citadel + HostName 192.168.1.13 + #ProxyJump maxocull.com + User citadel + ForwardX11 yes + ForwardX11Trusted yes Host rb3011 HostName 192.168.1.1 User max - IdentityFile ~/.ssh/id_rsa Host capax HostName 192.168.1.2 User max - IdentityFile ~/.ssh/id_rsa -host libreelec +Host libreelec HostName 192.168.1.30 User root - IdentityFile ~/.ssh/id_rsa + ForwardX11 yes + ForwardX11Trusted yes diff --git a/install.sh b/install.sh index 8639591..825f418 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ # TODO: Convert this script to shell so it can run on lighter systems. -MISC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +MISC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)" if [ -n "${AUTOMATED}" ]; then AUTOMATED_PACMAN_FLAGS="--noconfirm" @@ -13,13 +13,13 @@ fi echo "Linking from ${MISC_DIR} ..." -TEXT_RED='\033[0;91m'; -TEXT_RESET='\033[0m'; -TEXT_BLINK='\033[5m'; +TEXT_RED='\033[0;91m' +TEXT_RESET='\033[0m' +TEXT_BLINK='\033[5m' -link_skipped_files=""; -link_linked_files=""; -link_overwritten_files=""; +link_skipped_files="" +link_linked_files="" +link_overwritten_files="" link_source() { src="${MISC_DIR}/${1}" @@ -59,6 +59,7 @@ link_source .ctags 1 link_source .bashrc 1 link_source .zshrc 1 link_source .tmux.conf 1 +link_source .tmux.sh 1 link_source .tmuxline.conf 1 link_source .Xdefaults 1 link_source .Xdefaults 1 .Xresources @@ -116,11 +117,13 @@ link_source "config/fontconfig/" 0 ".config/fontconfig" link_source "config/pcmanfm/" 1 ".config/pcmanfm" link_source "config/xmrig.json" 1 ".config/xmrig.json" link_source "config/redrum.ini" 1 ".config/redrum.ini" -link_source "config/mimeapps.list" 1 ".config/mimeapps.list" -link_source "config/mimeapps.list" 1 ".local/share/applications/mimeapps.list" link_source "config/btop/" 1 ".config/btop" link_source "config/Kvantum/" 1 ".config/Kvantum" +mkdir -p "${HOME}/.local/share/applications/" +link_source "config/mimeapps.list" 1 ".config/mimeapps.list" +link_source "config/mimeapps.list" 1 ".local/share/applications/mimeapps.list" + mkdir -p "${HOME}/.config/variety" link_source "config/variety/variety.conf" 1 ".config/variety/variety.conf" @@ -163,7 +166,7 @@ echo "Environment installation complete" read -r -p "Would you like to attempt an install of common utilities? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) # TODO: Verify weechat plugins are installed (probably aren't). if [[ -x "$(command -v dnf)" ]]; then # shell-gpt needs python3-devel on Fedora. @@ -229,8 +232,36 @@ case "$response" in weechat \ xsel \ zsh - elif [[ -x "$(command -v apt)" ]]; then - sudo apt install -y \ + elif [[ -x "$(command -v emerge)" ]]; then + # Possibly missing: npm, python3-neovim + sudo emerge --noreplace \ + app-crypt/gnupg \ + app-editors/neovim \ + app-misc/fastfetch \ + app-misc/tmux \ + app-shells/zsh \ + dev-build/make \ + dev-lang/python \ + dev-lang/ruby \ + dev-python/pip \ + dev-python/pipx \ + dev-ruby/rubygems \ + dev-util/ctags \ + dev-vcs/git \ + dev-vcs/git-crypt \ + dev-vcs/git-lfs \ + net-irc/weechat \ + net-libs/nodejs \ + net-misc/curl \ + net-misc/keychain \ + net-news/newsboat \ + sys-apps/ripgrep \ + sys-apps/util-linux \ + sys-devel/gcc \ + sys-process/btop \ + x11-misc/xsel + elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y \ btop \ ctags \ curl \ @@ -286,10 +317,10 @@ case "$response" in zsh if [[ -x "$(command -v yay)" ]]; then - yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ - aws-cli-v2 \ - fastfetch \ - --needed + yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ + aws-cli-v2 \ + fastfetch \ + --needed fi elif [[ -x "$(command -v pkg)" ]]; then sudo pkg install \ @@ -324,7 +355,8 @@ case "$response" in if [[ ! -x "$(command -v chezmoi)" ]]; then previous_dir="$(pwd)" - cd "${HOME}" && curl -sfL https://git.io/chezmoi | sh; cd "$previous_dir" || exit + cd "${HOME}" && curl -sfL https://git.io/chezmoi | sh + cd "$previous_dir" || exit fi if [[ -x "$(command -v pip2)" ]]; then @@ -338,11 +370,15 @@ case "$response" in pipx install ansible-lint pipx install ansible-navigator pipx install argcomplete + pipx install bandit + pipx install black pipx install flake8 pipx install flake8-pyproject + pipx install huggingface_hub pipx install isort pipx install molecule pipx install neovim + pipx install poetry pipx install pre-commit pipx install shell-gpt pipx install thefuck @@ -353,9 +389,13 @@ case "$response" in ansible-core \ ansible-lint \ argcomplete \ + bandit \ + black \ flake8 \ + huggingface_hub \ isort \ neovim \ + poetry \ shell-gpt \ thefuck \ tmuxp @@ -386,6 +426,9 @@ case "$response" in sh -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh)" -- "${HOME}/.cache/dein" --use-neovim-config fi + # Forcibly fix permissions on the GnuPG directory + chmod u+rwx,go-rwx "${HOME}/.gnupg" + # Pull GPG keys for max.ocull@protonmail.com gpg --receive-keys 9AC8DC8D17BA0401CBD0F4E16077844530A4A68E @@ -408,7 +451,6 @@ case "$response" in ## Seth Forshee, maintainer of wireless-regdb who has a built-in key in the kernel gpg --receive-keys 2ABCA7498D83E1D32D51D3B5AB4800A62DB9F73A - # Arch Linux Official Keys # https://archlinux.org/master-keys/ ## Florian Pritz @@ -425,9 +467,15 @@ case "$response" in # AWS CLI Team gpg --keyserver keyserver.ubuntu.com --receive-keys FB5DB77FD5C118B80511ADA8A6310ACC4672475C + # Github CLI: opensource+cli@github.com + ## You may need this: + ## https://github.com/cli/cli/issues/9569 + gpg --receive-keys 2C6106201985B60E6C7AC87323F3D4EA75716059 - if [[ ! "$SHELL" =~ "zsh" ]]; then - chsh -s "$(command -v zsh)" "${USER}" + if [ -s /bin/zsh ]; then + if [[ ! "$SHELL" =~ "zsh" ]]; then + chsh -s /bin/zsh "${USER}" + fi fi ;; *) @@ -437,7 +485,7 @@ esac read -r -p "Would you like to install AWS CLI (v2)? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig" -o "awscliv2.sig" @@ -461,309 +509,330 @@ esac read -r -p "Would you like to add unofficial package repositories? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) - if [[ -x "$(command -v dnf)" ]]; then - sudo dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" - sudo dnf install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" - - # Add repo for Brave - sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo - sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - - # Add repo for Docker - sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo - - # Import PGP key for VeraCrypt. - sudo rpm --import https://www.idrix.fr/VeraCrypt/VeraCrypt_PGP_public_key.asc - - # Add Copr repo for OpenVPN Connect - ## This repo does not have an x64 build for Fedora 39 for some reason? - ##sudo dnf copr enable dsommers/openvpn3 - # This one works: - sudo dnf copr enable ojab/openvpn3 - - # Add Copr repo for Bazel - # This is WAY out of date. Do not use! - - # Add Signal Desktop repo - sudo dnf config-manager --add-repo "https://download.opensuse.org/repositories/network:im:signal/Fedora_$(rpm -E %fedora)/network:im:signal.repo" - - # Add Github CLI repo - sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo - - # Update all the new repositories - sudo dnf check-update --refresh - - read -r -p "Would you like to install Brave? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo dnf install -y brave-browser - ;; - *) - echo "Skipping Brave installation" - ;; - esac - - read -r -p "Would you like to install Docker? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - sudo systemctl enable docker - sudo systemctl start docker - ;; - *) - echo "Skipping Docker installation" - ;; - esac - - read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo dnf install -y https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm - ;; - *) - echo "Skipping AWS Session Manager Plugin installation" - ;; - esac - - read -r -p "Would you like to install Github CLI? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo dnf install -y gh - ;; - *) - echo "Skipping Github CLI installation" - ;; - esac - - read -r -p "Would you like to install Signal Desktop? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo dnf install -y signal-desktop - ;; - *) - echo "Skipping Signal Desktop installation" - ;; - esac - elif [[ -x "$(command -v apt)" ]]; then - # Install tools for adding repositories - sudo apt-get install -y apt-transport-https - - # Make sure the keyrings directory exists - sudo mkdir -p -m 755 /etc/apt/keyrings - - # Keys and repository for Kubernetes - curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg - sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring - echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list - sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly - - # Keys and repository for Helm - curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list - - # Keys and repository for Github CLI - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null - sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - - sudo apt-get update - - read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb" - sudo dpkg -i "session-manager-plugin.deb" - rm -f "session-manager-plugin.deb" - ;; - *) - echo "Skipping AWS Session Manager Plugin installation" - ;; - esac - - read -r -p "Would you like to install Kubernetes? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo apt-get install -y kubectl - ;; - *) - echo "Skipping Kubernetes installation" - ;; - esac - - read -r -p "Would you like to install Helm? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo apt-get install -y helm - ;; - *) - echo "Skipping Helm installation" - ;; - esac - - read -r -p "Would you like to install Github CLI? [y/N] " response - case "$response" in - [yY][eE][sS]|[yY]) - sudo apt-get install -y gh - ;; - *) - echo "Skipping Github CLI installation" - ;; - esac - elif [[ -x "$(command -v pacman)" ]]; then - echo "No repositories for pacman yet" - # TODO: Set up yay. - fi - ;; - *) - echo "Skipping unofficial package repository installation" - ;; + [yY][eE][sS] | [yY]) + if [[ -x "$(command -v dnf)" ]]; then + sudo dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" + sudo dnf install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" + + # Add repo for Brave + sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo + sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + + # Add repo for Docker + sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + + # Import PGP key for VeraCrypt. + sudo rpm --import https://www.idrix.fr/VeraCrypt/VeraCrypt_PGP_public_key.asc + + # Add Copr repo for OpenVPN Connect + ## This repo does not have an x64 build for Fedora 39 for some reason? + ##sudo dnf copr enable dsommers/openvpn3 + # This one works: + sudo dnf copr enable ojab/openvpn3 + + # Add Copr repo for Bazel + # This is WAY out of date. Do not use! + + # Add Signal Desktop repo + sudo dnf config-manager --add-repo "https://download.opensuse.org/repositories/network:im:signal/Fedora_$(rpm -E %fedora)/network:im:signal.repo" + + # Add Github CLI repo + sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + + # Update all the new repositories + sudo dnf check-update --refresh + + if [ -n "${AUTOMATED}" ]; then + response='n' + else + read -r -p "Would you like to install Brave? [y/N] " response + fi + case "$response" in + [yY][eE][sS] | [yY]) + sudo dnf install -y brave-browser + ;; + *) + echo "Skipping Brave installation" + ;; + esac + + if [ -n "${AUTOMATED}" ]; then + response='n' + else + read -r -p "Would you like to install Docker? [y/N] " response + fi + case "$response" in + [yY][eE][sS] | [yY]) + sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + sudo systemctl enable docker + sudo systemctl start docker + ;; + *) + echo "Skipping Docker installation" + ;; + esac + + read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + sudo dnf install -y https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm + ;; + *) + echo "Skipping AWS Session Manager Plugin installation" + ;; + esac + + read -r -p "Would you like to install Github CLI? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + sudo dnf install -y gh + ;; + *) + echo "Skipping Github CLI installation" + ;; + esac + + if [ -n "${AUTOMATED}" ]; then + response='n' + else + read -r -p "Would you like to install Signal Desktop? [y/N] " response + fi + case "$response" in + [yY][eE][sS] | [yY]) + sudo dnf install -y signal-desktop + ;; + *) + echo "Skipping Signal Desktop installation" + ;; + esac + elif [[ -x "$(command -v apt-get)" ]]; then + # Install tools for adding repositories + sudo apt-get install -y apt-transport-https + + # Make sure the keyrings directory exists + sudo mkdir -p -m 755 /etc/apt/keyrings + + # Keys and repository for Kubernetes + curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg + sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring + echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list + sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly + + # Keys and repository for Helm + curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list + + # Keys and repository for Github CLI + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null + sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + + sudo apt-get update + + read -r -p "Would you like to install AWS Session Manager Plugin? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb" + sudo dpkg -i "session-manager-plugin.deb" + rm -f "session-manager-plugin.deb" + ;; + *) + echo "Skipping AWS Session Manager Plugin installation" + ;; + esac + + read -r -p "Would you like to install Kubernetes? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + sudo apt-get install -y kubectl + ;; + *) + echo "Skipping Kubernetes installation" + ;; + esac + + read -r -p "Would you like to install Helm? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + sudo apt-get install -y helm + ;; + *) + echo "Skipping Helm installation" + ;; + esac + + read -r -p "Would you like to install Github CLI? [y/N] " response + case "$response" in + [yY][eE][sS] | [yY]) + sudo apt-get install -y gh + ;; + *) + echo "Skipping Github CLI installation" + ;; + esac + elif [[ -x "$(command -v pacman)" ]]; then + echo "No repositories for pacman yet" + # TODO: Set up yay. + fi + ;; + *) + echo "Skipping unofficial package repository installation" + ;; esac -read -r -p "Would you like to attempt an install of bspwm? [y/N] " response +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to attempt an install of bspwm? [y/N] " response +fi case "$response" in - [yY][eE][sS]|[yY]) - if [[ -x "$(command -v dnf)" ]]; then - # TODO: Fill the rest in. - sudo dnf install \ - @base-x \ - bspwm \ - copyq \ - dunst \ - lxappearance \ - materia-gtk-theme \ - materia-kde \ - nitrogen \ - papirus-icon-theme \ - pcmanfm \ - qt6ct \ - rofi \ - sxhkd \ - sxiv \ - variety \ - yad \ - xarchiver \ - -y - elif [[ -x "$(command -v apt)" ]]; then - # NetworkManager pre-installed. - sudo apt install \ - bspwm \ - copyq \ - dunst \ - lxappearance \ - materia-gtk-theme \ - materia-kde \ - murrine-themes \ - nitrogen \ - papirus-icon-theme \ - pcmanfm \ - qt6ct \ - rofi \ - sxhkd \ - sxiv \ - variety \ - xarchiver \ - xorg \ - yad \ - -y - - echo "You will need to build polybar from source: https://github.com/polybar/polybar/wiki/Compiling" - echo "python-xcbgen may need to be changed to python3-xcbgen" - sudo apt install -y build-essential git cmake cmake-data pkg-config python3-sphinx python3-packaging libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev i3-wm libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libnl-genl-3-dev - - echo "You will need to build picom from source: https://github.com/yshui/picom#build" - sudo apt install -y libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev - elif [[ -x "$(command -v pacman)" ]]; then - sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ - bspwm \ - copyq \ - dunst \ - gtk-engine-murrine \ - kvantum-theme-materia \ - lxappearance \ - materia-gtk-theme \ - materia-kde \ - network-manager-applet \ - nitrogen \ - nm-connection-editor \ - papirus-icon-theme \ - pcmanfm-gtk3 \ - picom \ - polybar \ - qt6ct \ - rofi \ - sxhkd \ - variety \ - xarchiver \ - xorg-server \ - yad \ - --needed - - if [[ -x "$(command -v yay)" ]]; then - yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ - ly \ - nsxiv \ - --needed - fi - elif [[ -x "$(command -v pkg)" ]]; then - sudo pkg install \ - Kvantum-qt5 \ - bspwm \ - copyq \ - dunst \ - gtk-murrine-engine \ - lxappearance \ - ly \ - materia-gtk-theme \ - ncurses \ - nitrogen \ - nsxiv \ - papirus-icon-theme \ - pcmanfm-gtk3 \ - picom \ - pidof \ - polybar \ - qt6ct \ - rofi \ - sxhkd \ - variety \ - xarchiver \ - xorg \ - yad - - # Could not find these: - #materia-kde \ - #network-manager-applet \ - #nm-connection-editor \ - fi + [yY][eE][sS] | [yY]) + if [[ -x "$(command -v dnf)" ]]; then + # TODO: Fill the rest in. + sudo dnf install \ + @base-x \ + bspwm \ + copyq \ + dunst \ + lxappearance \ + materia-gtk-theme \ + materia-kde \ + nitrogen \ + papirus-icon-theme \ + pcmanfm \ + qt6ct \ + rofi \ + sxhkd \ + sxiv \ + variety \ + yad \ + xarchiver \ + -y + elif [[ -x "$(command -v apt-get)" ]]; then + # NetworkManager pre-installed. + sudo apt-get install \ + bspwm \ + copyq \ + dunst \ + lxappearance \ + materia-gtk-theme \ + materia-kde \ + murrine-themes \ + nitrogen \ + papirus-icon-theme \ + pcmanfm \ + qt6ct \ + rofi \ + sxhkd \ + sxiv \ + variety \ + xarchiver \ + xorg \ + yad \ + -y + + echo "You will need to build polybar from source: https://github.com/polybar/polybar/wiki/Compiling" + echo "python-xcbgen may need to be changed to python3-xcbgen" + sudo apt-get install -y build-essential git cmake cmake-data pkg-config python3-sphinx python3-packaging libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev i3-wm libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libnl-genl-3-dev - #if [[ -x "$(command -v pip3)" ]]; then - #pip3 install --user \ - #fi + echo "You will need to build picom from source: https://github.com/yshui/picom#build" + sudo apt-get install -y libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev + elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ + bspwm \ + copyq \ + dunst \ + gtk-engine-murrine \ + kvantum-theme-materia \ + lxappearance \ + materia-gtk-theme \ + materia-kde \ + network-manager-applet \ + nitrogen \ + nm-connection-editor \ + papirus-icon-theme \ + pcmanfm-gtk3 \ + picom \ + polybar \ + qt6ct \ + rofi \ + sxhkd \ + variety \ + xarchiver \ + xorg-server \ + yad \ + --needed - # copy service files - #mkdir -p ~/.config/systemd/user/ - #cp -u services/redrum.service ~/.config/systemd/user/ - #cp -u services/redrum.timer ~/.config/systemd/user/ + if [[ -x "$(command -v yay)" ]]; then + yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ + ly \ + nsxiv \ + --needed + fi + elif [[ -x "$(command -v pkg)" ]]; then + sudo pkg install \ + Kvantum-qt5 \ + bspwm \ + copyq \ + dunst \ + gtk-murrine-engine \ + lxappearance \ + ly \ + materia-gtk-theme \ + ncurses \ + nitrogen \ + nsxiv \ + papirus-icon-theme \ + pcmanfm-gtk3 \ + picom \ + pidof \ + polybar \ + qt6ct \ + rofi \ + sxhkd \ + variety \ + xarchiver \ + xorg \ + yad + + # Could not find these: + #materia-kde \ + #network-manager-applet \ + #nm-connection-editor \ + fi - # enable and start systemd timer - #systemctl --user enable redrum.timer - #systemctl --user start redrum.timer + #if [[ -x "$(command -v pip3)" ]]; then + #pip3 install --user \ + #fi - # the service can be triggered manually as well - #systemctl --user start redrum - ;; - *) - echo "Skipping bspwm installation" - ;; + # copy service files + #mkdir -p ~/.config/systemd/user/ + #cp -u services/redrum.service ~/.config/systemd/user/ + #cp -u services/redrum.timer ~/.config/systemd/user/ + + # enable and start systemd timer + #systemctl --user enable redrum.timer + #systemctl --user start redrum.timer + + # the service can be triggered manually as well + #systemctl --user start redrum + ;; + *) + echo "Skipping bspwm installation" + ;; esac -read -r -p "Would you like to attempt an install of workstation utilities? [y/N] " response +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to attempt an install of workstation utilities? [y/N] " response +fi case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ -x "$(command -v dnf)" ]]; then sudo dnf install \ brave-browser \ + dex-autostart \ firefox \ flameshot \ google-noto-emoji-color-fonts \ @@ -786,8 +855,7 @@ case "$response" in p7zip \ qalculate-gtk \ qemu \ - rar \ - yt-dlp + rar brew install --cask \ brave-browser \ @@ -803,8 +871,26 @@ case "$response" in veracrypt \ vlc \ wireshark - elif [[ -x "$(command -v apt)" ]]; then - sudo apt install \ + elif [[ -x "$(command -v emerge)" ]]; then + # Possibly missing: brave-browser, touchegg + sudo emerge --noreplace \ + app-arch/p7zip \ + app-crypt/veracrypt \ + app-office/libreoffice \ + app-text/zathura \ + app-text/zathura-pdf-mupdf \ + media-fonts/noto-emoji \ + media-gfx/flameshot \ + media-gfx/inkscape \ + media-video/mpv \ + net-misc/nextcloud-client \ + sci-calculators/qalculate-gtk \ + sys-block/gparted \ + www-client/firefox \ + x11-misc/dex + elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install \ + dex \ flameshot \ fonts-noto-color-emoji \ gparted \ @@ -823,6 +909,7 @@ case "$response" in # TODO: Add ppa for Brave on Ubuntu elif [[ -x "$(command -v pacman)" ]]; then sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ + dex \ flameshot \ girara \ gnome-keyring \ @@ -840,12 +927,12 @@ case "$response" in zathura-pdf-mupdf \ --needed if [[ -x "$(command -v yay)" ]]; then - yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ - brave-bin \ - yt-dlp \ - --needed + yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ + brave-bin \ + --needed fi elif [[ -x "$(command -v pkg)" ]]; then + # FreeBSD does not have dex sudo pkg install \ flameshot \ girara \ @@ -859,7 +946,6 @@ case "$response" in touchegg \ unrar \ veracrypt \ - yt-dlp \ zathura \ zathura-pdf-mupdf fi @@ -885,7 +971,7 @@ case "$response" in read -r -p "You must manually download and install VeraCrypt. Would you like to go there now? [y/N] " response fi case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) xdg-open 'https://veracrypt.eu/en/Downloads.html' ;; *) @@ -894,15 +980,25 @@ case "$response" in esac fi + # Install yt-dlp, to nightly edition + if [[ ! -x "$(command -v yt-dlp)" ]]; then + curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp + chmod a+rx ~/.local/bin/yt-dlp + yt-dlp --update-to nightly + fi ;; *) echo "Skipping workstation utility installation" ;; esac -read -r -p "Would you like to setup Gnome? [y/N] " response +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to setup Gnome? [y/N] " response +fi case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) # Set fonts for Gnome. if [[ "$XDG_CURRENT_DESKTOP" == "GNOME" ]]; then gsettings set org.gnome.desktop.interface font-name 'FreeSans 11' @@ -927,6 +1023,25 @@ case "$response" in #launch-new-instance@gnome-shell-extensions.gcampax.github.com #places-menu@gnome-shell-extensions.gcampax.github.com #window-list@gnome-shell-extensions.gcampax.github.com + + # Clear the bookmarks file + printf "" > "${HOME}/.config/gtk-3.0/bookmarks" + + add_bookmark() { + path="${1}" + name="${2}" + + if [ -d "$path" ]; then + printf "file://%s %s\n" "$(realpath "$path")" "$name" >> "${HOME}/.config/gtk-3.0/bookmarks" + fi + } + + add_bookmark "${HOME}/src" "src" + add_bookmark "${HOME}/aura/sc" "aura-sc" + add_bookmark "${HOME}/aura/sc/fos-data-testsuite/archives" "Test Archives" + add_bookmark "${HOME}/Nextcloud" "Nextcloud" + + printf "nfs://maxocull.com/src/flamenco flamenco@maxocull.com\n" >> "${HOME}/.config/gtk-3.0/bookmarks" fi ;; *) @@ -934,9 +1049,13 @@ case "$response" in ;; esac -read -r -p "Would you like to attempt an install of Suckless Terminal (st)? [y/N] " response +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to attempt an install of Suckless Terminal (st)? [y/N] " response +fi case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ -x "$(command -v dnf)" ]]; then sudo dnf install \ fontconfig-devel \ @@ -948,14 +1067,14 @@ case "$response" in # TODO: The other package managers #elif [[ -x "$(command -v brew)" ]]; then - #brew install \ - #elif [[ -x "$(command -v apt)" ]]; then - #sudo apt install \ + #brew install \ + #elif [[ -x "$(command -v apt-get)" ]]; then + #sudo apt-get install \ #elif [[ -x "$(command -v pacman)" ]]; then - #sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ - #--needed + #sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ + #--needed #elif [[ -x "$(command -v pkg)" ]]; then - #sudo pkg install \ + #sudo pkg install \ #fi if [[ ! -d "${MISC_DIR}/../lukesmithxyz-st/" ]]; then @@ -970,38 +1089,41 @@ case "$response" in ;; esac - if [[ -x "$(command -v pacman)" ]]; then - read -r -p "Would you like to attempt an install of XMRig suite? [y/N] " response + if [ -n "${AUTOMATED}" ]; then + response='n' + else + read -r -p "Would you like to attempt an install of XMRig suite? [y/N] " response + fi case "$response" in - [yY][eE][sS]|[yY]) - if [[ -x "$(command -v dnf)" ]]; then - sudo dnf install -y \ - cmake \ - gcc \ - gcc-c++ \ - git \ - hwloc-devel \ - libstdc++-static \ - libuv-static \ - make \ - msr-tools \ - nyx \ - openssl-devel \ - tor - elif [[ -x "$(command -v pacman)" ]]; then - sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ - msr-tools \ - nyx \ - tor - - if [[ -x "$(command -v yay)" ]]; then - yay -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ - xmrig-donateless - fi - fi - -cat >> /etc/tor/torrc<< EOF + [yY][eE][sS] | [yY]) + if [[ -x "$(command -v dnf)" ]]; then + sudo dnf install -y \ + cmake \ + gcc \ + gcc-c++ \ + git \ + hwloc-devel \ + libstdc++-static \ + libuv-static \ + make \ + msr-tools \ + nyx \ + openssl-devel \ + tor + elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ + msr-tools \ + nyx \ + tor + + if [[ -x "$(command -v yay)" ]]; then + yay -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ + xmrig-donateless + fi + fi + + cat >> /etc/tor/torrc << EOF ControlPort 9051 CookieAuthentication 1 CookieAuthFile /var/lib/tor/control_auth_cookie @@ -1009,11 +1131,11 @@ CookieAuthFileGroupReadable 1 DataDirectoryGroupReadable 1 EOF - if [[ -x "$(command -v dnf)" ]]; then - sudo usermod -a -G toranon "$USER" - elif [[ -x "$(command -v pacman)" ]]; then - sudo usermod -a -G tor "$USER" - fi + if [[ -x "$(command -v dnf)" ]]; then + sudo usermod -a -G toranon "$USER" + elif [[ -x "$(command -v pacman)" ]]; then + sudo usermod -a -G tor "$USER" + fi echo "You will want to refresh your groups before running Nyx: newgrp tor" echo "To start Tor: sudo systemctl restart tor" ;; @@ -1025,13 +1147,13 @@ fi read -r -p "Would you like to setup Git? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ ! -s "${HOME}/.gitconfig" ]]; then { - printf "[user]\n\tname = Max O'Cull\n\temail = max.ocull@protonmail.com\n"; - printf "[alias]\n\tlogline = log --graph --pretty=format:'"; - echo -n '%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'; - printf "' --abbrev-commit\n"; + printf "[user]\n\tname = Max O'Cull\n\temail = max.ocull@protonmail.com\n" + printf "[alias]\n\tlogline = log --graph --pretty=format:'" + echo -n '%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' + printf "' --abbrev-commit\n" } > "${HOME}/.gitconfig" fi @@ -1054,14 +1176,16 @@ case "$response" in # git config --global user.signingkey 5E745B2A9C8F64736FA2CA73F8362D782F70AEAB # git config --global commit.gpgsign true - if [[ ! -s "${HOME}/.ssh/id_rsa.pub" ]]; then - ssh-keygen -t rsa -b 4096 -C "max.ocull@protonmail.com" - eval "$(ssh-agent -s)" - ssh-add "${HOME}/.ssh/id_rsa" - fi + if [ -z "${AUTOMATED}" ]; then + if [[ ! -s "${HOME}/.ssh/id_rsa.pub" ]]; then + ssh-keygen -t rsa -b 4096 -C "max.ocull@protonmail.com" + eval "$(ssh-agent -s)" + ssh-add "${HOME}/.ssh/id_rsa" + fi - xsel --clipboard -i < "${HOME}/.ssh/id_rsa.pub" && echo "Key copied to clipboard" - cat "${HOME}/.ssh/id_rsa.pub" + xsel --clipboard -i < "${HOME}/.ssh/id_rsa.pub" && echo "Key copied to clipboard" + cat "${HOME}/.ssh/id_rsa.pub" + fi ;; *) echo "Skipping Git setup" @@ -1070,7 +1194,7 @@ esac read -r -p "Would you like to setup Rust? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # For Neovim @@ -1083,15 +1207,16 @@ esac read -r -p "Would you like to setup Krew? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) ( - set -x; cd "$(mktemp -d)" && - OS="$(uname | tr '[:upper:]' '[:lower:]')" && - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && - KREW="krew-${OS}_${ARCH}" && - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && - tar zxvf "${KREW}.tar.gz" && - ./"${KREW}" install krew + set -x + cd "$(mktemp -d)" \ + && OS="$(uname | tr '[:upper:]' '[:lower:]')" \ + && ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" \ + && KREW="krew-${OS}_${ARCH}" \ + && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" \ + && tar zxvf "${KREW}.tar.gz" \ + && ./"${KREW}" install krew ) ;; *) @@ -1101,7 +1226,7 @@ esac read -r -p "Would you like to setup Protobuf libraries? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) ( version="27.2" file="protoc-${version}-linux-x86_64.zip" @@ -1117,16 +1242,39 @@ esac read -r -p "Would you like to setup Mikrotik's WinBox? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) - mkdir -p "${HOME}/.local/share/mikrotik/" - echo "Downloading ..." - curl -fsSL 'https://mt.lv/winbox64' -o "${HOME}/.local/share/mikrotik/winbox" - - # Make a script to execute it. - echo "#!/bin/sh" > "${HOME}/.local/bin/winbox" - echo "wine64 ${HOME}/.local/share/mikrotik/winbox" >> "${HOME}/.local/bin/winbox" - chmod +x "${HOME}/.local/bin/winbox" - echo "Succesfully installed, use \`winbox\` to open" + [yY][eE][sS] | [yY]) + mkdir -p "${HOME}/.local/share/mikrotik/" + echo "Downloading ..." + curl -fsSL 'https://mt.lv/winbox64' -o "${HOME}/.local/share/mikrotik/winbox" + + # Make a script to execute it. + echo "#!/bin/sh" > "${HOME}/.local/bin/winbox" + echo "wine64 ${HOME}/.local/share/mikrotik/winbox" >> "${HOME}/.local/bin/winbox" + chmod +x "${HOME}/.local/bin/winbox" + echo "Succesfully installed, use \`winbox\` to open" + ;; + *) + echo "Skipping WinBox setup" + ;; +esac + +read -r -p "Would you like to setup Activity Watch? [y/N] " response +case "$response" in + [yY][eE][sS] | [yY]) + mkdir -p "${HOME}/.local/opt/activitywatch/" + echo "Downloading ..." + curl -fSL 'https://github.com/ActivityWatch/activitywatch/releases/download/v0.13.2/activitywatch-v0.13.2-linux-x86_64.zip' -O "${HOME}/.local/opt/activitywatch/" + unzip "${HOME}/.local/opt/activitywatch/activitywatch-v0.13.2-linux-x86_64.zip" -d "${HOME}/.local/opt/activitywatch/" + + mkdir -p "${HOME}/.local/bin/" + ln -s "${HOME}/.local/opt/activitywatch/aw-qt" "${HOME}/.local/bin/aw-qt" + + # there are more smaller things to symlink here. + # https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=activitywatch-bin + + mkdir -p "${HOME}/.config/autostart/" + ln -s "${HOME}/.local/opt/activitywatch/aw-qt.desktop" "${HOME}/.local/share/applications/aw-qt.desktop" + ln -s "${HOME}/.local/opt/activitywatch/aw-qt.desktop" "${HOME}/.config/autostart/aw-qt.desktop" ;; *) echo "Skipping WinBox setup" @@ -1135,14 +1283,18 @@ esac read -r -p "Would you like to setup WiFi? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ -x "$(command -v dnf)" ]]; then sudo dnf install -y \ wpa_supplicant \ wireless-regdb - elif [[ -x "$(command -v apt)" ]]; then - sudo apt install -y \ - wpa_supplicant \ + elif [[ -x "$(command -v emerge)" ]]; then + sudo emerge --noreplace \ + net-wireless/wireless-regdb \ + net-wireless/wpa_supplicant + elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y \ + wpasupplicant \ wireless-regdb elif [[ -x "$(command -v pacman)" ]]; then sudo pacman -Syu "$AUTOMATED_PACMAN_FLAGS" \ @@ -1155,12 +1307,14 @@ case "$response" in wireless-regdb fi - if grep -q '^country=' /etc/wpa_supplicant/wpa_supplicant.conf; then + if sudo grep -q '^country=' /etc/wpa_supplicant/wpa_supplicant.conf; then sudo sed -i 's/^country=.*$/country=US/' /etc/wpa_supplicant/wpa_supplicant.conf else sudo echo "country=US" | sudo tee "/etc/wpa_supplicant/wpa_supplicant.conf" fi + # TODO: Not used on Debian? + sudo mkdir -p /etc/sysconfig/ sudo echo "country=US" | sudo tee "/etc/sysconfig/regdomain" sudo echo "REGDOMAIN=US" | sudo tee "/etc/default/crda" @@ -1169,6 +1323,7 @@ case "$response" in sudo mkdir -p /etc/conf.d/ sudo echo "WIRELESS_REGDOM=US" | sudo tee "/etc/conf.d/wireless-regdom" + sudo mkdir -p /etc/modprobe.d/ sudo echo "options cfg80211 ieee80211_regdom=US" | sudo tee "/etc/modprobe.d/regdom.conf" # TODO: is this right? @@ -1192,29 +1347,32 @@ case "$response" in ;; esac -read -r -p "Would you like to copy install configurations with root? [y/N] " response +read -r -p "Would you like to install /etc/ configurations with root? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) sudo rm -f "/etc/chrony.conf" - sudo cp -f "${MISC_DIR}/config/chrony.conf" "/etc/chrony.conf" + sudo cp -f "${MISC_DIR}/config/etc/chrony.conf" "/etc/chrony.conf" sudo rm -f "/etc/xdg/reflector/reflector.conf" - sudo cp -f "${MISC_DIR}/config/xdg/reflector/reflector.conf" "/etc/xdg/reflector/reflector.conf" + sudo mkdir -p "/etc/xdg/reflector/" + sudo cp -f "${MISC_DIR}/config/etc/xdg/reflector/reflector.conf" "/etc/xdg/reflector/reflector.conf" sudo rm -f "/etc/systemd/zram-generator.conf" - sudo cp -f "${MISC_DIR}/config/systemd/zram-generator.conf" "/etc/systemd/zram-generator.conf" + sudo mkdir -p "/etc/systemd/" + sudo cp -f "${MISC_DIR}/config/etc/systemd/zram-generator.conf" "/etc/systemd/zram-generator.conf" sudo rm -f "/etc/pacman.conf" - sudo cp -f "${MISC_DIR}/config/pacman.conf" "/etc/pacman.conf" + sudo cp -f "${MISC_DIR}/config/etc/pacman.conf" "/etc/pacman.conf" sudo mkdir -p "/etc/pacman.d/hooks/" sudo rm -f "/etc/pacman.d/hooks/nvidia.hook" - sudo cp -f "${MISC_DIR}/config/pacman.d/hooks/nvidia.hook" "/etc/pacman.d/hooks/nvidia.hook" + sudo cp -f "${MISC_DIR}/config/etc/pacman.d/hooks/nvidia.hook" "/etc/pacman.d/hooks/nvidia.hook" sudo rm -f "/etc/pacman.d/hooks/refind.hook" - sudo cp -f "${MISC_DIR}/config/pacman.d/hooks/refind.hook" "/etc/pacman.d/hooks/refind.hook" + sudo cp -f "${MISC_DIR}/config/etc/pacman.d/hooks/refind.hook" "/etc/pacman.d/hooks/refind.hook" sudo rm -f "/etc/dnf/dnf.conf" - sudo cp -f "${MISC_DIR}/config/dnf.conf" "/etc/dnf/dnf.conf" + sudo mkdir -p "/etc/dnf/" + sudo cp -f "${MISC_DIR}/config/etc/dnf/dnf.conf" "/etc/dnf/dnf.conf" # NOTE: Skipped mkinitcpio because it's system dependent... use Chezmoi! ;; @@ -1223,9 +1381,57 @@ case "$response" in ;; esac +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to remotely share the clipboard over SSH on this system? [y/N] " response +fi +case "$response" in + [yY][eE][sS] | [yY]) + # install xvfb, xauth, xsel for all systems + if [[ -x "$(command -v dnf)" ]]; then + sudo dnf install -y \ + xorg-x11-server-Xvfb \ + xorg-x11-xauth \ + xsel + elif [[ -x "$(command -v emerge)" ]]; then + # Possibly missing: xorg-x11-server-Xvfb + sudo emerge --noreplace \ + x11-apps/xauth \ + x11-misc/xsel \ + x11-misc/xvfb-run + elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y \ + xauth \ + xvfb \ + xsel + elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ + xorg-xauth \ + xorg-server-xvfb \ + xsel + elif [[ -x "$(command -v pkg)" ]]; then + sudo pkg install \ + xauth \ + xorg-vfbserver \ + xsel + fi + + # ensure that X11Forwarding yes is set in /etc/ssh/sshd_config + if sudo grep -q '^X11Forwarding no' /etc/ssh/sshd_config; then + sudo sed -i 's/^X11Forwarding no/X11Forwarding yes/' /etc/ssh/sshd_config + else + sudo echo "X11Forwarding yes" | sudo tee -a "/etc/ssh/sshd_config" + fi + ;; + *) + echo "Skipping remote clipboard setup" + ;; +esac + read -r -p "Would you like to setup system permissions? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ -x "$(command -v pw)" ]]; then sudo pw groupmod video -m "$USER" @@ -1254,14 +1460,18 @@ case "$response" in ;; esac -read -r -p "Would you like to install fonts? [y/N] " response +if [ -n "${AUTOMATED}" ]; then + response='n' +else + read -r -p "Would you like to install fonts? [y/N] " response +fi case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS] | [yY]) if [[ -x "$(command -v yay)" ]]; then - yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ - all-repository-fonts \ - ttf-ms-fonts \ - --needed + yay -Syu "$AUTOMATED_PACMAN_FLAGS" \ + all-repository-fonts \ + ttf-ms-fonts \ + --needed fi ./scripts/font-install.sh diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..26822f0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +##### MOCULL AUTOGENERATED ### DO NOT EDIT ##### +[tool.black] +line-length = 88 +include = '\.pyi?$' + +[tool.isort] +profile = "black" +filter_files = true +line_length = 88 + +[tool.mypy] +ignore_missing_imports = false +[[tool.mypy.overrides]] +module = [ + "mcastsocket", + "netifaces", + "grpc", +] +ignore_missing_imports = true +##### END MOCULL AUTOGENERATED ### DO NOT EDIT ##### diff --git a/scripts/check-dns.sh b/scripts/check-dns.sh new file mode 100755 index 0000000..a14024b --- /dev/null +++ b/scripts/check-dns.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +check_dns() { + domain=$1 + authority=$2 + nameserver=$3 + + printf "%s" "${authority}" + dig "$domain" "@${nameserver}" +tries=1 +} + +domain="www.maxocull.com" + +check_dns "$domain" "Namecheap Free DNS" "dns1.registrar-servers.com" +check_dns "$domain" "Namecheap Premium DNS" "pdns1.registrar-servers.com" +check_dns "$domain" "Google" "8.8.8.8" +check_dns "$domain" "Quad9" "9.9.9.9" +check_dns "$domain" "Cloudflare" "1.1.1.1" +check_dns "$domain" "DuckDNS" "ns1.duckdns.org" +check_dns "$domain" "Local DNS" "192.168.1.1" diff --git a/scripts/mikrotik/README.md b/scripts/mikrotik/README.md new file mode 100644 index 0000000..2d11b92 --- /dev/null +++ b/scripts/mikrotik/README.md @@ -0,0 +1,3 @@ +# Mikrotik + +- [Packet Flow Diagrams](https://help.mikrotik.com/docs/display/ROS/Packet+Flow+in+RouterOS) diff --git a/scripts/mikrotik/firewall.rsc b/scripts/mikrotik/firewall.rsc new file mode 100644 index 0000000..05e5534 --- /dev/null +++ b/scripts/mikrotik/firewall.rsc @@ -0,0 +1,159 @@ +################## +# RESET FIREWALL # +################## +/ip firewall filter remove [find] +/ip firewall nat remove [find] +/ip firewall mangle remove [find] +/ip firewall raw remove [find] + +########## +# FILTER # +########## +/ip/firewall/filter + +# TODO: Label ether1 as WAN. + +add chain=forward in-interface=ether1 connection-state=new connection-nat-state=dstnat action=accept comment="Accept new forwarding connections from WAN" +add chain=input in-interface=ether1 connection-state=new connection-nat-state=dstnat action=accept comment="Accept new input connections from WAN" +add chain=input in-interface=ether1 connection-state=established,related,untracked action=accept comment="Accept established, related, and untracked input connections from WAN" +add chain=input connection-state=invalid action=drop comment="Drop invalid input connections" + +add chain=input protocol=icmp in-interface=ether1 action=accept comment="Allow ICMP" +add chain=input protocol=tcp in-interface=ether1 any-port=8291 action=accept comment="Allow Winbox" +add chain=input protocol=udp dst-port=123 action=accept comment="Allow NTP" +add chain=input in-interface=ether1 action=drop comment="Drop all other input traffic" + +# TODO: Move this rule near top? +add chain=forward connection-state=established,related action=fasttrack-connection hw-offload=yes comment="Fasttrack established and related connections" + +add chain=forward connection-state=established,related action=accept comment="Accept established and related forwarding connections" +add chain=forward connection-state=invalid action=drop comment="Drop invalid forwarding connections" +add chain=forward in-interface=ether1 connection-state=new connection-nat-state=!dstnat action=drop comment="Drop new forwarding connections from WAN" + +# Guidelines +# - Skip IPv6 +# - Restrict TCP/UDP ports specifically (one or the other, not both) +# - Sort them +# - Create separate chains for each host? +# +# 22/tcp; SSH +# 80/tcp; HTTP +# 443/tcp; HTTPS +# 443/udp; HTTP/3 +# 1194/udp; OpenVPN +# 25565/tcp; Minecraft Server 1 +# 25566/tcp; Minecraft Server 2 +# 27015/tcp; Valve +# 27015/udp; Valve +# 51820/udp; WireGuard +# +# Private: +# 81/tcp; SWAG Dashboard +# 5432/tcp; PostgreSQL +# 5432/udp; PostgreSQL +# +# Unknown, TCP or UDP: +# 6881/tcp; BitTorrent +# 111/tcp; NFSv3 (private) +# 2049/tcp; NFSv3 (private) +# +# Unknown: +# 18080/tcp; Service 18080 +# 18081/tcp; Service 18081 +# 8443/tcp; HTTPS Alt +# 2049/tcp; NFS +# 32765/tcp; RPC +# 32767/tcp; RPC + +# Allow SSH (IPv4) +add chain=input protocol=tcp dst-port=22 action=accept comment="Allow SSH" + +# Allow mDNS (IPv4) +add chain=input protocol=udp dst-address=224.0.0.251 dst-port=5353 action=accept comment="Allow mDNS" + +# Limit SSH (IPv4) +add chain=input protocol=tcp dst-port=22 connection-state=new action=jump jump-target=limit-ssh +add chain=limit-ssh connection-state=new action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=1d +add chain=limit-ssh connection-state=new src-address-list=ssh_blacklist action=drop + +# Allow specific ports (IPv4) +add chain=input protocol=tcp dst-port=25 action=accept comment="Allow SMTP" +add chain=input protocol=udp dst-port=53 action=accept comment="Allow DNS" +add chain=input protocol=udp dst-port=67 action=accept comment="Allow DHCP" +add chain=input protocol=tcp dst-port=80 action=accept comment="Allow HTTP" +add chain=input protocol=tcp dst-port=443 action=accept comment="Allow HTTPS" +add chain=input protocol=udp dst-port=1194 action=accept comment="Allow OpenVPN" +add chain=input protocol=tcp dst-port=6881 action=accept comment="Allow BitTorrent" +add chain=input protocol=tcp dst-port=25565 action=accept comment="Allow Minecraft Server 1" +add chain=input protocol=tcp dst-port=25566 action=accept comment="Allow Minecraft Server 2" +add chain=input protocol=tcp dst-port=27015 action=accept comment="Allow Game Server" +add chain=input protocol=udp dst-port=51820 action=accept comment="Allow WireGuard" +add chain=input protocol=tcp dst-port=18080 action=accept comment="Allow Service 18080" +add chain=input protocol=tcp dst-port=18081 action=accept comment="Allow Service 18081" +add chain=input protocol=tcp dst-port=8443 action=accept comment="Allow HTTPS Alt" +add chain=input protocol=tcp dst-port=5432 action=accept comment="Allow PostgreSQL" +add chain=input protocol=tcp dst-port=2049 action=accept comment="Allow NFS" +add chain=input protocol=tcp dst-port=111 action=accept comment="Allow Portmapper" +add chain=input protocol=tcp dst-port=32765 action=accept comment="Allow RPC" +add chain=input protocol=tcp dst-port=32767 action=accept comment="Allow RPC" +add chain=input protocol=tcp dst-port=81 action=accept comment="Allow HTTP Alt" + +# Allow specific ports (IPv6) +add chain=input protocol=tcp dst-port=22 action=accept comment="Allow SSH (v6)" +add chain=input protocol=udp dst-address=ff02::fb dst-port=5353 action=accept comment="Allow mDNS (v6)" +add chain=input protocol=tcp dst-port=25 action=accept comment="Allow SMTP (v6)" +add chain=input=protocol=udp dst-port=53 action=accept comment="Allow DNS (v6)" +add chain=input protocol=udp dst-port=67 action=accept comment="Allow DHCP (v6)" +add chain=input protocol=tcp dst-port=80 action=accept comment="Allow HTTP (v6)" +add chain=input protocol=tcp dst-port=443 action=accept comment="Allow HTTPS (v6)" +add chain=input protocol=udp dst-port=1194 action=accept comment="Allow OpenVPN (v6)" +add chain=input protocol=tcp dst-port=6881 action=accept comment="Allow BitTorrent (v6)" +add chain=input protocol=tcp dst-port=25565 action=accept comment="Allow Minecraft Server 1 (v6)" +add chain=input protocol=tcp dst-port=25566 action=accept comment="Allow Minecraft Server 2 (v6)" +add chain=input protocol=tcp dst-port=27015 action=accept comment="Allow Game Server (v6)" +add chain=input protocol=udp dst-port=51820 action=accept comment="Allow WireGuard (v6)" +add chain=input protocol=tcp dst-port=18080 action=accept comment="Allow Service 18080 (v6)" +add chain=input protocol=tcp dst-port=18081 action=accept comment="Allow Service 18081 (v6)" +add chain=input protocol=tcp dst-port=8443 action=accept comment="Allow HTTPS Alt (v6)" +add chain=input protocol=tcp dst-port=5432 action=accept comment="Allow PostgreSQL (v6)" +add chain=input protocol=tcp dst-port=2049 action=accept comment="Allow NFS (v6)" +add chain=input protocol=tcp dst-port=111 action=accept comment="Allow Portmapper (v6)" +add chain=input protocol=tcp dst-port=32765 action=accept comment="Allow RPC (v6)" +add chain=input protocol=tcp dst-port=32767 action=accept comment="Allow RPC (v6)" +add chain=input protocol=tcp dst-port=81 action=accept comment="Allow HTTP Alt (v6)" + +# Drop everything else +add chain=input action=drop comment="Drop all other traffic" + +# TODO: What traffic might I want to log? + +##################################### +# NETWORK ADDRESS TRANSLATION (NAT) # +##################################### +/ip/firewall/nat + +# TODO: These should probably be input rules way sooner. +add chain=dstnat protocol=udp dst-port=123 action=accept comment="Allow NTP" +add chain=dstnat protocol=tcp dst-port=4460 action=accept comment="Allow NTS" + +# TODO: Shouldn't this be using +add chain=srcnat src-address-list=list_wireguard out-interface=ether1 action=masquerade comment="Masquerade WireGuard traffic" + +# TODO: This seems wrong... +add chain=srcnat out-interface=ether1 action=masquerade comment="Masquerade all other traffic" + +# TODO: point this to Alan's local port 22? +# to-ports=22 +add chain=dstnat protocol=tcp dst-port=2212 in-interface=ether1 action=dst-nat to-addresses=192.168.1.12 comment="Redirect 2212 to git.alanocull.com for SSH" + +# TODO: Get rid of these port ignores... +add chain=dstnat protocol=udp dst-port=!123,13221-13230 in-interface=ether1 action=dst-nat to-addresses=192.168.1.10 comment="Redirect all other UDP traffic to default device (maxocull.com)" +add chain=dstnat protocol=tcp dst-port=!4460 in-interface=ether1 action=dst-nat to-addresses=192.168.1.10 comment="Redirect all other TCP traffic to default device (maxocull.com)" + +########## +# MANGLE # +########## + +####### +# RAW # +####### diff --git a/scripts/mikrotik/hello.rsc b/scripts/mikrotik/hello.rsc new file mode 100644 index 0000000..41fca6b --- /dev/null +++ b/scripts/mikrotik/hello.rsc @@ -0,0 +1 @@ +:put "hello, world" diff --git a/scripts/mikrotik/test-firewall-external.sh b/scripts/mikrotik/test-firewall-external.sh new file mode 100755 index 0000000..914cd9d --- /dev/null +++ b/scripts/mikrotik/test-firewall-external.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ "$(id -u)" -ne 0 ]; then + exec sudo "$0" "$@" +fi + +info() { + message=$1 + + printf "%s\n" "${message}" +} + +info "Does a deep DNS entry resolve?" +dig www.maxocull.com @9.9.9.9 +tries=1 + +info "Can we ping it?" +ping -c1 www.maxocull.com + +info "Does it supply DNS?" +dig www.maxocull.com @maxocull.com + +info "These TCP services should be OPEN:" +nmap -sS -p 22,80,443 maxocull.com --dns-servers 9.9.9.9 + +info "These UDP services should be OPEN:" +nmap -sU -p 443,1194,51820 maxocull.com --dns-servers 9.9.9.9 + +info "These TCP services should be CLOSED:" +nmap -sS -p 81,5432 maxocull.com --dns-servers 9.9.9.9 +nmap -sU -p 5432 maxocull.com --dns-servers 9.9.9.9 + +info "Is it serving my webpage?" +curl -L 'https://maxocull.com' | grep '' | head -n1 + +info "Does SSH on 22/tcp reach Entourage?" +ssh entourage "hostname" + +info "Does SSH on 2212/tcp reach git.alanocull.com?" +ssh git.alanocull.com "hostname" + +info "Does the router supply NTP?" +chronyc ntpdata -s maxocull.com + +# TODO: Does the router supply NTS? +# ... diff --git a/scripts/mikrotik/test-firewall-internal.sh b/scripts/mikrotik/test-firewall-internal.sh new file mode 100755 index 0000000..e949fea --- /dev/null +++ b/scripts/mikrotik/test-firewall-internal.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +if [ "$(id -u)" -ne 0 ]; then + exec sudo "$0" "$@" +fi + +info() { + message=$1 + + printf "%s\n" "${message}" +} + +info "Does a deep DNS entry resolve?" +dig www.maxocull.com @192.168.1.1 +tries=1 + +info "Can we ping it?" +ping -c1 www.maxocull.com + +info "Does the router supply DNS?" +dig dns.quad9.net @192.168.1.1 + +info "Do local DNS entries resolve?" +dig leviathan @192.168.1.1 + +info "These Mikrotik TCP services should be OPEN:" +nmap -sS -p 22,80 192.168.1.1 + +info "These Entourage TCP services should be OPEN:" +nmap -sS -p 22,80,443 192.168.1.10 + +info "Is it serving my webpage?" +curl -L 'https://maxocull.com' | grep '<title>' | head -n1 + +info "Does SSH on 22/tcp reach Entourage?" +ssh entourage "hostname" + +info "Does SSH on 2212/tcp reach git.alanocull.com?" +ssh git.alanocull.com "hostname" + +info "Does the router supply NTP?" +chronyc ntpdata 192.168.1.1 + +# TODO: Does the router supply NTS? +# ... diff --git a/scripts/vfio.sh b/scripts/vfio.sh old mode 100644 new mode 100755 diff --git a/templates/Cargo.clippy.toml b/templates/Cargo.clippy.toml new file mode 100644 index 0000000..55741bb --- /dev/null +++ b/templates/Cargo.clippy.toml @@ -0,0 +1,9 @@ +[lints.rust] +missing_docs = "warn" + +[lints.clippy] +# https://rust-lang.github.io/rust-clippy/master/index.html#/ +unwrap_used = "deny" +inefficient_to_string = "warn" +use_self = "warn" +implicit_clone = "warn" diff --git a/templates/editorconfig b/templates/editorconfig new file mode 100644 index 0000000..c179d93 --- /dev/null +++ b/templates/editorconfig @@ -0,0 +1,11 @@ +# Using [[shell]] rather than [*.sh] will capture files with no extension +[[shell]] +# Used by shfmt +indent_style = space +indent_size = 4 +;shell_variant = posix +binary_next_line = true +switch_case_indent = true +space_redirects = true +;keep_padding = true +simplify = true diff --git a/templates/flake8 b/templates/flake8 new file mode 100644 index 0000000..e19c0a5 --- /dev/null +++ b/templates/flake8 @@ -0,0 +1,3 @@ +[flake8] +extend-ignore = E203 +max-line-length = 88 diff --git a/templates/gitattributes b/templates/gitattributes new file mode 100644 index 0000000..18faea7 --- /dev/null +++ b/templates/gitattributes @@ -0,0 +1,77 @@ +# Images +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.gif filter=lfs diff=lfs merge=lfs -text +*.bmp filter=lfs diff=lfs merge=lfs -text +*.tiff filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text + +# Audio +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.m4a filter=lfs diff=lfs merge=lfs -text +*.flac filter=lfs diff=lfs merge=lfs -text + +# Video +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.mov filter=lfs diff=lfs merge=lfs -text +*.avi filter=lfs diff=lfs merge=lfs -text +*.flv filter=lfs diff=lfs merge=lfs -text +*.wmv filter=lfs diff=lfs merge=lfs -text +*.mpeg filter=lfs diff=lfs merge=lfs -text +*.mkv filter=lfs diff=lfs merge=lfs -text + +# Archives +*.zip filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text + +# Large data +*.csv filter=lfs diff=lfs merge=lfs -text +*.xml filter=lfs diff=lfs merge=lfs -text + +# Disabled because these are often used for settings: +# *.json filter=lfs diff=lfs merge=lfs -text + +# Executables and libraries +*.exe filter=lfs diff=lfs merge=lfs -text +*.dll filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text + +# Fonts +*.ttf filter=lfs diff=lfs merge=lfs -text +*.otf filter=lfs diff=lfs merge=lfs -text + +# 3D Models +*.obj filter=lfs diff=lfs merge=lfs -text +*.fbx filter=lfs diff=lfs merge=lfs -text +*.stl filter=lfs diff=lfs merge=lfs -text + +# Design files +*.psd filter=lfs diff=lfs merge=lfs -text +*.ai filter=lfs diff=lfs merge=lfs -text + +# Documents +*.pdf filter=lfs diff=lfs merge=lfs -text + +# Packet Captures +*.pcap filter=lfs diff=lfs merge=lfs -text +*.pcapng filter=lfs diff=lfs merge=lfs -text +*.cap filter=lfs diff=lfs merge=lfs -text +*.dmp filter=lfs diff=lfs merge=lfs -text +*.5vw filter=lfs diff=lfs merge=lfs -text +*.pkt filter=lfs diff=lfs merge=lfs -text +*.net filter=lfs diff=lfs merge=lfs -text + +# Various Binaries +*.bin filter=lfs diff=lfs merge=lfs -text +*.dat filter=lfs diff=lfs merge=lfs -text +*.bit filter=lfs diff=lfs merge=lfs -text +*.sqlite filter=lfs diff=lfs merge=lfs -text +*.db filter=lfs diff=lfs merge=lfs -text diff --git a/templates/gitignore b/templates/gitignore new file mode 100644 index 0000000..185a54b --- /dev/null +++ b/templates/gitignore @@ -0,0 +1,169 @@ +# NOTE: You cannot add comments to the *end* of a line, only the beginning! +# https://git-scm.com/docs/gitignore + +# Build directories +/bin/ +/obj/ +/out/ +/build/ +/target/ + +# Rust / Cargo +## These are backup files generated by rustfmt +**/*.rs.bk + +## MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE specific files +/.idea/ +/.vscode/ +*.swp +*.swo +*~ +*.sublime-workspace + +# Compiled source +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Logs and databases +*.log +*.sql +*.sqlite +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +/node_modules/ +/jspm_packages/ +/bower_components/ + +## Grunt intermediate storage +.grunt + +# Python +*.py[cod] +__pycache__/ +*.pyc + +# Virtual environments +venv/ +## NOTE: Sometimes this is a file (not a directory) that acts as a pointer. +.venv + +# Runtime data +pids +*.pid +*.seed +.cache/ +.pytest_cache/ + +## mypy +.mypy_cache/ + +## poetry +poetry.lock + +## Jupyter Notebook +.ipynb_checkpoints + +## pyenv +.python-version + +## pipenv +Pipfile.lock + +# Coverage +## Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +## Coverage directory used by tools like istanbul +coverage + +## nyc test coverage +.nyc_output + +# NodeJS +## node-waf configuration +.lock-wscript + +## Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +## TypeScript v1 declaration files +typings/ + +## Optional npm cache directory +.npm + +## Optional eslint cache +.eslintcache + +## TernJS port file +.tern-port + +## parcel-bundler cache (https://parceljs.org/) +.cache + +## Yarn Integrity file +.yarn-integrity + +## next.js build output +.next + +## nuxt.js build output +.nuxt + +## vuepress build output +.vuepress/dist + +## Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Terraform +*.tfstate +*.tfstate.* + +## Local .terraform directories +**/.terraform/* + +## Ignore any .tfvars files that are generated automatically for each Terraform run. Most +## .tfvars files are managed as part of configuration and so should be included in +## version control. +## +## example.tfvars + +## Ignore override files as they are usually used to override resources locally and so +## are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json +## Include override files you do wish to add to version control using negated pattern +## +## !example_override.tf + +## Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +## example: *tfplan* diff --git a/templates/pre-commit-config.general.yaml b/templates/pre-commit-config.general.yaml new file mode 100644 index 0000000..3e23fb3 --- /dev/null +++ b/templates/pre-commit-config.general.yaml @@ -0,0 +1,49 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-json + - id: pretty-format-json + args: [--autofix] + - id: check-yaml + - id: check-toml + - id: trailing-whitespace + - id: mixed-line-ending + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-added-large-files + - id: check-case-conflict + - id: destroyed-symlinks + - id: detect-private-key + - id: forbid-submodules + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + + - repo: https://github.com/pecigonzalo/pre-commit-shfmt + rev: v2.2.0 + hooks: + - id: shell-fmt-docker + args: + - -w + + - repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.9.0 + hooks: + - id: shellcheck + + - repo: https://github.com/ansible/ansible-lint + # put latest release tag from + # https://github.com/ansible-community/ansible-lint/releases/ + rev: v24.6.1 + hooks: + - id: ansible-lint + files: \.(yaml|yml)$ + args: [--fix, --format, pep8] + additional_dependencies: + - jmespath diff --git a/templates/pre-commit-config.helm.yaml b/templates/pre-commit-config.helm.yaml new file mode 100644 index 0000000..fa6df86 --- /dev/null +++ b/templates/pre-commit-config.helm.yaml @@ -0,0 +1,44 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-json + - id: pretty-format-json + args: [--autofix] + # Does not work with templated YAML: + # - id: check-yaml + - id: check-toml + - id: trailing-whitespace + - id: mixed-line-ending + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-added-large-files + - id: check-case-conflict + - id: destroyed-symlinks + - id: detect-private-key + - id: forbid-submodules + + - repo: https://github.com/gruntwork-io/pre-commit + rev: v0.1.23 + hooks: + - id: helmlint + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + + - repo: https://github.com/pecigonzalo/pre-commit-shfmt + rev: v2.2.0 + hooks: + - id: shell-fmt-docker + args: + - -w + + - repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.9.0 + hooks: + - id: shellcheck diff --git a/templates/pre-commit-config.python.yaml b/templates/pre-commit-config.python.yaml new file mode 100644 index 0000000..25b2950 --- /dev/null +++ b/templates/pre-commit-config.python.yaml @@ -0,0 +1,104 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-json + - id: pretty-format-json + args: [--autofix] + - id: check-yaml + - id: check-toml + - id: trailing-whitespace + - id: mixed-line-ending + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-added-large-files + - id: check-case-conflict + - id: destroyed-symlinks + - id: detect-private-key + - id: forbid-submodules + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + + - repo: https://github.com/pecigonzalo/pre-commit-shfmt + rev: v2.2.0 + hooks: + - id: shell-fmt-docker + args: + - -w + + - repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.9.0 + hooks: + - id: shellcheck + + - repo: https://github.com/ansible/ansible-lint + # put latest release tag from + # https://github.com/ansible-community/ansible-lint/releases/ + rev: v24.6.1 + hooks: + - id: ansible-lint + files: \.(yaml|yml)$ + args: [--fix, --format, pep8] + additional_dependencies: + - jmespath + + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + # See + # https://pycqa.github.io/isort/docs/configuration/black_compatibility.html + args: [--profile, black, --filter-files] + + # This mirror is about 2x faster because it is compiled with mypyc. + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.12.1 + hooks: + - id: black + args: [--line-length=88] + language_version: python3.12 + + # To ignore these, use `# noqa: E123` at the end of the line. + - repo: https://github.com/PyCQA/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + # See https://github.com/PyCQA/pycodestyle/issues/373 + # + # We are ignoring E501 because black already takes care of line length, + # and Flake8 is trigger happy. + args: + - --max-line-length=88 + - --extend-ignore=E203 + - --extend-ignore=E501 + + # To ignore these, use `# nosec` at the end of the line. + - repo: https://github.com/PyCQA/bandit + rev: 1.7.6 + hooks: + - id: bandit + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-check-blanket-noqa + - id: python-check-mock-methods + - id: python-no-eval + - id: python-no-log-warn + - id: python-check-blanket-type-ignore + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.8.0 + hooks: + - id: mypy + additional_dependencies: + - types-requests + - types-setuptools + - types-paramiko + - types-toml diff --git a/templates/pre-commit-config.rust.yaml b/templates/pre-commit-config.rust.yaml new file mode 100644 index 0000000..1093b54 --- /dev/null +++ b/templates/pre-commit-config.rust.yaml @@ -0,0 +1,82 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-json + - id: pretty-format-json + args: [--autofix] + - id: check-yaml + - id: check-toml + - id: trailing-whitespace + - id: mixed-line-ending + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-added-large-files + - id: check-case-conflict + - id: destroyed-symlinks + - id: detect-private-key + - id: forbid-submodules + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + + - repo: https://github.com/pecigonzalo/pre-commit-shfmt + rev: v2.2.0 + hooks: + - id: shell-fmt-docker + args: + - -w + + - repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.9.0 + hooks: + - id: shellcheck + + - repo: local + hooks: + - id: cargo-fmt + name: format rust + entry: cargo fmt + language: system + pass_filenames: false + types: [rust] + + # Updating accomplishes a few things: + # - verifies dependencies are actually up to date (branch specifiers are + # lazily evaluated) + # - verifies dependencies are actually used (unused dependencies or + # versions are removed) + # - verifies dependencies are pinned within reason (no loose version + # specifiers) + # - verifies dependencies are actually compatible (no sudden version + # conflicts from loose version specifiers) + # - refreshes Cargo.lock + - id: cargo-update + name: update crates + entry: cargo update + language: system + pass_filenames: false + types: [toml] + + - id: cargo-test + name: test crate + entry: cargo test + language: system + pass_filenames: false + # NOTE: `types` key is an AND operation, `types_or` key is an OR + # operation + # https://pre-commit.com/#filtering-files-with-types + types_or: [rust, toml] + + - id: cargo-clippy + name: check crate + entry: cargo clippy + args: [--fix, --allow-staged, --, -D, warnings] + language: system + pass_filenames: false + types_or: [rust, toml] diff --git a/templates/pyproject.toml b/templates/pyproject.toml new file mode 100644 index 0000000..f852cf6 --- /dev/null +++ b/templates/pyproject.toml @@ -0,0 +1,18 @@ +[tool.black] +line-length = 88 +include = '\.pyi?$' + +[tool.isort] +profile = "black" +filter_files = true +line_length = 88 + +[tool.mypy] +ignore_missing_imports = false +[[tool.mypy.overrides]] +module = [ + "mcastsocket", + "netifaces", + "grpc", +] +ignore_missing_imports = true diff --git a/templates/yamllint.yml b/templates/yamllint.yml new file mode 100644 index 0000000..032dca8 --- /dev/null +++ b/templates/yamllint.yml @@ -0,0 +1,16 @@ +--- +extends: default + +rules: + # This should be 80, but it got WAY too annoying to deal with. + line-length: disable + + # These rules are required by ansible-lint: + comments: + min-spaces-from-content: 1 + comments-indentation: false + braces: + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true