GithubHelp home page GithubHelp logo

cheatsheet's Introduction

git

change master to an older commit

git checkout 307a5cd        # check out the commit that you want to reset to 
git checkout -b fixy        # create a branch named fixy to do the work
git merge -s ours master    # merge master's history without changing any files
git checkout master         # switch back to master
git merge fixy              # and merge in the fixed branch
git push                    # done, no need to force push!

how to make a fork of a public repository private

First, duplicate the repo as others said (details here):

Create a new repo (let's call it private-repo). Then:

git clone --bare https://github.com/exampleuser/public-repo.git
cd public-repo.git
git push --mirror https://github.com/yourname/private-repo.git
cd ..
rm -rf public-repo.git

Clone the private repo so you can work on it.

git clone https://github.com/yourname/private-repo.git
cd private-repo
make some changes
git commit
git push origin master

To pull new hotness from the public repo:

cd private-repo
git remote add public https://github.com/exampleuser/public-repo.git
git pull public master # Creates a merge commit
git push origin master

docker/linux

check disk space

df -h --total

view logfile live

tail -f logfile.log

attach to docker-compose logs(contol+c to detach)

sudo docker-compose logs -f -t --tail=100

use standard kernel of env for jupyter notebook

python3 -m ipykernel install --user

look for running processes on GPU

nvidia-smi

if process is for some reason not listed, list it with:

fuser -v /dev/nvidia

kill process by ID

kill -9 ID

end all jupyter notebooks if no permission to shut down regularly

https://stackoverflow.com/questions/50917379/cannot-stop-jupyter-notebook,

Issue not resolved: jupyterhub/jupyterhub#1377

pkill jupyter

pull cuda cudnn tensorflow ready to use image:

docker pull nvcr.io/nvidia/tensorflow:19.02-py3

create container with cetain GPU and portforwarding to be able to connect to a jupyter notebook for exmaple:

docker run -it --shm-size=1g --ulimit memlock=-1 --gpus device=1 -p 1234:1234 --name containername imagename

restart container to run it permanently:

exit

docker start containername

get into running container

docker exec -it containername bash

activate venv environment

source /home/venvname/bin/activate

Run jupyter lab Inside the Container/Remote:

jupyter lab --no-browser --port <port-number>

Run jupyter notebook Inside the Container/Remote:

jupyter notebook --ip 0.0.0.0 --no-browser --allow-root --port 1234

access jupyter notebook/lab via ssh

ssh -N -f -L localhost:8888:localhost:1234 remote_user@remote_host

Host machine access this url:

localhost:1234

stop container

docker stop containername

to start a Training and detach it from console, so one can disconnect without stopping

screen -ls to view running sessions and their pids.

screen to start screen session.

control + a + d to detach.

control + a + \ to stop.

screen -X -S [session # you want to kill] quit

screen -r [pid] to resume a session

view running containers

docker ps

view all containers

docker container ls -a

refresh bash

source ~/.bashrc

save image as tar.gz

docker save myimage:latest | gzip > myimage_latest.tar.gz

load image from tar.gz

docker load < myimage_latest.tar.gz

cheatsheet's People

Contributors

johannes0horn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.