Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# OS generated files
.DS_Store
Thumbs.db

# Node modules and logs
node_modules/
npm-debug.log

# Python caches
__pycache__/
*.pyc

# Editor directories
.vscode/
.idea/

# Supabase temporary files
supabase/.temp/

# Other
*.swp
2 changes: 1 addition & 1 deletion .zsh/configs/virtual/node.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export NVM_DIR="$HOME/.nvm"

[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm

export PNPM_HOME="/Users/keito/Library/pnpm"
export PNPM_HOME="$HOME/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It includes settings for various tools, such as the shell (Zsh), Git, npm, and V

## Directory Structure

- `docker`: Contains a Dockerfile and docker-compose file for setting up a Docker-based development environment using the `codercom/code-server` image.
- `docker`: Contains a Dockerfile and docker-compose file for setting up a Docker-based development environment using the `codercom/code-server` image. Set the `CODE_SERVER_PASSWORD` environment variable to control the login password.
- `kubernetes`: Contains files for setting up a Kubernetes cluster using Vagrant, including a Vagrantfile, scripts for the master and worker nodes, and a script for fetching GKE credentials.
- `script`: Contains scripts for exporting configuration settings from a system to this repository (`export.sh`), importing configuration settings from this repository to a system (`import.sh`), and checking for changes and making a commit (`commit_changes.sh`).
- `.zsh`, `git`, `macOS`, `.vscode`, `linux`, `vscode`, `npm`, `brew`, `dot`: These directories contain various configuration files and settings for different tools and systems.
Expand All @@ -17,7 +17,7 @@ Before using these configuration settings, you should review them and adjust as

### Importing Configuration Settings

Run the `import.sh` script to import the configuration settings to a system. Depending on the operating system, it performs the following actions:
Set the `REPO_PATH` environment variable to this repository's root and run the `import.sh` script to import configuration settings. Depending on the operating system, it performs the following actions:

- Installs packages listed in a Brewfile.
- Installs VS Code extensions listed in a specific file.
Expand All @@ -26,15 +26,15 @@ Run the `import.sh` script to import the configuration settings to a system. Dep

### Exporting Configuration Settings

Run the `export.sh` script to export the configuration settings from a system to this repository. Depending on the operating system, it performs the following actions:
Ensure `REPO_PATH` points to the repository and run the `export.sh` script to capture the current machine's configuration. Depending on the operating system, it performs the following actions:

- Writes the list of installed VS Code extensions to a file.
- Dumps the list of installed Brew packages to a Brewfile.
- Copies various configuration files from the home directory to the repository.

### Checking for Changes

Run the `commit_changes.sh` script to check if there are any changes in the repository. If there are changes, it stages all of them and makes a commit.
Run the `commit_changes.sh` script with `REPO_PATH` set to this repository to check for local modifications. If there are changes, it stages all of them and makes a commit.

## Glossary

Expand Down
3 changes: 2 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ services:
shm_size: '2gb'
container_name: code-server
environment:
PASSWORD: "password"
# Set CODE_SERVER_PASSWORD in your shell to change the default password
PASSWORD: ${CODE_SERVER_PASSWORD:-changeme}
ports:
- 8080:8080
volumes:
Expand Down
15 changes: 13 additions & 2 deletions kubernetes/gcloud.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
gcloud container clusters get-credentials $NAME --region=$REGION --project=$PROJECT
#TODO: get-credentials by each project
#!/bin/bash

# Fetch credentials for clusters across multiple projects
# Usage: ./gcloud.sh cluster-name region project1 [project2 ...]

NAME=$1
REGION=$2
shift 2

for PROJECT in "$@"; do
echo "Fetching credentials for $NAME in $PROJECT"
gcloud container clusters get-credentials "$NAME" --region="$REGION" --project="$PROJECT"
done
6 changes: 3 additions & 3 deletions macOS/preferences.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock largesize -float 100
defaults write com.apple.finder AppleShowAllFiles -boolean true

# TODO: Add other preferences here
# Additional preferences can be added below

killall Dock
killall Dockkillall SystemUIServer
killall Dockkillall Finder
killall SystemUIServer
killall Finder
10 changes: 9 additions & 1 deletion script/commit_changes.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash

function check_and_commit() {
cd $REPO_PATH
if [[ -z "$REPO_PATH" ]]; then
echo "REPO_PATH is not set" >&2
return 1
fi
if [[ ! -d "$REPO_PATH" ]]; then
echo "Directory $REPO_PATH does not exist" >&2
return 1
fi
cd "$REPO_PATH" || return 1

bash ./script/export.sh

Expand Down
6 changes: 6 additions & 0 deletions script/export.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/zsh

# Ensure REPO_PATH exists
if [[ -z "$REPO_PATH" ]]; then
REPO_PATH=$(pwd)
fi
mkdir -p "$REPO_PATH/brew" "$REPO_PATH/vscode" "$REPO_PATH/git" "$REPO_PATH/dot" "$REPO_PATH/npm" "$REPO_PATH/.zsh"

# Determine the OS
if [[ $(uname) = "Linux" ]]; then
OS=linux
Expand Down
5 changes: 5 additions & 0 deletions supabase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Supabase Configuration

This directory is reserved for Supabase-related configuration files.
Add any Supabase migrations or settings here. The `.temp` directory is
ignored by Git and is used for temporary files such as the CLI version.