Skip to content

Instantly share code, notes, and snippets.

View indra4837's full-sized avatar

Indra Kurniawan indra4837

View GitHub Profile
@indra4837
indra4837 / lionel.sh
Created August 16, 2021 06:03
Lionel docker exec script
#!/bin/bash
SESSIONNAME="lionel"
STARTDIR="/home/augbooth/catkin_ws/src/boothbot"
tmux has-session -t apr &> /dev/null
# start detached session with session name and directory
tmux new-session -s $SESSIONNAME -c $STARTDIR -d
# send command/keys to session
tmux send-keys -t $SESSIONNAME "roscore" C-m
@indra4837
indra4837 / gs.sh
Created August 16, 2021 06:02
Guiding station docker exec script
#!/bin/bash
SESSIONNAME="gs"
STARTDIR="/home/augbooth/catkin_ws/src/boothbot"
tmux has-session -t apr &> /dev/null
# start detached session with session name and directory
tmux new-session -s $SESSIONNAME -c $STARTDIR -d
# send command/keys to session
tmux send-keys -t $SESSIONNAME "roscore" C-m
@indra4837
indra4837 / tmux.sh
Created August 13, 2021 05:20
bash script for tmux windows and panes
#!/bin/bash
SESSIONNAME="lionel"
STARTDIR="/home/augbooth/catkin_ws/src/boothbot"
tmux has-session -t apr &> /dev/null
# start detached session with session name and directory
tmux new-session -s $SESSIONNAME -c $STARTDIR -d
# send command/keys to session
tmux send-keys -t $SESSIONNAME "roscore" C-m
@indra4837
indra4837 / pubkeys
Last active August 13, 2021 05:22
generate pubkeys, adding keys to github, using only pubkey authentication
# generate keys. Press [ENTER] at every prompt
ssh-keygen
# add keys
curl https://github.com/indra4837.keys >> ~/.ssh/authorized_keys
# change to pubkeys only
ssh vim /etc/ssh/sshd_config
# uncomment and change password authentication
@indra4837
indra4837 / Better Git (git configs)
Last active August 12, 2021 04:10
Better Git (git configs)
# open gitconfig
vim ~/.gitconfig
# paste the following inside gitconfig
[alias]
tree = log --graph --all --pretty=format:'%C(magenta)%h%C(auto)%d %s %C(green)(%cr) %C(bold blue)%an%C(white)/%C(cyan)%cn'
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
@indra4837
indra4837 / xforward.gist
Last active March 18, 2021 07:05
X-forwarding on embedded devices
#! /usr/bin/env bash
sudo vim /etc/ssh/ssh_config
# Uncomment and change the following lines
ForwardX11 yes
ForwardX11Trusted yes
sudo vim /etc/ssh/sshd_config