Notes

Docker

  • Stop all containers
    docker rm -f $(docker ps -aq)
  • Enter into a container
    docker exec <container> sh

GIT

  • Ignore file mode
    git config core.fileMode false
  • Clean origin
    git fetch -p
  • Show repository address
    git remote show origin
  • Revert changes
    git checkout <commit> -- <file>
  • Graph log
    git log --graph --all
  • "Undo"
    git reset --hard ORIG_HEAD
  • Rebase commits From current to target
    git rebase <target>
  • Squash commits from current-commit to target-commit
    git rebase -i <pre_target-commit>

NPM

  • Show active npm links
    npm ls -g --depth=0 --link=true

SSH

  • Generate key
    ssh-keygen -t rsa -C "<email>"
  • Run SSH Agent
    eval "$(ssh-agent -s)"
  • Add key
    ssh-add ~/.ssh/id_rsa
  • Check connection
    ssh -T git@<server>

VirtualBox

  • Enable "Nested VT-x/AMD-V"
    VBoxManage modifyvm "<name>" --nested-hw-virt on
  • MacOS set resolution
    VBoxManage setextradata "<name>" VBoxInternal2/EfiGraphicsResolution <resolution-x>x<resolution-y>
    

Windows

  • Проверка всех приложений и их полные имена.
    Get-AppxPackage | Select Name, PackageFullName
  • Удаление приложения по названию
    Get-AppxPackage -allusers <название> | Remove-AppxPackage

Other

  • Inotify Watches Limit (https://youtrack.jetbrains.com/articles/IDEA-A-2/Inotify-Watches-Limit)
    • Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
      fs.inotify.max_user_watches = 524288
    • Then run this command to apply the change:
      sudo sysctl -p --system
  • Chmod
    sudo chmod -R <mode> <path>
  • Find & Kill Process
    • Find Process
      ps ax |grep <search>
    • Check ports
      netstat -natp
    • Kill Process by Id
      sudo kill -9 <Id>
  • Replace all extensions
    find . -name "*.<from>" -exec rename -v 's/\.<from>$/\.<to>/i' {} \;