Skip to content

Instantly share code, notes, and snippets.

Plug 'puremourning/vimspector' " wrap in vim-plug paragraph
let g:vimspector_enable_mappings = 'HUMAN'
let g:vimspector_sign_priority = {} "TBD
@pabsan-0
pabsan-0 / .bashrc
Created February 16, 2024 08:06
bashrc
echo 'echo sleep 0.01 >> ~/.bashrc' >> ~/.bashrc
@pabsan-0
pabsan-0 / stow-compare.sh
Created December 26, 2023 17:06
Compare stowed and related files in a dotfile-like environment
#!/bin/bash
# Terminology:
#
# ~ # target_dir
# ├── .tmux.conf -> dotfiles/vim/.vimrc # target_link target_file
# ├── .vimrc
# │
# └── dotfiles # stow_dir
# ├── tmux # stow_pkg
@pabsan-0
pabsan-0 / alcampo.sh
Created August 9, 2023 09:57
Alcampo.es nutritional value web scraper
# Alcampo.es nutritional value web scraper.
# Usage:
# $ alcampo.sh <URL>
#
# Scrape product title
curl -s "$1" | tr "h1" "\n" | grep '"name":"' | sed 's:^.*name"\:"::' | sed 's:"."description.*$::g'
echo
@pabsan-0
pabsan-0 / tmuxinator.yml
Created June 22, 2023 11:25
Latency profiling on glass-to-glass streams
#! /usr/bin/env -S tmuxinator start -p
# chmod +x me!
name: latency profiler
on_project_exit: killall gst-launch-1.0; tmux kill-session
windows:
- main:
layout: even-vertical
panes:
- gst-launch-1.0 uridecodebin "uri=rtsp://10.0.3.5:8554/basler3" ! queue ! videoconvert ! videobalance brightness=0.5 contrast=1.5 ! xvimagesink sync=0 async=0
@pabsan-0
pabsan-0 / .tmuxinator.yml
Last active May 10, 2023 12:18
ROS stack to send images to JS browser
name: ros_noetic_video
on_project_exit: tmux kill-window
windows:
- main:
pre: source /opt/ros/noetic/setup.bash
layout: tiled
panes:
- roscore
- sleep 1; roslaunch rosbridge_server rosbridge_websocket.launch
- sleep 1; rosrun web_video_server web_video_server
@pabsan-0
pabsan-0 / README.md
Last active December 24, 2023 05:51
Gstreamer send-recv examples through an RTSP server

Gstreamer RTSP demos

This gist comprises several Gstreamer send-recv examples through an RTSP server.

Dependencies

  • Tmuxinator apt install tmuxinator
  • Tmux apt install tmux
  • Gstreamer fat install
@pabsan-0
pabsan-0 / index.js
Created April 13, 2023 07:58
Ros node template for nodejs
#!/usr/bin/env node
const rosnodejs = require('rosnodejs');
const { readFileSync, readdirSync } = require('fs');
const { readFile } = require('fs').promises;
const express = require('express');
const app = express();
const path = require('node:path');
let host = null

Plane tilt corrector

Given three non-square points ABP within a plane, of which A and B can move vertically while P is fixed, the conversion from unaligned tilting to plane orthogonal rotation to an arbitrary XYZ coordinate frame is not trivial and raises the following challenges:

  • Requested a pure rotation around the X or Y axes, yield the actuation needed in terms of A and B vertical position.
  • Requested a vertical movement in A or B, adjust its partner height so that the plane rotation is square with a fixed coordinate frame.

This script simulates and solves the two above scenarios.

@pabsan-0
pabsan-0 / find_up_macros.bash
Created March 22, 2023 07:57
Snippets to look for files in parent directories
## https://unix.stackexchange.com/a/22215
## find_up filename
find_up () {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
echo "$path"
}