Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add kaggle starter link #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ required arguments:

optional arguments:
--password PASSWORD password to protect your code-server from unauthorized access
--mount_drive if you use --mount_drive, your google drive will be mounted
--mount_drive if you use --mount_drive, your google drive will be mounted (Only in colab)
```

Else, you can do the following:
Expand All @@ -49,13 +49,15 @@ $ ColabCode()
# ColabCode has the following arguments:
# - port: the port you want to run code-server on, default 10000
# - password: password to protect your code server from being accessed by someone else. Note that there is no password by default!
# - mount_drive: True or False to mount your Google Drive
# - mount_drive: True or False to mount your Google Drive (Only in colab)

$ ColabCode(port=10000, password="abhishek", mount_drive=True)
```
## How to use it?
Colab starter notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/abhishekkrthakur/colabcode/blob/master/colab_starter.ipynb)

Kaggle starter notebook: [![Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://www.kaggle.com/kernels/fork-version/43820352)

`ColabCode` comes pre-installed with some VS Code extensions.

##### See an example in youtube video [![YouTube Video](https://img.shields.io/youtube/views/7kTbM3D02jU?style=social)](https://youtu.be/7kTbM3D02jU)
Expand Down
7 changes: 5 additions & 2 deletions colabcode/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ def _start_server(self):

def _run_code(self):
os.system(f"fuser -n tcp -k {self.port}")
if self._mount and colab_env:
drive.mount("/content/drive")
if self._mount:
if colab_env:
drive.mount("/content/drive")
else:
print("Mounting drive is supported only in colab")
if self.password:
code_cmd = f"PASSWORD={self.password} code-server --port {self.port} --disable-telemetry"
else:
Expand Down
2 changes: 1 addition & 1 deletion scripts/colabcode
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if __name__ == "__main__":
optional.add_argument(
"--mount_drive",
action="store_true",
help="if you use --mount_drive, your google drive will be mounted",
help="if you use --mount_drive, your google drive will be mounted(Only in colab)",
)

args = parser.parse_args()
Expand Down