This file contains 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
gcc -v -march=native -E - 2>&1 <<(echo) | grep -Po -- 'cc1.*-march=\K[^ ]*' |
This file contains 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
systemd-run --user --scope -p CPUQuota=25% --slice=stress -- stress -c 1 | |
# Where you replace stress -c 1 with your command | |
# Ubuntu 20.04 doesn't support this with non root users, so you have to run | |
sudo systemd-run --scope -p CPUQuota=25% --slice=stress -- stress -c 1 | |
# Note that this remove all the environment variables. | |
# If you want to run as the current user | |
sudo systemd-run --scope -p CPUQuota=25% --uid="$(id -u)" --gid="$(id -g)" --slice=stress -- id |
This file contains 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
#!/usr/bin/sh | |
{ grep -Poh '(?<=^import )[^.][A-Za-z_.]*' . -r ; grep -Poh '(?<=^from )[^.].*(?=import)' . -r ; } | cut -d '.' -f 1 | tr -d ' ' | sort | uniq | |
This file contains 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
#! /usr/bin/bash | |
# Run: `catkin config --append-args --cmake-args "-DCMAKE_EXPORT_COMPILE_COMMANDS=1"` to setup catkin correctly. | |
export ROS_WS_DIR=`catkin locate` || { echo "Not in a catkin workspace." ; exit 1; } | |
source /opt/ros/noetic/setup.bash | |
[[ -f ./devel/setup.bash ]] && source ./devel/setup.bash | |
echo -ne "[\n]" > $ROS_WS_DIR/.catkin_tools/CATKIN_BUILD_DUMMY.json |
This file contains 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
ip addr show tun0 | grep -Po '(?<=inet )([0-9]{1,3}\.){3}[0-9]{1,3}(?=/[0-9]{1,3})' |
This file contains 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
#! /usr/bin/sh | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <delay> <command> [args...]" | |
exit 1 | |
fi | |
sleep "$1" | |
shift | |
exec "$@" |
This file contains 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
#! /usr/bin/zsh | |
set -euo pipefail | |
# Arguments | |
# -t | --tractor=TRACTOR_NAME | |
# -r | --run=RUN_NAME | |
DATA_HOME="${HOME}/kalibr_ws/sync_logs/" |
This file contains 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
#! /usr/bin/python3 | |
import sys | |
from pathlib import Path | |
import rosbag | |
from tqdm import tqdm | |
def main(): |
This file contains 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
# python -m pip install rosbag rospkg pycryptodome gnupg | |
import sys | |
import Crypto | |
sys.modules['Cryptodome'] = Crypto | |
import rosbag |
This file contains 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
sudo mkdir /usr/local/share/ca-certificates/cloudflare | |
cd !$ | |
sudo cp ~/Downloads/Cloudflare_CA.pem ./Cloudflare_CA_1.crt # Note that the extension has changed. | |
sudo update-ca-certificates | |
NewerOlder