2013-04-01

Misc 20130401

  • To reset all shortcut definitions in evince, run
    rm ~/.config/evince/accels
  • GCC would complain if you define a variable without actually using it. To silience it, use
    (void)var;
  • DNS is not working in VirtualBox: Run
    VBoxManage modifyvm "VM name" --natdnshostresolver1 on
    Ref 
  • A useful link talking about ravlue reference in C++11 http://thbecker.net/articles/rvalue_references/section_01.html 
  • To clear disk cache in Linux: Run
    sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
    Ref
  •  "screen-256color not found": Run
    infocmp xterm-256color > screen-256color.ti
    on a machine without this error, copy the file to the target machine and then run
    tic screen-256color.ti
    Ref
  • Just switch to fcitx from ibus. I like a theme called 'anran'. If fcitx cannot follow the cursor on Firefox, turn on preedit, as said in the official wiki.
  • Just played with a vim plugin called youcompleteme, for C++ autocomplete, which is quite powerful. Also I installed vundle, a vim plugin manager.
  • To update vimrc just after some modification, run
    so %

杂记 20130401

  • 之前evince的快捷键乱套了,使用
    rm ~/.config/evince/accels
    复位
  • 定义了变量var又不用的话,gcc会报warning"unused variable",解法是
    (void)var;
  • VirtualBox中DNS不工作:运行
    VBoxManage modifyvm "VM name" --natdnshostresolver1 on
    Ref 
  • 一个讲c++11右值引用的link:http://thbecker.net/articles/rvalue_references/section_01.html 
  • Linux清除disk cache:
    sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' 
    Ref
  •  遇到错误screen-256color not found需要支持新的终端类型:找一台支持screen-256color的机器执行
    infocmp xterm-256color > screen-256color.ti
    把文件拷贝到目标机器后执行
    tic screen-256color.ti
    Ref
  •  最近从ibus换到了fcitx,起初是由于sogou发布了,不过后来还是卸掉了。anran主题不错。fcitx在firefox中光标跟随有点问题,按官方wiki说法打开preedit后就没事了。
  •  最近在vim里折腾youcompleteme这个补全插件,挺好用。顺便也装了vundle来管理插件,很不错
  •  vim更新.vimrc后想直接应用,执行
    so %