From 2572c49acb044bf4d0fdb452cec5e09230f24674 Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Sun, 13 Jul 2025 03:21:08 -0500 Subject: [PATCH 1/5] Build gcloud-slim --- .docker/gcloud-slim | 29 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 4 ++-- .org | 15 ++++++++++----- 4 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 .docker/gcloud-slim create mode 100644 .github/workflows/ci.yml diff --git a/.docker/gcloud-slim b/.docker/gcloud-slim new file mode 100644 index 0000000..4cf79bf --- /dev/null +++ b/.docker/gcloud-slim @@ -0,0 +1,29 @@ +FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim +ENV DEBIAN_FRONTEND=noninteractive +ARG KUBECTL_VERSION="v1.33.1" +ARG SOPS_VERSION="v3.8.1" +ARG SUPABASE_VERSION="2.26.8" +ARG USERNAME=jgmize +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential ca-certificates curl emacs-nox git gpg gpg-agent htop jq \ + libsqlite3-0 microsocks openssh-server pandoc postgresql-client python3-epc \ + python3-importmagic ripgrep software-properties-common sudo tmate tmux tree \ + tzdata unzip && apt-get clean -y \ + && rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN curl -LO https://github.com/supabase/cli/releases/download/v${SUPABASE_VERSION}/supabase_${SUPABASE_VERSION}_linux_amd64.deb && \ + dpkg -i supabase_${SUPABASE_VERSION}_linux_amd64.deb +RUN curl -L "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ + -o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl && \ + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ + chmod +x get_helm.sh && ./get_helm.sh +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && ./aws/install && rm -rf awscliv2.zip aws +RUN curl -L "https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64" \ + -o /usr/local/bin/sops && chmod +x /usr/local/bin/sops +RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 \ + -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq +RUN useradd -m -s /usr/bin/bash -G sudo ${USERNAME} +WORKDIR /home/${USERNAME} +USER ${USERNAME} +COPY . ./dotfiles +RUN dotfiles/install \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7c8818d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI +on: + push: + branches: + - main + - dev + - gcloud-slim +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} +permissions: + contents: read + packages: write + attestations: write + id-token: write +jobs: + build-push: + name: build-push + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-buildx-action@v3 + - id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: .docker/gcloud-slim + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1de3145..80d7a43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,9 +6,9 @@ stages: kaniko build: extends: .kaniko build variables: - name: llamastack-local-gpu + name: gcloud-slim dockerfile: .docker/${name} image: ${CI_REGISTRY_IMAGE}/${name} only: refs: - - dockerfiles + - gcloud-slim diff --git a/.org b/.org index cfacffd..4c56fa6 100644 --- a/.org +++ b/.org @@ -15,10 +15,15 @@ - https://gitlab.com/search?search=dotfiles - https://gitlab.com/gitlab-com/support/toolbox/dotfiles -** Merge Requests +** Merge & Pull Requests - [[https://gitlab.com/jgmize/dotfiles/-/merge_requests?scope=all&state=all][Gitlab merge requests]] - - [X] [[https://gitlab.com/jgmize/dotfiles/-/merge_requests/1][!1]]: Build bullseye - - [X] [[https://gitlab.com/jgmize/dotfiles/-/merge_requests/2][!2]]: Main rebase - - [X] [[https://gitlab.com/jgmize/dotfiles/-/merge_requests/3][!3]]: add svpn - - [ ] !4: Update [[./.gitpod.yml][.gitpod.yml]] to match journal +- [[https://github.com/jgmize/dotfiles/pulls?q=][Github pull requests]] + +** TODO + +- [-] add cloud CLIs + - [X] aws + - [X] az + - [ ] gcloud +- [ ] add ys From ab3c1f1d0521438c56eb0b3be42d7cc9b3d9b065 Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Sun, 9 Nov 2025 18:19:26 -0600 Subject: [PATCH 2/5] Build gcloud-slim --- .docker/gcloud-slim | 18 +++++----- .gitconfig | 2 +- .gitignore | 1 + .hammerspoon/init.lua | 22 ++++++------ .org | 17 ++++++++-- .spacemacs | 78 ++++++++++++++++++++++--------------------- 6 files changed, 78 insertions(+), 60 deletions(-) diff --git a/.docker/gcloud-slim b/.docker/gcloud-slim index 4cf79bf..4d40787 100644 --- a/.docker/gcloud-slim +++ b/.docker/gcloud-slim @@ -1,29 +1,29 @@ FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim ENV DEBIAN_FRONTEND=noninteractive -ARG KUBECTL_VERSION="v1.33.1" ARG SOPS_VERSION="v3.8.1" ARG SUPABASE_VERSION="2.26.8" ARG USERNAME=jgmize -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ + apt-get install -y --no-install-recommends \ build-essential ca-certificates curl emacs-nox git gpg gpg-agent htop jq \ libsqlite3-0 microsocks openssh-server pandoc postgresql-client python3-epc \ python3-importmagic ripgrep software-properties-common sudo tmate tmux tree \ - tzdata unzip && apt-get clean -y \ - && rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /tmp/* /var/tmp/* + tzdata unzip && apt-get clean -y && \ + rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN curl -LO https://github.com/supabase/cli/releases/download/v${SUPABASE_VERSION}/supabase_${SUPABASE_VERSION}_linux_amd64.deb && \ dpkg -i supabase_${SUPABASE_VERSION}_linux_amd64.deb -RUN curl -L "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ - -o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl && \ - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ - chmod +x get_helm.sh && ./get_helm.sh +RUN gcloud components install kubectl --quiet +RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ + chmod +x get_helm.sh && ./get_helm.sh && \ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ unzip awscliv2.zip && ./aws/install && rm -rf awscliv2.zip aws RUN curl -L "https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64" \ -o /usr/local/bin/sops && chmod +x /usr/local/bin/sops RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 \ -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq +RUN curl -s http://yamlscript.org/install | BIN=1 bash RUN useradd -m -s /usr/bin/bash -G sudo ${USERNAME} WORKDIR /home/${USERNAME} USER ${USERNAME} COPY . ./dotfiles -RUN dotfiles/install \ No newline at end of file +RUN dotfiles/install diff --git a/.gitconfig b/.gitconfig index 402b201..8387d70 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,6 @@ [user] name = Josh Mize - email = jgmize@imuto.ai + email = jgmize@gmail.com [alias] st = status -sb diff --git a/.gitignore b/.gitignore index 40bf2e2..bf94c0c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .win/.vscode/plugins .aws/config .aws/creds +.aider* diff --git a/.hammerspoon/init.lua b/.hammerspoon/init.lua index abe1202..439892d 100644 --- a/.hammerspoon/init.lua +++ b/.hammerspoon/init.lua @@ -3,31 +3,33 @@ hs.window.animationDuration = 0 units = { right30 = { x = 0.70, y = 0.00, w = 0.30, h = 1.00 }, + right26 = { x = 0.74, y = 0.00, w = 0.26, h = 1.00 }, right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 }, right70 = { x = 0.30, y = 0.00, w = 0.70, h = 1.00 }, left70 = { x = 0.00, y = 0.00, w = 0.70, h = 1.00 }, + left74 = { x = 0.00, y = 0.00, w = 0.74, h = 1.00 }, left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 }, left30 = { x = 0.00, y = 0.00, w = 0.30, h = 1.00 }, top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 }, bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 }, - upright30 = { x = 0.70, y = 0.00, w = 0.30, h = 0.50 }, - botright30 = { x = 0.70, y = 0.50, w = 0.30, h = 0.50 }, - upleft70 = { x = 0.00, y = 0.00, w = 0.70, h = 0.50 }, - botleft70 = { x = 0.00, y = 0.50, w = 0.70, h = 0.50 }, + upright26 = { x = 0.74, y = 0.00, w = 0.26, h = 0.50 }, + botright26 = { x = 0.74, y = 0.50, w = 0.26, h = 0.50 }, + upleft74 = { x = 0.00, y = 0.00, w = 0.74, h = 0.50 }, + botleft74 = { x = 0.00, y = 0.50, w = 0.74, h = 0.50 }, maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 } } mash = { 'ctrl', 'option', 'cmd' } --- hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right30, nil, true) end) --- hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left70, nil, true) end) +hs.hotkey.bind(mash, 'u', function() hs.window.focusedWindow():move(units.left74, nil, true) end) +hs.hotkey.bind(mash, 'i', function() hs.window.focusedWindow():move(units.right26, nil, true) end) hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end) hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end) hs.hotkey.bind(mash, 'k', function() hs.window.focusedWindow():move(units.top50, nil, true) end) hs.hotkey.bind(mash, 'j', function() hs.window.focusedWindow():move(units.bot50, nil, true) end) -hs.hotkey.bind(mash, ']', function() hs.window.focusedWindow():move(units.upright30, nil, true) end) -hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft70, nil, true) end) -hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft70, nil, true) end) -hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright30, nil, true) end) +hs.hotkey.bind(mash, ']', function() hs.window.focusedWindow():move(units.upright26, nil, true) end) +hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft74, nil, true) end) +hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft74, nil, true) end) +hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright26, nil, true) end) hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end) -- https://stackoverflow.com/a/58662204 diff --git a/.org b/.org index 4c56fa6..fa59921 100644 --- a/.org +++ b/.org @@ -22,8 +22,21 @@ ** TODO -- [-] add cloud CLIs +- [X] add cloud CLIs - [X] aws - [X] az - - [ ] gcloud + - [X] gcloud + - [[https://github.com/jgmize/dotfiles/pkgs/container/dotfiles][Package dotfiles]] + #+begin_src sh + docker pull ghcr.io/jgmize/dotfiles:gcloud-slim + #+end_src - [ ] add ys + - [[https://yamlscript.org/doc/install/][Installing YS - YS — YAML Done Wisely]] +- [ ] add sts +#+begin_src yaml + image: ghcr.io/jgmize/dotfiles:gcloud-slim + command: + - sleep + - infinity + volumeMounts: TODO +#+end_src diff --git a/.spacemacs b/.spacemacs index b815849..7a1f72a 100644 --- a/.spacemacs +++ b/.spacemacs @@ -33,7 +33,8 @@ This function should only modify configuration layer settings." ;; List of configuration layers to load. dotspacemacs-configuration-layers - '(react + '(php + react graphviz ansible better-defaults @@ -43,6 +44,7 @@ This function should only modify configuration layer settings." django docker emacs-lisp + epub ess evernote git @@ -60,22 +62,22 @@ This function should only modify configuration layer settings." markdown-fontify-code-blocks-natively t) multiple-cursors nginx - ; ocaml ; brew install opam && opam init + ; ocaml ; brew install opam && opam init (org :variables - org-adapt-indentation nil - org-confirm-babel-evaluate nil - org-enable-github-support t - org-export-with-drawers t - org-export-with-section-numbers nil - org-export-with-sub-superscripts nil - org-export-babel-evaluate nil - org-export-backends (quote (ascii beamer html icalendar latex md odt rst)) - org-hide-emphasis-markers t - org-src-fontify-natively t - ;; Use current window when switch to source block - org-src-window-setup 'current-window - ;; Disable prompting to evaluate babel blocks - org-superstar-leading-fallback ?\s) + org-adapt-indentation nil + org-confirm-babel-evaluate nil + org-enable-github-support t + org-export-with-drawers t + org-export-with-section-numbers nil + org-export-with-sub-superscripts nil + org-export-babel-evaluate nil + org-export-backends (quote (ascii beamer html icalendar latex md odt rst)) + org-hide-emphasis-markers t + org-src-fontify-natively t + ;; Use current window when switch to source block + org-src-window-setup 'current-window + ;; Disable prompting to evaluate babel blocks + org-superstar-leading-fallback ?\s) pandoc ; brew install pandoc python (rust :variables @@ -593,9 +595,9 @@ you should place your code here." (define-key evil-insert-state-local-map (kbd "C-e") 'term-send-raw))) (add-hook 'yaml-mode-hook (lambda () - (outline-minor-mode) - (define-key yaml-mode-map (kbd "TAB") 'outline-toggle-children) - (setq outline-regexp "^ *"))) + (outline-minor-mode) + (define-key yaml-mode-map (kbd "TAB") 'outline-toggle-children) + (setq outline-regexp "^ *"))) (add-hook 'xref-backend-functions #'dumb-jump-xref-activate) (eval-after-load 'org '(progn @@ -613,7 +615,7 @@ you should place your code here." ;; TODO: update for changes to format in Org 9.2 ;; (add-to-list 'org-structure-template-alist ;; '("S" "#+BEGIN_SRC sh :exports both :results output org\n?\n#+END_SRC")) - )) + )) (defun insert-date() (interactive) @@ -634,28 +636,28 @@ Generates respective interactive functions to establish each connection." `(progn ,@(mapcar (lambda (conn) - `(add-to-list 'sql-connection-alist ',conn)) - connections) + `(add-to-list 'sql-connection-alist ',conn)) + connections) ,@(mapcar (lambda (conn) - (let* ((varname (car conn)) - (fn-name (intern (format "sql-connect-to-%s" varname))) - (buf-name (format "*%s*" varname))) - `(defun ,fn-name ,'() - (interactive) - (sql-connect ',varname ,buf-name)))) - connections))) + (let* ((varname (car conn)) + (fn-name (intern (format "sql-connect-to-%s" varname))) + (buf-name (format "*%s*" varname))) + `(defun ,fn-name ,'() + (interactive) + (sql-connect ',varname ,buf-name)))) + connections))) (sql-specify-connections (postgres (sql-product 'postgres) - ;; (sql-port 5432) - (sql-server "localhost") - (sql-user "jgmize") - ;; (sql-password "password") - (sql-database "postgres")) - (jgmize (sql-product 'postgres) - (sql-server "localhost") - (sql-user "jgmize") - (sql-database "jgmize"))) + ;; (sql-port 5432) + (sql-server "localhost") + (sql-user "jgmize") + ;; (sql-password "password") + (sql-database "postgres")) + (jgmize (sql-product 'postgres) + (sql-server "localhost") + (sql-user "jgmize") + (sql-database "jgmize"))) ;; (transient-append-suffix 'magit-push "-u" ;; '(1 "-s" "Skip gitlab pipeline" "--push-option=ci.skip")) From 775c280d2823727787ae172f783262319606351b Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Sun, 9 Nov 2025 18:33:43 -0600 Subject: [PATCH 3/5] Install kubectl via apt-get --- .docker/gcloud-slim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.docker/gcloud-slim b/.docker/gcloud-slim index 4d40787..85a922f 100644 --- a/.docker/gcloud-slim +++ b/.docker/gcloud-slim @@ -6,13 +6,12 @@ ARG USERNAME=jgmize RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ apt-get install -y --no-install-recommends \ build-essential ca-certificates curl emacs-nox git gpg gpg-agent htop jq \ - libsqlite3-0 microsocks openssh-server pandoc postgresql-client python3-epc \ + kubectl libsqlite3-0 microsocks openssh-server pandoc postgresql-client python3-epc \ python3-importmagic ripgrep software-properties-common sudo tmate tmux tree \ tzdata unzip && apt-get clean -y && \ rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN curl -LO https://github.com/supabase/cli/releases/download/v${SUPABASE_VERSION}/supabase_${SUPABASE_VERSION}_linux_amd64.deb && \ dpkg -i supabase_${SUPABASE_VERSION}_linux_amd64.deb -RUN gcloud components install kubectl --quiet RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ chmod +x get_helm.sh && ./get_helm.sh && \ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ From 4a0d9aca962395c4ac6fad7150c740c3eda34390 Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Sun, 9 Nov 2025 18:37:22 -0600 Subject: [PATCH 4/5] Remove trailing && \ --- .docker/gcloud-slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/gcloud-slim b/.docker/gcloud-slim index 85a922f..34db709 100644 --- a/.docker/gcloud-slim +++ b/.docker/gcloud-slim @@ -13,7 +13,7 @@ RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ RUN curl -LO https://github.com/supabase/cli/releases/download/v${SUPABASE_VERSION}/supabase_${SUPABASE_VERSION}_linux_amd64.deb && \ dpkg -i supabase_${SUPABASE_VERSION}_linux_amd64.deb RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \ - chmod +x get_helm.sh && ./get_helm.sh && \ + chmod +x get_helm.sh && ./get_helm.sh RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ unzip awscliv2.zip && ./aws/install && rm -rf awscliv2.zip aws RUN curl -L "https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64" \ From d3748b676a8853826682ec7b36e3363a971785bd Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Sun, 9 Nov 2025 18:41:36 -0600 Subject: [PATCH 5/5] Fix yamlscript.org url --- .docker/gcloud-slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/gcloud-slim b/.docker/gcloud-slim index 34db709..69a807d 100644 --- a/.docker/gcloud-slim +++ b/.docker/gcloud-slim @@ -20,7 +20,7 @@ RUN curl -L "https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/s -o /usr/local/bin/sops && chmod +x /usr/local/bin/sops RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 \ -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq -RUN curl -s http://yamlscript.org/install | BIN=1 bash +RUN curl -s https://yamlscript.org/install | BIN=1 bash RUN useradd -m -s /usr/bin/bash -G sudo ${USERNAME} WORKDIR /home/${USERNAME} USER ${USERNAME}