Skip to main content

Posts

Notes 20130505

'tc' and 'netem' allow you to simulate some network environments http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delay_distribution For example, I can delay every packet for 1s, such that in some case I can cheat in games. Google Chrome complains about "profile cannot be opened correctly": remove the 'web data' folder in the config dir http://www.fourleaftechnology.com/index.php/General/google-chrome-profile-could-not-be-opened-correctly-error.html To remove PDF password with gs http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf IE10 would ignore the `word-spacing` CSS rule if the width for the space char is 0, in a TTF font. Is it a bug of IE?

杂记 20130505

使用tc + netem可以模拟一些网络环境 http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delay_distribution 比如我可以让每个包都延迟1秒,某些情况下玩游戏还可以作弊 Google Chrome说Profile无法正确打开: 把配置目录里的'Web Data'目录干掉 http://www.fourleaftechnology.com/index.php/General/google-chrome-profile-could-not-be-opened-correctly-error.html 用gs去除PDF的密码: http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf IE10下如果TTF字体的空格宽度是0,就会无视word-spacing的css规则,不知道是不是IE的bug。

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 vund...

杂记 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 %

杂记 20120205 | Misc Notes 20120205

1. Javascript 图表库比较 Ext JS 各种模型比较折腾,画出来还不错。 flot,配合jQuery写着比较顺手,但是功能不够多,内置符号只有圆圈,加个插件发现图例中不能显示符号。logscale还有坐标的分点都要自己实现。。。 2.gnuplot编译时报错,libpng冲突 http://harvey.nu/compiling_gnuplot_on_mac_os_x_libpng_conflict.html 3.Excel中方向键不工作 按一下ScrollLock试试 http://www-cs-students.stanford.edu/~edlee/microsoft_excep_tip_1.html 4.Linux播放白噪音 http://dirk.net/2009/07/14/white-noise-generator-for-linux/ install sox play -n synth 60:00 whitenoise 1. A few JS libraries for plotting Ext JS, with rather complicated data models, but worthy. Produced figures look good. flot, a smooth coding experience with jQuery, but also lack of features. E.g. by default the only available symbol is circle. There are plugins available for extra symbols, but only in legend...Also I have to specify all the ticks... 2. libpng confliction when compiling gnuplot. http://harvey.nu/compiling_gnuplot_on_mac_os_x_libpng_conflict.html 3. Arrow keys not working in excel Try to press t...