This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # uses pkill to kill the process | |
| # to echo the PIDs | |
| # echo $(ps -ef | grep "some search" | awk '{print $2}') | |
| # e.g. to kill every instance of "spotify" app | |
| for pid in $(ps -ef | grep "spotify" | awk '{print $2}'); do pkill -9 $pid; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Choose which terminal to use by default from all available ones | |
| update-alternatives --config x-terminal-emulator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Check the valid version to install as per your Ubuntu distribution on nodesource github | |
| # https://github.com/nodesource/distributions?tab=readme-ov-file#ubuntu-versions | |
| # Run below commands for installing latest available nodejs from nodesource ppa on Ubuntu 22.04 (latest at the time of writing) | |
| curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash - &&\ | |
| sudo apt-get install -y nodejs | |
| # If running into dpkg errors, follow the advice here https://github.com/nodesource/distributions/issues/1157#issuecomment-1605699451 | |
| # sudo dpkg --remove --force-remove-reinstreq libnode72:amd64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Note the correct disk to install the ubuntu OS: e.g. /dev/sdx | |
| fdisk -l | |
| # Copy the ISO file to the disk | |
| sudo dd bs=4M if=/path/to/iso of=/dev/sdx status=progress oflag=sync | |
| # Now disk is ready to be used as a bootable drive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // When you want to initialize a matrix with const specifier inline use the finished() call | |
| const double rot = 0.0; // angle in radians | |
| const Eigen::Matrix3d RotateAboutZAxis = | |
| (Eigen::Matrix3d(3, 3) << cos(rot), -sin(rot), 0, sin(rot), cos(rot), 0, 0, 0, 1).finished(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Follow this advice on managing compiler versions using update-alternatives | |
| # https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version | |
| # Below commands allow selecting the default compiler for gcc and g++ from the list of available ones | |
| sudo update-alternatives --config gcc | |
| sudo update-alternatives --config g++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Reference: | |
| # https://apt.llvm.org/ | |
| # For convenience there is an automatic installation script available that installs LLVM for you. | |
| # To install the latest stable version: | |
| bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" | |
| # To install a specific version of LLVM: | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh |