Tag Archives: script

Bukkit定时重启bash脚本,GNU Screen走着

Bukkit服务器我一直用GNU Screen跑,隔两天有时候会不稳定要重启。好麻烦根本就不关心为什么,搞定就行。有bukkit插件可以实现但是咱多没自尊用那个。虽然感觉bash操作Screen也挺邋遢的.. 但是好用!其实不然的话怎么操作后台,nohup倒腾输入流什么的太麻烦了,这种用途还是terminal模拟器好看。


while (( $i < 5 ))
    if [ "`ps aux|grep -e '^bukkit'|grep SCREEN`" != "" ]; then
        su bukkit -c 'screen -S bukkit -X stuff 'stop`echo -ne '\015'`'' #`echo -ne '\015'` 等于敲下回车
        echo "`date` restart.sh:" 'Stoping bukkit...'
        sleep 5


if (( $i == 100 )); then
    echo "`date` restart.sh:" 'Bukkit was not running. Starting...'

if (( $i == 5 )); then
    kill `ps aux|grep bukkit|awk '{print $2}'`
    echo "`date` restart.sh:" 'Forcibly killing bukkit...'
    sleep 1

if [ "`ps aux|grep -e '^bukkit'|grep SCREEN`" != "" ]; then
    echo "`date` restart.sh:" "ERROR: Couldn't stop bukkit. Exiting."
    exit 1

bash /home/bukkit/start.sh

exit 0

Continue reading

把Kinect扫描的点云数据导入Maya | Import Kinect point cloud to Maya

I used Skanect to scan my room down. The .ply file generated is like this:

0.614557 -0.0194625 -0.305274 -0.127814 -0.551592 0.824263 100 113 96
0.614418 -0.019946 -0.305417 -0.127814 -0.551592 0.824263 98 111 96
0.61429 0.00103368 -0.303381 0.0386538 -0.603242 0.796621 104 107 95

Continue reading

Use Kinect LiDAR for camera matchmoving in PFTrack | 用Kinect的激光测距来帮助PFTrack的摄影机反求

So yea I got the idea becaues I wanted to deploy some close-up shots in my small project, but close-ups are always a pain to matchmove according to my experience. We know that this device’s resolution is quite limited, so does it work?

Couldn’t find anybody done the same thing using this low cost toy on Internet, or at least they didn’t post it. So here you go, the result turns out neat and I’m really happy with it. Notice at the end of the clip, the shot is pretty close and it worked fine. Video:

Continue reading