From ed3c502102ed36ddd3757bb67cf1e328a282e007 Mon Sep 17 00:00:00 2001 From: askiiart Date: Sat, 2 Sep 2023 23:20:20 -0500 Subject: [PATCH 1/6] Add devcontainer settings --- coding/devcontainer-settings.md | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 coding/devcontainer-settings.md diff --git a/coding/devcontainer-settings.md b/coding/devcontainer-settings.md new file mode 100644 index 0000000..cca2356 --- /dev/null +++ b/coding/devcontainer-settings.md @@ -0,0 +1,76 @@ +# devcontainer settings + +## Base settings + +```json +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/cpp +{ + "name": "askiiart ", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/:1-1-bookworm", + "customizations": { + "vscode": { + "extensions": [ + // Themes + "kokoscript.loopytheme", + "freebroccolo.theme-atom-one-dark", + "BeardedBear.beardedtheme", + // End themes + "AdrienTecher.just-cant-git-enough", + "codezombiech.gitignore", + "DavidAnson.vscode-markdownlint", + "dzhavat.git-cheatsheet", + "eamodio.gitlens", + "GitHub.copilot", + "GitHub.copilot-labs", + "GitHub.vscode-pull-request-github", + "Gruntfuggly.todo-tree", + "IJustDev.gitea-vscode", + "mhutchie.git-graph", + "VisualStudioExptTeam.intellicode-api-usage-examples", + "VisualStudioExptTeam.vscodeintellicode", + "wayou.vscode-todo-highlight", + "yzhang.markdown-all-in-one", + ] + } + }, + "mounts": [ + "source=${localEnv:HOME}/.zshrc,target=/etc/zsh/zshrc,type=bind,consistency=cached", + "source=${localEnv:HOME}/.zkbd,target=/home/vscode/.zkbd,type=bind,consistency=cached", + "source=${localEnv:HOME}/.oh-my-zsh,target=/home/vscode/.oh-my-zsh,type=bind,consistency=cached" + ] + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "gcc -v", + // Configure tool-specific properties. + // "customizations": {}, + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} +``` + +## C++ + +Extensions: + +```json + "danielpinto8zz6.c-cpp-compile-run", + "ms-vscode.cmake-tools", + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "ms-vscode.cpptools-themes", + "twxs.cmake", +``` + +## Rust + +Extensions: + +```json + "rust-lang.rust-analyzer", + "serayuzgur.crates" +``` From 85f3e0c4d0e3b15020ff49dc396f91d8cc804534 Mon Sep 17 00:00:00 2001 From: askiiart Date: Sun, 3 Sep 2023 11:32:55 -0500 Subject: [PATCH 2/6] Add python info --- coding/devcontainer-settings.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/coding/devcontainer-settings.md b/coding/devcontainer-settings.md index cca2356..bf57b50 100644 --- a/coding/devcontainer-settings.md +++ b/coding/devcontainer-settings.md @@ -31,7 +31,7 @@ "VisualStudioExptTeam.intellicode-api-usage-examples", "VisualStudioExptTeam.vscodeintellicode", "wayou.vscode-todo-highlight", - "yzhang.markdown-all-in-one", + "yzhang.markdown-all-in-one" ] } }, @@ -72,5 +72,19 @@ Extensions: ```json "rust-lang.rust-analyzer", - "serayuzgur.crates" + "serayuzgur.crates", ``` +## Python + +Extensions: + +```json + "ms-python.python", + "ms-python.black-formatter", +``` + +Image: + + ```json + "image": "mcr.microsoft.com/devcontainers/python:3", + ``` \ No newline at end of file From a85ff684f1a524bec40282c4d0c706079fd6748c Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 6 Sep 2023 20:01:32 -0500 Subject: [PATCH 3/6] Fix formatting --- coding/devcontainer-settings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coding/devcontainer-settings.md b/coding/devcontainer-settings.md index bf57b50..2d802e9 100644 --- a/coding/devcontainer-settings.md +++ b/coding/devcontainer-settings.md @@ -85,6 +85,6 @@ Extensions: Image: - ```json +```json "image": "mcr.microsoft.com/devcontainers/python:3", - ``` \ No newline at end of file +``` \ No newline at end of file From d6753c2c7219c4aba95d3b8d3a150ac3b9d45b37 Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 6 Sep 2023 20:29:10 -0500 Subject: [PATCH 4/6] Fix submodule (I think) --- zsh/zsh-files/.oh-my-zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/zsh-files/.oh-my-zsh b/zsh/zsh-files/.oh-my-zsh index 00951bb..8d03ad1 160000 --- a/zsh/zsh-files/.oh-my-zsh +++ b/zsh/zsh-files/.oh-my-zsh @@ -1 +1 @@ -Subproject commit 00951bb4c4fdfbd28e0b28fc33a497eea5fdbe24 +Subproject commit 8d03ad1c4799de6815ab943d2c6ac2cd35394e59 From 29d500bfd5454090d26cf6c91e1880ba41e7974f Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 6 Sep 2023 20:54:23 -0500 Subject: [PATCH 5/6] Add distro-specific, update "unsuppported" message --- daily-use-pcs/setup-git.bash | 2 +- distro-specific.bash | 25 +++++++++++++++++++++++++ qemu-install.sh => qemu-install.bash | 2 +- random-bash.md | 2 +- zsh/zsh-setup.bash | 2 +- 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 distro-specific.bash rename qemu-install.sh => qemu-install.bash (93%) diff --git a/daily-use-pcs/setup-git.bash b/daily-use-pcs/setup-git.bash index 2d18c0a..c7c563c 100755 --- a/daily-use-pcs/setup-git.bash +++ b/daily-use-pcs/setup-git.bash @@ -31,7 +31,7 @@ elif command_exists "apk"; then sudo apk add pass sudo apk add git else - echo "Unsupported: unknown package manager" + echo "Unsupported: unknown package manager and distro" fi # Check if GCM is installed diff --git a/distro-specific.bash b/distro-specific.bash new file mode 100644 index 0000000..e96cfaa --- /dev/null +++ b/distro-specific.bash @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -e +if [ $(whoami) == "root" ]; then + echo "Run as a normal user, not root" + exit 1 +fi + +command_exists() { type "$1" &>/dev/null; } + +if command_exists "apt-get"; then + ; +elif command_exists "yum"; then + ; +elif command_exists "pacman"; then + ; +elif command_exists "zypp"; then + # Untested + ; +elif command_exists "emerge"; then + ; +elif command_exists "apk"; then + ; +else + echo "Unsupported: unknown package manager and distro" +fi diff --git a/qemu-install.sh b/qemu-install.bash similarity index 93% rename from qemu-install.sh rename to qemu-install.bash index 130c6ba..36800cd 100644 --- a/qemu-install.sh +++ b/qemu-install.bash @@ -25,6 +25,6 @@ elif command_exists "apk"; then sudo rc-update add libvirtd sudo rc-service libvirtd start else - echo "Unsupported: unknown package manager" + echo "Unsupported: unknown package manager and distro" fi diff --git a/random-bash.md b/random-bash.md index cc0064a..6e048cc 100755 --- a/random-bash.md +++ b/random-bash.md @@ -37,7 +37,7 @@ elif command_exists "emerge"; then elif command_exists "apk"; then PM="apk" else - >&2 echo "Unsupported: unknown package manager" + >&2 echo "Unsupported: unknown package manager and distro" exit 1 fi diff --git a/zsh/zsh-setup.bash b/zsh/zsh-setup.bash index f34915d..83b5903 100755 --- a/zsh/zsh-setup.bash +++ b/zsh/zsh-setup.bash @@ -26,7 +26,7 @@ elif command_exists "emerge"; then elif command_exists "apk"; then sudo apk add zsh -y else - echo >&2 "Unsupported: unknown package manager" + echo >&2 "Unsupported: unknown package manager and distro" exit 1 fi From 0ac0020fdd47f36682a2d360ac8767a5260a71bf Mon Sep 17 00:00:00 2001 From: askiiart Date: Thu, 7 Sep 2023 09:03:55 -0500 Subject: [PATCH 6/6] Fix cp and add chsh --- zsh/zsh-setup.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/zsh-setup.bash b/zsh/zsh-setup.bash index 83b5903..b396474 100755 --- a/zsh/zsh-setup.bash +++ b/zsh/zsh-setup.bash @@ -30,4 +30,8 @@ else exit 1 fi -cp -r zsh-files/.* ~/ +cp -r zsh-files/.oh-my-zsh ~/ +cp -r zsh-files/.zkbd ~/ +cp zsh-files/.zshrc ~/ + +chsh -s $(which zsh)