Skip to content

Instantly share code, notes, and snippets.

@MasterpieceNKA
MasterpieceNKA / setup_moveit2_task_constructor.sh
Created May 26, 2026 12:57
Builds Moveit2 and Moveit Task Constructor from source
#!/bin/bash
# Setup MoveIT
# https://moveit.picknik.ai/main/doc/tutorials/getting_started/getting_started.html
rosdep update
sudo apt update
sudo apt dist-upgrade
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
colcon mixin update default
@MasterpieceNKA
MasterpieceNKA / moveit2_tutorials_setup.sh
Last active February 25, 2025 00:04
Installation of MoveIt2 Tutorials
#!/bin/bash
# install dependencies
sudo apt-get update && rosdep update
source /opt/ros/$ROS_DISTRO/setup.bash
export COLCON_WS=~/ws_moveit2
mkdir -p $COLCON_WS/src
@MasterpieceNKA
MasterpieceNKA / add_user.sh
Last active February 19, 2025 13:40
Add User to Ubuntu Distro
#!/bin/bash
# only run if USERNAME USER_UID are supplied as arguments
if [ ${#*} -gt 1 ]; then # if number of args is greater than 2
export USERNAME=$1
export USER_UID=$2
export USER_GID=$USER_UID
if ! id -u $USER_UID >/dev/null 2>&1; then \
groupadd --gid $USER_GID $USERNAME && \
useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME; \
@MasterpieceNKA
MasterpieceNKA / find_replace.py
Last active January 29, 2025 13:02
Python Script for finding and replacing text in a file. Arg1 file, Arg2 find_text, Arg3 replace_text
#!/usr/bin/python3
"""@package docstring
Finds and replaces text in a file
Usage:
python3 find_replace.py /path/to/file.file_extension "some text to find" "some other text to replace the found text"
./find_replace.py /path/to/file.file_extension "some text to find" "some other text to replace the found text"
"""
import sys
import os
@MasterpieceNKA
MasterpieceNKA / moveit2_plus_tutorials_setup.sh
Last active February 27, 2025 18:01
Setup MoveIT2 with optional MoveIT2 Tutorials
#!/bin/bash
# install dependencies
sudo apt-get update && sudo apt-get uprade -y
sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-colcon-mixin \
@MasterpieceNKA
MasterpieceNKA / manim_setup.sh
Last active January 14, 2025 20:33
manim setup script
#!/bin/bash
source ~/venv/bin/activate
git clone -b master https://github.com/3b1b/manim.git ~/manim
python3 -m pip install -e ~/manim
python3 -m pip install jupyterlab
@MasterpieceNKA
MasterpieceNKA / manim_entrypoint.sh
Last active January 1, 2025 10:36
manim_entrypoint.sh
#!/bin/bash
TEX_DIR=$(find "/usr/local/" -maxdepth 1 -type d -regextype egrep -regex "/usr/local/texlive" -print -quit)
if ! [ -n "$TEX_DIR" ]; then
echo "installing tex"
cd /tmp
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
#curl -L -o install-tl-unx.tar.gz https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
#!/bin/bash
cd /tmp
curl -L -o install-tl-unx.tar.gz https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
cd install-tl-*
sudo perl ./install-tl --no-interaction
export TEX_DIR="/usr/local/texlive"
TEX_INSTAL_DIR=$(find $TEX_DIR -maxdepth 3 -type d -regextype egrep -regex "$TEX_DIR/([0-9][0-9][0-9][0-9])?/bin/.*" -print -quit)
@MasterpieceNKA
MasterpieceNKA / docker_ros2_entrypoint.sh
Last active November 12, 2024 11:57
Docker Entrypoint Script for ROS2
#!/bin/bash
set -e
# Do all the needed sourcing in ~/.bashrc file
source ~/.bashrc
echo "Provided arguments: $@"
exec $@
@MasterpieceNKA
MasterpieceNKA / moveit2_humble_setup.sh
Created November 12, 2024 08:29
MoveIt2 Setup for ROS2 Humble
#!/bin/bash
sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-flake8 \
python3-rosdep \
python3-setuptools \