Skip to content

Instantly share code, notes, and snippets.

View DerekChia's full-sized avatar
🎯
Focusing

Derek Chia DerekChia

🎯
Focusing
View GitHub Profile
@DerekChia
DerekChia / docker-compose.yml
Last active December 26, 2021 10:52
Start a container, read and print the environment variable stored in .env file
version: "3"
services:
hello_world:
container_name: ubuntu
image: ubuntu:latest
env_file: .env # optional, change this if your filename is different
command: '/bin/sh -c "echo $$VARIABLE_ONE"'
VARIABLE_ONE=ONE
VARIABLE_TWO=TWO
$ printenv SAMPLE_ENV_VAR
env-var
$ export SAMPLE_ENV_VAR=env-var
$ echo $SAMPLE_ENV_VAR
env-var
$ printenv SAMPLE_ENV_VAR
env-var
$ printenv
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
### REDACTED ###
XDG_SESSION_TYPE=x11
GNOME_SHELL_SESSION_MODE=ubuntu
HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
$ set | grep 'SAMPLE_SHELL_VAR'
SAMPLE_SHELL_VAR=shell-var
$ SAMPLE_SHELL_VAR=shell-var
$ echo $SAMPLE_SHELL_VAR
shell-var
$ set | grep 'SAMPLE_SHELL_VAR'
SAMPLE_SHELL_VAR=shell-var
$ set
'!'=0
'#'=0
#### REDACTED ####
userdirs
usergroups
watch=( )
widgets
@DerekChia
DerekChia / 10min_cudf_cupy.ipynb
Created April 12, 2020 10:08 — forked from beckernick/10min_cudf_cupy.ipynb
10 Minutes to cuDF and CuPy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DerekChia
DerekChia / delete_git_submodule.md
Created March 12, 2020 08:38 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule