Skip to content

Instantly share code, notes, and snippets.

@mfehr
mfehr / open_all_ply_files.sh
Last active March 8, 2019 15:13
Meshlab: Open all ply files in a folder
#!/bin/bash
HELP="Usage:
./open_all_ply_files.sh [folder with ply files]"
if test "$#" -ne 1; then
echo "Illegal number of parameters!"
echo $HELP
exit 1
fi
@mfehr
mfehr / symlink_all_subfolders.sh
Last active July 26, 2016 11:02
Link all subfolders from one folder to another
@mfehr
mfehr / gstrep.sh
Last active March 29, 2017 08:58
Git Status for whole Repository: Check if you have pushed all your changes and branches
#!/bin/bash
git fetch --quiet
message="Does not exist on remote!"
all_remote_branches=$(git branch -r)
echo -e "\n\e[1m remote\tlocal\tbranch name\e[0m"
git branch | while read line ; do
@mfehr
mfehr / get_n_biggest_files.sh
Last active April 21, 2017 09:44
Get N biggest file in git repo
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
#
@mfehr
mfehr / gifify.sh
Last active March 2, 2023 09:48
gifify.sh
#!/usr/bin/env bash
# USAGE: gifify.sh <video> <start time in s> <duration in s> <desired FPS> <scale in px>
#
# Example: ./gifify yourvideo.mp4 3 [start time in seconds] 10 [duration in seconds] 15 [desired FPS] 600 [gif scale, expressed as desired width in pixel]
#
palette="/tmp/palette_$2_$3_$4_$5.png"
filters="fps=$4,scale=$5:-1:flags=lanczos"
@mfehr
mfehr / speedup.sh
Last active November 29, 2017 12:09
speedup.sh
#!/usr/bin/env bash
# USAGE: speedup.sh <video> <speedup_factor (e.g. 2)> <speedup_factor_inv (e.g. 0.5)>
# speedup_factor_inv has to be equal to 1 /speedup_factor
let b=30*$2
echo "ffmpeg -i $1 -r $b -filter:v 'setpts=${3}*PTS' ${1}_${2}x.mp4"
ffmpeg -i $1 -r $b -filter:v "setpts=${3}*PTS" ${1}_${2}x.mp4
@mfehr
mfehr / upgrade_14.04_gcc.sh
Created November 30, 2017 17:08
Upgrade gcc and g++ on Ubuntu 14.04
# Upgrade 14.04 to gcc/g++ from 16.04
# Based on: https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-snapshot -y && \
sudo apt-get update && \
sudo apt-get install gcc-5 g++-5 -y && \
@mfehr
mfehr / gstrep.sh
Last active June 18, 2018 13:56
Show all branches and whether they are up to date on the remote
#!/bin/bash
git fetch --quiet
message="Does not exist on remote!"
all_remote_branches=$(git branch -r)
echo -e "\n\e[1m remote\tlocal\tbranch name\e[0m"
git branch | while read line ; do
@mfehr
mfehr / gflags_from_ros_params.cc
Created February 7, 2019 18:32
Directly parse and set Gflags from ROS params.
// NOTE(mfehr): program_name can be obtained through argv[0].
void parseGflagsFromRosParams(
const char* program_name, const ros::NodeHandle& nh_private) {
CHECK_NOTNULL(program_name);
std::vector<google::CommandLineFlagInfo> flags;
google::GetAllFlags(&flags);
VLOG(1) << "Parsing gflags from ROS params...";
std::stringstream ss;
@mfehr
mfehr / imu-mynteye-s.yaml
Last active February 28, 2019 10:13
maplab calibration for mynteye S
id: 55111e8de9825e51aff5d6fd9e83a37b
hardware_id: mynteye/imu/data_raw
sensor_type: IMU
sigmas:
acc_noise_density: 0.016925432397973516
acc_bias_random_walk_noise_density: 0.016925432397973516
gyro_noise_density: 0.0010848026158819934
gyro_bias_random_walk_noise_density: 0.000023404834136742844
saturation_accel_max_mps2: 200.0
saturation_gyro_max_radps: 7.5