Skip to content

Instantly share code, notes, and snippets.

@jihoonl
jihoonl / profiling.py
Created October 18, 2017 09:53
How to run python profiler
import cProfile
cProfile.run('FUNCTION_TO_PROFILE()')
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
with PyCallGraph(output=GraphvizOutput()):
code_to_profile()
jihoonl@whoola:~/research/ros/ecto/src/ecto_pcl/samples$ gdb --args /usr/bin/python ./openni2_viewer.py
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@jihoonl
jihoonl / .vimrc
Last active January 4, 2017 21:57
set nocompatible " iMproved
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' "Needed for plugin install
Plugin 'tomasr/molokai' "Colorscheme
Plugin 'tpope/vim-fugitive' " GIT
Plugin 'scrooloose/nerdtree' "file tree
#!/bin/bash
sudo pip install flake8
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt-get install vim
elif [[ "$OSTYPE" == "darwin" ]]; then
brew install vim --override-system-vi
fi
mv ~/.vimrc ~/.vimrc.old
# tmux list
> tmux ls
# access tmux
> tmux a <tmux name>
# detach
Ctrl + b then d
@jihoonl
jihoonl / vimrc
Created September 22, 2015 06:29
set number
set laststatus=2
set title
set showmode
set nowrap
"------------------Set Search Options-------
set hlsearch
set incsearch
set ignorecase
@jihoonl
jihoonl / concert-clinet.con
Created August 7, 2015 07:19
upstart script that starts on bootup
description "rocon concert client"
start on (local-filesystems and net-device-up IFACE=wlan0)
stop on (runlevel [016])
setuid yujin
env HOME=/home/yujin
script
@jihoonl
jihoonl / network restart crontab
Last active March 20, 2021 10:54
Crontab for network restart
#!/usr/bin/perl
# network_restart.pl
# A network restarting script.
# We want to check $loop times before exiting, with $sleep seconds delay
# If network is bad, we don't get connection immediately,
# so we must try for some durations before we get any connection
# You can run this script using cron at specific hours or even minutes of day
@jihoonl
jihoonl / roslaunch upstart script
Created June 19, 2015 07:37
roslaunch upstart script
description "rocon demo backend"
setuid yujin
instance $CLIENT
instance $PORT
env ROS_HOSTNAME=xavier
env ROS_MASTER_URI=http://localhost:11311
@jihoonl
jihoonl / Multiple Upstart script handling
Last active August 29, 2015 14:23
Multiple Upstart script handling
description "rocon demo backend"
stop on stopping rocon-demo-backends
env ROS_HOSTNAME=xavier
env ROS_MASTER_URI=http://localhost:11311
pre-start script
echo "Starting..."
for i in robosem_bridge:11316 hue_bridge:11317 motion_checker:11318 door_opener:11319 rf233_sensors_checker:11320;