Skip to content

Instantly share code, notes, and snippets.

@lucasw
lucasw / gephex.md
Last active December 16, 2019 15:09
gephex

Now doing all gephex development in https://github.com/lucasw/gephex, that supersedes everything below.

git clone https://github.com/ChristianFrisson/gephex.git
cd gephex 
./bootstrap.sh
cd ..
mkdir
../gephex/configure --prefix=$HOME/other/install --with-qt-libdir=/usr/share/qt4/lib --with-qt-bindir=/usr/share/qt4/bin --with-qt-incdir=/usr/share/qt4/include
@lucasw
lucasw / mario.md
Last active May 26, 2018 23:02
Mario like games with good level editors
@lucasw
lucasw / linux_ubuntu_misc.md
Last active December 12, 2019 20:26
linux_ubuntu_misc.md

Simple chat across terminals

The recipient:

$ tty
/dev/pts/15

The sender:

@lucasw
lucasw / split_bag.sh
Last active November 26, 2023 06:20
Split ros bag into two
#!/bin/bash
# provide input.bag output_prefix time_fraction (0.0-1.0)
echo $1, $2, $3
t0=`rosbag info -y -k start $1`
t1=`rosbag info -y -k end $1`
tfr=`echo "$t0 + ($t1 - $t0) * $3" | bc -l`
echo $t0, $t1, $tfr
# thalf=`echo "($(rosbag info -y -k start output.bag) + $(rosbag info -y -k end output.bag))/2.0" | bc -l`
rosbag filter $1 $2_a.bag "t.secs <= $tfr"
rosbag filter $1 $2_b.bag "t.secs > $tfr"
@lucasw
lucasw / create_cloud_xyzrgb.py
Created April 25, 2018 00:08
Create PointCloud2 with python with rgb
#!/usr/bin/env python
# PointCloud2 color cube
# https://answers.ros.org/question/289576/understanding-the-bytes-in-a-pcl2-message/
import rospy
import struct
from sensor_msgs import point_cloud2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header
@lucasw
lucasw / tmux.md
Last active March 27, 2018 16:47
tmux

scroll limit

vi ~/.tmux.conf
set-option -g history-limit 3000
@lucasw
lucasw / github_cheatsheet.md
Last active May 3, 2019 04:14
github cheatsheet
@lucasw
lucasw / homm2_linux.md
Last active January 27, 2018 13:52
Heroes of Might & Magic 2

GOG installer leaves a desktop icon, and the game runs fine once clicked on but the resolution makes the window tiny and the mouse is permanently locked in focus.

cd ~/.wine/drive_c/GOG Games/HoMM 2 Gold
dosbox .
imgmount d homm2.inst -t iso -fs iso
heroes2.exe

But it crashes on first sleep.

@lucasw
lucasw / blender.md
Last active January 1, 2018 00:38
Rendering scenes with blender

Hair - need to set the stiffness up to 1.0 otherwise what is made in particle edit mode will go somewhere else in the object view/render.

Command line render

Render the 80th frame to "test0080.png":

blender -b ../scape14.blend -x 1 -o test -f 80