Category: Linux

  • Ubuntu basic commands

    Update packages/apps

    sudo apt update && sudo apt upgrade

    Compress/Decompress a file

    tar -zcvf compressedFileName.tar.gz directoryName

    tar -zxvf compressedFileName.tar.gz

    WSL use ssh key on remote server:
    eval ‘ssh-agent -s
    ssh-add -t 60m ~/.ssh/id_rsa
    ssh -A user:address

    MySQL

    sudo apt install mysql-server
    sudo mysql_secure_installation
    sudo /etc/init.d/mysql start
    sudo service mysql restart

    For WSL automatic start after restart:

    sudo update-rc.d mysql defaults

    SSH

    adduser roman
    usermod -aG sudo roman
    su - hideo
    mkdir ~/.ssh && chmod 700 ~/.ssh
    touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
    nano ~/.ssh/authorized_keys
    sudo ufw app list
    sudo ufw allow OpenSSH
    sudo ufw enable
    sudo ufw status
    sudo apt update
    sudo apt upgrade -u
    sudo reboot

    nginX

    sudo nano /etc/nginx/nginx.conf
    uncomment server_tokens off;
  • Win10 tools and settings for work with Ubuntu

    I spent a last few years working in Ubuntu and Linux Mint. Now I have a new computer and will do the setup with Win10 and WSL2.

    WSL settings and setup

    Turn Windows features on or off:

    • Telnet client
    • Virtual Machine Platform
    • Windows subsystem for linux

    Powershell:

    wsl --set-default-version 2

    Tools and apps

    • Ubuntu – install from windows appstore
    • Windows terminal – install from windows appstore
    • Docker desktop – needed for running docker in linux subsystem
    • Dbeaver.io – for accessing databases
    • Visual Studio Code

    Ubuntu settings

    ssh key

    windows terminal -> settings -> starting directory /mnt/d/

    Trouble with accessing D: drive as a regular user
    create or edit file /etc/wsl.conf and change default username to yours:

    [user]
    default=roman