Archive for 02月, 2009

才知道还有EB 星期六, 02月 28th, 2009

1EB=1024PB, 1PB=1024TB
定义这么大干嘛的哦。

ansi2html html version 星期六, 02月 28th, 2009


 1 #!/bin/bash

 2

 3 # Convert ANSI (terminal) colour codes to HTML

 4 # Last Modify: eexpress @ 2009-02-27

 5 # Author:

 6 #    http://www.pixelbeat.org/docs/terminal_colours/

 7

 8 echo -n "

 9 <head>

10 <style type=\"text/css\">

11 /* linux console palette */

12 .f0 { color: #000000; }

13 .f1 { color: #FF0000; }

14 .f2 { color: #00AA00; }

15 .f3 { color: #E5E414; }

16 .f4 { color: #5B5BFC; }

17 .f5 { color: #FF00FF; }

18 .f6 { color: #01FEFD; }

19 .f7 { color: #AAAAAA; }

20 .bf0 { color: #555555; }

21 .bf1 { color: #FF5555; }

22 .bf2 { color: #55FF55; }

23 .bf3 { color: #FFFF55; }

24 .bf4 { color: #5555FF; }

25 .bf5 { color: #FF55FF; }

26 .bf6 { color: #55FFFF; }

27 .bf7 { color: #FFFFFF; }

28 .b0 { background-color: #000000; }

29 .b1 { background-color: #AA0000; }

30 .b2 { background-color: #00AA00; }

31 .b3 { background-color: #CDCD00; }

32 .b4 { background-color: #0000AA; }

33 .b5 { background-color: #AA00AA; }

34 .b6 { background-color: #00AAAA; }

35 .b7 { background-color: #E5E5E5; }

36 .bold { font-weight:bold; }

37 .normal { font-weight:normal; color: #AAAAAA; background-color: #000000; }

38 .reverse { background-color: #2A2A2A; }

39 .underline { text-decoration: underline; }

40 .line-through { text-decoration: line-through; }

41 .blink { text-decoration: blink; }

42 </style>

43 <title>xterm ansi color screenshot -> html</title>

44 </head>

45 <html>

46 <body bgcolor=\"#000000\" text=\"#ffffff\">

47 <pre>

48 "

49 #<meta content="charset=UTF-8">

50 #<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

51 #<meta http-equiv="content-type" content="text/html; charset=UTF-8">

52 p=[^]*\<

53 e=\>[^]*

54 echo <span>

55 sed s/\xef\xbf\xbf//g‘|\

56 sed s#\&#\&amp;#g; s#>#\&gt;#g; s#<#\&lt;#g‘|\

57 #sed ’s#\"#\&quot;#g; s#\ +#\&nbsp;#g’|\

58 sed s#\x1b\#[0-9]##g‘|\

59 #sed ’s#\x1b\[0m##g'|\

60 sed 's#\x1b\[\([0-9;]*\)m#\1#g‘|\

61 sed "s#${p}1${e}#& bold#g"|\

62 sed "s#${p}4${e}#& underline#g"|\

63 sed "s#${p}5${e}#& blink#g"|\

64 sed "s#${p}7${e}#& reverse#g"|\

65 sed "s#${p}9${e}#& line-through#g"|\

66 sed "s#${p}3\([0-7]\)${e}#& f\1#g"|\

67 sed "s#${p}4\([0-7]\)${e}#& b\1#g"|\

68 #sed "s#↗0↖##g"|\

69 sed "s#[0-9;\ ]\+#</span><span class=\"#g"|\

70 sed "s##\">#g"|\

71 #sed "s#^#</span><span class=\"normal\">#g"|\

72 tr -d "\r"|\

73 cat

74 echo </span>

75

76 echo "</pre>

77 </body>

78 </html>

79 "

ansi2html.bash 效果对比图 星期五, 02月 27th, 2009

ANSI 控制码 星期五, 02月 27th, 2009

echo -e “\e[xxx”
printf “\e[xxx”

[0m 关闭所有属性
[1m 设置高亮度
[4m 下划线
[5m 闪烁
[7m 反显
[8m 消隐
[30m — [37m 设置前景色
[40m — [47m 设置背景色
[nA 光标上移n行
[nB 光标下移n行
[nC 光标右移n行
[nD 光标左移n行
[y;xH设置光标位置 比调用tput好玩些。
[2J 清屏
[K 清除从光标到行尾的内容
[s 保存光标位置
[u 恢复光标位置
[?25l 隐藏光标
[?25h 显示光标

颜色代码:
        0 - 黑色     4 - 蓝色           
        1 - 红色     5 - 粉红色         
        2 - 绿色     6 - 青色
        3 - 黄色     7 - 白色           
任意位置的 1 是粗体和高亮度,0 是恢复缺省,7 是反显(鼠标选择的反显状态)。3x 是背景颜色,4x 是前景颜色。

ansi2html.bash 星期五, 02月 27th, 2009

☎ dog ansi2html.bash
echo -n "
<head>
<style type=\"text/css\">
/* linux console palette */
.f0 { color: #000000; }
.f1 { color: #AA0000; }
.f2 { color: #00AA00; }
.f3 { color: #E5E414; }
.f4 { color: #0000AA; }
.f5 { color: #FF00FF; }
.f6 { color: #01FEFD; }
.f7 { color: #AAAAAA; }
.bf0 { color: #555555; }
.bf1 { color: #FF5555; }
.bf2 { color: #55FF55; }
.bf3 { color: #FFFF55; }
.bf4 { color: #5555FF; }
.bf5 { color: #FF55FF; }
.bf6 { color: #55FFFF; }
.bf7 { color: #FFFFFF; }
.b0 { background-color: #000000; }
.b1 { background-color: #AA0000; }
.b2 { background-color: #00AA00; }
.b3 { background-color: #AA5500; }
.b4 { background-color: #0000AA; }
.b5 { background-color: #AA00AA; }
.b6 { background-color: #00AAAA; }
.b7 { background-color: #AAAAAA; }
.b { font-weight:bold; }
.n { font-weight:normal; color: #AAAAAA; background-color: #000000; }
.r { color: #000000; background-color: #AAAAAA; }
</style>
</head>
<html>
<body bgcolor=\"#000000\" text=\"#ffffff\">
<pre>
"
echo '<span>'
sed 's/\xef\xbf\xbf//g'|\
sed 's#\&#\&amp;#g; s#>#\&gt;#g; s#<#\&lt;#g'|\
sed 's#\x1b\#[0-9]##g'|\
sed 's#\x1b\[\([0-9;]*\)m#↗\1↖#g'|\
sed 's#\(↗[^↖]*\<1\>[^↖]*\)↖#\1 b↖#g'|\
sed 's#\(↗[^↖]*\<7\>[^↖]*\)↖#\1 r↖#g'|\
sed 's#\(↗[^↖]*\<3\([0-7]\)\>[^↖]*\)↖#\1 f\2↖#g'|\
sed 's#\(↗[^↖]*\<4\([0-7]\)\>[^↖]*\)↖#\1 b\2↖#g'|\
sed "s#↗[0-9;\ ]*#</span><span class=\"#g"|\
sed "s#↖#\">#g"|\
sed "s#^#</span><span class=\"n\">#g"|\
cat
echo '</span>'
echo "</pre>
</body>
</html>
"



桌面漫游热键增加一个提示 星期三, 02月 25th, 2009


 2 ########################

 3 # 开关鼠标穿越

 4 SetEnv scroll 1

 5 DestroyFunc toggle-scroll

 6 AddToFunc toggle-scroll

 7 + I Test (EnvMatch scroll 0) SetEnv scroll 1

 8 + I TestRc (NoMatch) SetEnv scroll 0

 9 + I TestRc (Match) Exec exec bash -c "export DISPLAY=:0 && notify-send -u critical -t 1000 -i /home/exp/媒体/●图标/png/Cubic\ Jaguar.png  桌面漫游 开启"

10 + I EdgeThickness $[scroll]

test 星期二, 02月 24th, 2009

:noremap <leader>sed :s/</\&lt;/g<CR>:s/>/\&gt;/g<CR>

rox缩略图。。 星期二, 02月 24th, 2009

~/.config/rox.sourceforge.net/ROX-Filer
☎ g thumb *
Options: <Option name=”display_show_thumbs”>1</Option>

不知道什么时候动了这个,改回来。

为blogtk添加一个code按钮 星期二, 02月 24th, 2009

/usr/share/blogtk
☎ g codeTool BloGTK.py
self.mainGlade.signal_autoconnect({'on_codeToolButton_clicked': self.insertTag_Code})
self.codeToolButton = self.mainGlade.get_widget('codeToolButton')
self.tooltips.set_tip(self.codeToolButton, "Add codegraph")
☎ g '<code' BloGTK.py
self.tagInsertionLogic(widget, "<code>", "</code>")
☎ g codeTool blogtk.glade
<widget class="GtkToolButton" id="codeToolButton">
<signal name="clicked" handler="on_codeToolButton_clicked"/>

其实是复制paraToolButton的就是。

转man成html 星期一, 02月 23rd, 2009

☎ man2html /usr/share/man/man1/hman.1.gz>t.html