Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
#!/bin/bash
#install ompugao dotfiles
cd
GIT_SSL_NO_VERIFY=1 git clone https://sifi@ompugao.mydns.jp/git/dotfiles.git
cd dotfiles
make install_vim
@ompugao
ompugao / attach-gdb.sh
Last active August 29, 2015 14:03
attach gdb to the process selected via peco
function attach-gdb() {
gdb -p `ps aux | peco | awk '{print $2}' | head -n1`
}
@ompugao
ompugao / buildpcl.sh
Created July 29, 2014 07:06
how to build pcl
git clone git://github.com/mariusmuja/flann.git
cd flann
mkdir build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
sudo checkinstall # to build deb package
git clone git://github.com/PointCloudLibrary/pcl
cd pcl
@ompugao
ompugao / notify.sh
Created July 30, 2014 13:43
build notification
function notify() {
if [ $? = 0 ] ; then
aplay $HOME/path/to/succeed.wav >/dev/null &
notify-send "成功しました!"
else
aplay $HOME/path/to/fail.wav >/dev/null &
notify-send "失敗しました..."
fi
}
from openravepy import *
from openravepy.databases import inversekinematics, inversereachability, grasping
import numpy
import time
manipname = 'leftarm'
numgrasps = 3
numrobotposresults = 2
transparency = 0.7
maxvelmult = 1.0
@ompugao
ompugao / flushtest.sh
Created January 31, 2015 14:59
output flush test
#!/bin/bash
while true; do
echo -ne " \( >o<)/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \( >o< )/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \(>o< )/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \(o< )/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \(< )/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \( )/ < うわぁー\\r\\n | | \\r"; sleep 0.07
echo -ne " \( >)/ < うわぁー\\r\\n | | \\r"; sleep 0.07
#/bin/bash
download_story()
{
local storynum=$1
local numimages=$2
echo mkdir -p $storynum
mkdir -p $storynum
for i in $(seq 1 $numimages) ; do
@ompugao
ompugao / git-submodule-fetch
Last active September 1, 2015 10:18 — forked from ianhinder/git-submodule-fetch
Parallel submodule fetch
#!/bin/bash
set -e
set -u
if [ $# -eq 0 ]; then
git submodule -q foreach 'echo $name' | xargs -n 1 -P 10 git-submodule-fetch
else
while [ $# -gt 0 ]; do
(cd $1; git fetch -q || echo "Failed to fetch $1">&2)
@ompugao
ompugao / fix_roszsh_completion.txt
Created September 19, 2015 01:21
fix roszsh completion
# /opt/ros/indigo/share/rosbash/roszsh
# https://github.com/ros/ros/issues/48
#catkin_package_libexec_dir=`catkin_find --without-underlays --libexec ${pkg} 2> /dev/null`
catkin_package_libexec_dir=`catkin_find --first-only --without-underlays --libexec ${pkg} 2> /dev/null`
@ompugao
ompugao / narry_ext.rb
Created March 25, 2012 02:45
NArray Extension
require 'narray'
class NArray
class << self
# borrows other dimension lengths from the first object and relies on it to
# raise errors (or not) upon concatenation.
def cat(dim=0,*narrays)
raise ArgumentError, "'dim' must be an integer (did you forget your dim arg?)" unless dim.is_a?(Integer)
raise ArgumentError, "must have narrays to cat" if narrays.size == 0
new_typecode = narrays.map(&:typecode).max