Kev++

受够了蹩脚软件/网站(Tired of crappy software/website)!

Subscribe to RSS feed

已搬迁到http://hjkl.me

已搬迁到http://hjkl.me

使用tor匿名上网

首先安装tor
sudo apt-get install tor


然后向bridges@torproject.org发送一封,主题/内容均为"get bridges"的邮件。
稍等片刻后,torproject会回复一封邮件:
[This is an automated message; please do not reply.]

Here are your bridge relays:

 bridge 141.201.27.48:443
 bridge 62.75.185.238:9001
 bridge 83.163.124.123:9001


修改tor的配置文件/etc/tor/torrc, 在末尾添加:
Bridge 141.201.27.48:443
Bridge 62.75.185.238:9001
Bridge 83.163.124.123:9001
UseBridges 1


设置firefox上网代理
SOCKS Host: 127.0.0.1 Port: 9050 

使用vimwiki写日记

Vimwiki is a personal wiki for Vim -- a number of linked text files that have their own syntax highlighting.



使用gnuplot绘制直方/曲线图

,

shell脚本
#!/usr/bin/env bash

xmlstarlet fo -H -R -Q http://stackexchange.com/leagues/1/alltime/stackoverflow |
    xmlstarlet sel -H -t -m '//div[h3[.="Total Reputation"]]//tr' -v 'concat(td[1], " ", td[2])' -n |
        tr -d '[+,]' |
            sed -r '/^\s*$/d' |
                awk 'NR==1{x=$2;print;next};{print $1,$2-x; x=$2}' |
                    column -t > rep.txt

gnuplot -p <<-EOF
    set term    png
    set output  'rep1.png'
    set title   'Total Reputation (from StackOverflow.com)'
    set style   data hist
    set xtics   rotate by 45
    set xtics   out offset 0,-1
    set log     y
    plot '<(tac rep.txt)' u 2:xticlabel(1) not
EOF

gnuplot -p <<-EOF
    set term    png
    set output  'rep2.png'
    set title   'Total Reputation (from StackOverflow.com)'
    set xtics   rotate by 45
    set xtics   out offset 0,-1.5
    set log     y
    plot '<(tac rep.txt)' u 2:xticlabel(1) s bezier w filledcurve above y1=0 fs pattern 2 lc rgb 'purple' not
EOF

文本输出
100000  56
50000   141
25000   413
10000   1728
5000    2902
3000    3931
2000    4720
1000    12633
500     20183
200     31343
1       867844

图片输出

小狗与小猫

boxes draws any kind of boxes around your text!


