Skip to content

Instantly share code, notes, and snippets.

View its-dibo's full-sized avatar
💭
Software team lead

Dibo its-dibo

💭
Software team lead
View GitHub Profile
module, import,root, commonjs, commonjs2,amd-require, amd, amd-require, umd, umd2, global, , jsonp, node-commonjs, promise, self, system, script, this, var, window
build: update all dependencies
> npx npm-check-updates -u --deep
- resolve conflicts
> npm update -f
> npm audit fix --force
- run tests > npm test -- --allbuild: update all dependencies
> npx npm-check-updates -u --deep
- resolve conflicts
@its-dibo
its-dibo / docker.md
Last active November 7, 2021 18:21
docker commands

Docker

build

docker build . -t $image

view

docker run -it --rm=true $image sh
@its-dibo
its-dibo / gCloud-run-deploy.sh
Last active April 22, 2021 19:51
deploying to Google cloud run
# build the docker image
# tag with gcr.io/* to upload to google container registry
docker build . -t gcr.io/project-id/tag
# or tag an existing image
docker pull my-image
docker tag gcr.io/project-id/tag
# push the tagged image
docker push gcr.io/project-id/tag
@its-dibo
its-dibo / google-cloud-shell.md
Last active August 1, 2022 01:36
customizing Google cloud shell

to customize Google cloud shell, modify on of the following files:

  • $HOME/.customize_environment
  • $HOME/.profile
  • $HOME/.bashrc

notes

  • .customize_environment runs once when google shell instance boots up,
  • .profile, .bashrc run once for each shell login, i.e: when a new shell opened they will run, use to customise the shell prompt or to add environments.
# disk usage sort by size
# -h: human readable
du -h --max-depth=1 $path | sort -h
# current dir:
du -h --max-depth=1
# delete a directory
rm -r -f <dirName>
## generating a SSH key for a github account (i.e: login to your github account in the local machine)
//1- in the local machine:
$ git config --global user.name "John Doe"
$ git config --global user.email github@email
//check for existing key:
ls -al ~/.ssh
@its-dibo
its-dibo / code-server
Last active April 15, 2021 14:30
install visual studio (code-server) in google cloud shell
# install code-server using the script
curl -fsSL https://code-server.dev/install.sh | sh
# add code-server to $PATH.
# to set $PATH permenantly (i.e after restarts), add this line to $HOME/.customize_environment or .bashrc file
# https://cloud.google.com/shell/docs/configuring-cloud-shell#environment_customization_script
# change `code-server-3.9.0-linux-amd64` if needed.
> nano $HOME/.customize_environment
export PATH="$PATH:$HOME/code-server-3.9.0-linux-amd64/bin"
@its-dibo
its-dibo / init.coffee
Last active February 25, 2021 17:22
Atom plugin: sync-settings https://atom.io/packages/sync-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->