Posts

Showing posts from December, 2022

7z command line

 7z command line 7z x ./file.tar.gz # extract .tar.gz and preserve top level directory

Installing Ubuntu on VM

Setting up Ubuntu in VirtualBox 7+ Follow the steps  here  for unattended install. Setup proxy as shown  here : sudo touch /etc/apt/apt.conf.d/proxy.conf sudo vi /etc/apt/apt.conf.d/proxy.conf Acquire::http::Proxy "http://user:password@proxy.server:port/" ; Acquire::http::Proxy "http://user:password@proxy.server:port/" ; Acquire::https::Proxy "http://user:password@proxy.server:port/" ; Add user to sudoers file as shown  here # add user to sudo group # Run as root usermod -aG sudo <username> # To ensure user has sudo privileges, if command returns root, user has sudo privileges sudo whoami # Otherwise add user to sudoers file visudo # At the end of file add the following. Replace <username> with the actual username <username> ALL=(ALL) NOPASSWD:/bin/mkdir,/bin/rmdir Run the following: sudo apt update && sudo apt upgrade -y For  wget  setup: For all users of the system via the /etc/wgetrc or for the user

Setting up Docker on Ubuntu

Update the apt cache and install curl   sudo apt-get update -y sudo apt install curl   Setup proxy servers in ~/.bashrc        export http_proxy=http://<proxy-server>:<port>      export https_proxy=http://<proxy-server>:<port>   Add GPG key   curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -   Install Docker   sudo apt install docker.io   Setup proxy (instructions from https://docs.docker.com/config/daemon/systemd/#httphttps-proxy )   Create a systemd drop-in directory for the  docker  service:     sudo mkdir -p /etc/systemd/system/docker.service.d   Create a file named /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:     [Service]   Environment="HTTP_PROXY=http://<proxy-server>:<port>"   Environment="HTTPS_PROXY=http://<proxy-server>:<port>"

Docker reference

 Docker run: sudo docker run -t -d --entrypoint "/bin/sh" --mount type=bind,source=${PWD},target=/src test:0.1 Finding the container name: docker ps Docker exec: docker exec <container name> /src/compile.sh docker exec <container name> /src/run.sh

Powershell tips

Edit profile:  nvim $PROFILE # or notepad $PROFILE Refresh environment variables: refreshenv

Simple Qt project compile and run from command line

 https://wiki.qt.io/Getting_Started_on_the_Commandline cd my/dir/hello qmake -project qmake make ./hello

Linux check dependencies of binary

 https://stackoverflow.com/questions/6242761/determine-direct-shared-object-dependencies-of-a-linux-binary readelf -d binaryname

Linux disk space analyzer

Baobab: http://www.marzocca.net/linux/baobab/