$ banner hello | boxes -d dog -a c
             __   _,--="=--,_   __
            /  \."    .-.    "./  \
           /  ,/  _   : :   _  \/` \
           \  `| /o\  :_:  /o\ |\__/
            `-'| :="~` _ `~"=: |
               \`     (_)     `/
        .-"-.   \      |      /   .-"-.
 .-----{     }--|  /,.-'-.,\  |--{     }----.
  )    (_)_)_)  \_/`~-===-~`\_/  (_(_(_)   (
 (                                          )
  ) #    #  ######  #       #        ####  (
 (  #    #  #       #       #       #    #  )
  ) ######  #####   #       #       #    # (
 (  #    #  #       #       #       #    #  )
  ) #    #  #       #       #       #    # (
 (  #    #  ######  ######  ######   ####   )
  )                                        (
 '------------------------------------------'

$ banner world | boxes -d cat -a c
               /\             /\
              |`\\_,--="=--,_//`|
              \ ."  :'. .':  ". /
             ==)  _ :  '  : _  (==
               |>/O\   _   /O\<|
               | \-"~` _ `~"-/ |
              >|`===. \_/ .===`|<
        .-"-.   \==='  |  '===/   .-"-.
 .-----{'. '`}---\,  .-'-.  ,/---{.'. '}----.
  )    `"---"`     `~-===-~`     `"---"`   (
 (                                          )
  ) #    #   ####   #####   #       #####  (
 (  #    #  #    #  #    #  #       #    #  )
  ) #    #  #    #  #    #  #       #    # (
 (  # ## #  #    #  #####   #       #    #  )
  ) ##  ##  #    #  #   #   #       #    # (
 (  #    #   ####   #    #  ######  #####   )
  )                                        (
 '------------------------------------------'

image2ascii

curl -s http://people.mozilla.com/~faaborg/files/shiretoko/firefoxIcon/firefox-64.png |
  convert - jpg:- |
    jp2a --color --html -> firefox.html


不愿透露姓名的群众

,

YouTube虽是Google旗下的网站,群众依然有权当着Google的面,对其批斗。
来自于YouTube的订阅邮件,光荣地进入了Gmail“垃圾邮件”箱。
这才是群众所需要的<审查>! 我是一位不愿透露姓名的群众!
YouTube noreply@youtube.com	
to me

Be careful with this message. Many people marked similar messages as spam.
Learn more...

隐藏firefox右击菜单项

/*
 * Path:        %AppData%\Mozilla\Firefox\Profiles\*.default\chrome\userChrome.css
 * Reference:   http://kb.mozillazine.org/UserChrome.css_Element_Names/IDs
 */
#context-selectall ,
#context-openlink,
#context-bookmarklink,
#context-bookmarkpage,
#context-savepage,
#context-sendpage,
#context-sendlink,
#context-sendimage,
#context-setWallpaper,
#context-setDesktopBackground,
#context-sep-viewbgimage {
    display: none;
}

改用Notepad++查看firefox页面源代码

#1 修改about:config
  • 在地址栏内输入: about:config, 按回车键
  • 接受弹出的警告对话框, 将会打开一个配置列表页面
  • 在筛选栏中输入: view_source
  • 双击view_source.editor.external, 把值改为true
  • 双击view_source.editor.path, 把值改为C:\Program Files\Notepad++\notepad++.exe


#2 修改prefs.js
  • 首先关闭firefox
  • 打开文件%AppData%\Mozilla\Firefox\Profiles\*.default\prefs.js
  • 添加下面两行:
    user_pref("view_source.editor.external", true);
    user_pref("view_source.editor.path", "C:\\Program Files\\Notepad++\\notepad++.exe");
    


参考: http://support.mozilla.org/en-US/questions/757430

子曰: 你是乌龟吗?

,

cowsay fortune toilet



Install
sudo apt-get install fortune-mod figlet toilet cowsay


Whatis
  • fortune - print a random, hopefully interesting, adage
  • figlet-toilet - display large colourful characters
  • cowsay - configurable speaking/thinking cow (and a bit more)


#子曰
fortune -s -n 42 |
    toilet -w $(($(tput cols)-5)) -f pagga |
        cowsay -n -f beavis.zen
 ________________________________________________________________
/ ░█▀█░█▀▄░█▀▀░░░█░█░█▀█░█░█░░░█▀█░░░▀█▀░█░█░█▀▄░▀█▀░█░░░█▀▀░▀▀█ \
| ░█▀█░█▀▄░█▀▀░░░░█░░█░█░█░█░░░█▀█░░░░█░░█░█░█▀▄░░█░░█░░░█▀▀░░▀░ |
\ ░▀░▀░▀░▀░▀▀▀░░░░▀░░▀▀▀░▀▀▀░░░▀░▀░░░░▀░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░ /
 ----------------------------------------------------------------
   \         __------~~-,
    \      ,'            ,
          /               \
         /                :
        |                  '
        |                  |
        |                  |
         |   _--           |
         _| =-.     .-.   ||
         o|/o/       _.   |
         /  ~          \ |
       (____@)  ___~    |
          |_===~~~.`    |
       _______.--~     |
       \________       |
                \      |
              __/-___-- -__
             /            _ \