download them all 下载管理
adblock 取出广告
autopage 自动翻页
copy links 复制选择的链接
evernote clipper 不说
firebugs 调试网页
foxyproxy 多代理设置
google/yandex search link fix 去除google搜索时自己加的链接跳转
stylish() 自定义某些页面
在cygwin下如何转到D盘
cygwin cd dir:
cd /cygdrive/d
cd d:/
how to get rehdat version
[~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Client release 5.8 (Tikanga)
[~]$ cat /proc/version
Linux version 2.6.18-308.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc
version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Jan 27 17:17:51 EST 2012
download xiami songs with manual:
1. get you album url
http://www.xiami.com/song/showcollect/id/8031324
2. play your songs in xiami player
3. parse it with http://xmurl.sinaapp.com/
got the rename script & download path
4. download those path with downloadthemall
5. rename those filew with rename script
6. manual check the result and modify if there exist some file name is not
renamed
如何获得unix domain socket的对端PID
1. 什么是unix domain socket
http://en.wikipedia.org/wiki/Unix_domain_socket
2. 有两种方法,第一种是通过猜测,第二种是debug linux内核
第一种方法的示例:
[test@localhost ipc]$ /usr/sbin/lsof -p 31854
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
server 31854 test cwd DIR 0,26 4096 15746636 /home/test/workspace_ipc/ipc
server 31854 test rtd DIR 8,2 4096 2 /
server 31854 test txt REG 0,26 8702 15746641 /home/test/workspace_ipc/ipc/server
server 31854 test mem REG 8,2 144776 52035586 /lib64/ld-2.5.so
server 31854 test mem REG 8,2 1722328 52035588 /lib64/libc-2.5.so
server 31854 test 0u CHR 136,2 0t0 4 /dev/pts/2
server 31854 test 1u CHR 136,2 0t0 4 /dev/pts/2
server 31854 test 2u CHR 136,2 0t0 4 /dev/pts/2
server 31854 test 3u unix 0xffff8101c8d39180 0t0 650000043 ./socket
[test@localhost ipc]$ /usr/sbin/lsof -p 32028
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
client 32028 test cwd DIR 0,26 4096 15746636 /home/test/workspace_ipc/ipc
client 32028 test rtd DIR 8,2 4096 2 /
client 32028 test txt REG 0,26 8199 15746715 /home/test/workspace_ipc/ipc/client
client 32028 test mem REG 8,2 144776 52035586 /lib64/ld-2.5.so
client 32028 test mem REG 8,2 1722328 52035588 /lib64/libc-2.5.so
client 32028 test 0u CHR 136,2 0t0 4 /dev/pts/2
client 32028 test 1u CHR 136,2 0t0 4 /dev/pts/2
client 32028 test 2u CHR 136,2 0t0 4 /dev/pts/2
client 32028 test 3u unix 0xffff810010eaa080 0t0 650002435 socket
[test@localhost ipc]$ netstat -na | grep 65000
unix 2 [ ACC ] STREAM LISTENING 650000043 ./socket
unix 3 [ ] STREAM CONNECTED 650002215 ./socket
unix 3 [ ] STREAM CONNECTED 650002435
上例中是通过65000来grep的,这就是猜测。
第二种方法:
http://stackoverflow.com/questions/11897662/identify-other-end-of-a-unix-
domain-socket-connection
http://unix.stackexchange.com/questions/16300/whos-got-the-other-end-of-
this-unix-socketpair
不能直接获得对端的信息的原因是,因linux内核对user space是不可见的。
The number shown in /proc/$pid/fd/$fd
is the socket’s inode number in the
virtual socket filesystem. When you create a pipe or socket pair, each end
successively receives an inode number. The numbers are attributed
sequentially, so there is a high probability that the numbers differ by 1, but
this is not guaranteed (either because the first socket was _N_ and _N_ +1 was
already in use due to wrapping, or because some other thread was scheduled
between the two inode allocations and that thread created some inodes too).
将水电气的抄表动作自动化
1.做一个简单的嵌入式系统,它可以连到水电气的读表接口,再连到internet上,以便远程操作;
2.如果自来水公司想查看当前水表的度数,只需要远程点一个按钮,度数就会通过这个嵌入式系统返回给自来水公司;
然后自来水公司可以给客户发短息或者别的什么途径通知客户来缴费。
注:当然也可让设定嵌入式系统在特定时间内给自来水公司返回当前水表度数,自来水公司的系统自动计算费用然后
提示用户缴费。
为什么我的plugin不work了
查看eclipse的log。
如何查看呢?
eclipse -vm c:\jdks\java_1.4.2_06\jre\bin\java.exe -console -consoleLog
-debug -vmargs -Xmx384M
Gathering Information About Your Plug-in
http://www.eclipse.org/eclipse/platform-core/documents/3.1/debug.html
-debug options_file_full_path
if set to a non-null value, the platform is put in debug mode. If the value is
a string it is interpreted as the location of the .options file. This file
indicates what debug points
如果有debug,那么platform将进入debug模式。options_file_full_path是options文件的全路径。这个文件会给出哪些plugin的debug参数被设置成true,哪些debug参数
are available for a plug-in and whether or not they are enabled. If a location
is not specified, the platform searches for the .options file under the
install directory.
被设置成false。如果没有设置options_file_full_path,platform将在安装目录下面找.options文件。
-consolelog
if “true”, any log output is also sent to Java’s System.out (typically back to
the command shell if any). Handy when combined with -debug
如果设置了该参数,任何输出到log文件的log都会被输出到命令行。它和-debug参数一起使用很方便。
-console
if set to a non-null value, the OSGi console (if installed) is enabled. This
is handy for investigating the state of the system. If the value is a suitable
integer, it is interpreted
如果设置了该参数,OSGi的console会被打开(前提是OSG已经安装)。这个参数用来调查系统状态很好用。如果设置了端口好,
as the port on which the console listens and directs its output to the given
port. If the value is not a suitable integer (including the empty string) then
the console will listen
会监听这个端口,然后将输出重定向到给定的端口中去,如果没有指定端口
System.in and direct its output to System.out.
console将会在System.in上获得输入,然后在System.out上输出
将osgi中的所有debug参数设置成true的options文件:
#Master Tracing Options
#Fri Oct 19 15:59:34 CST 2012
org.eclipse.osgi/debug=true
org.eclipse.osgi/monitor/resources=true
org.eclipse.osgi/debug/messageBundles=true
org.eclipse.osgi/debug/objectPool/adds=true
org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver=true
org.eclipse.osgi/profile/debug=true
org.eclipse.osgi/debug/services=true
org.eclipse.osgi/resolver/generics=true
org.eclipse.osgi/eclipseadaptor/debug=true
org.eclipse.osgi/monitor/classes=true
org.eclipse.osgi/eclipseadaptor/debug/location=true
org.eclipse.osgi/eclipseadaptor/debug/cachedmanifest=true
org.eclipse.osgi/resolver/requires=true
org.eclipse.osgi/profile/startup=true
org.eclipse.osgi/monitor/activation=true
org.eclipse.osgi/resolver/cycles=true
org.eclipse.osgi/eclipseadaptor/converter/debug=true
org.eclipse.osgi/resolver/imports=true
org.eclipse.osgi/defaultprofile/logsynchronously=true
org.eclipse.osgi/resolver/wiring=true
org.eclipse.osgi/defaultprofile/logfilename=
org.eclipse.osgi/debug/startlevel=true
org.eclipse.osgi/defaultprofile/buffersize=256
org.eclipse.osgi/debug/manifest=true
org.eclipse.osgi/trace/activation=true
org.eclipse.osgi/debug/packageadmin=true
org.eclipse.osgi/debug/security=true
org.eclipse.osgi/trace/filename=runtime.traces
org.eclipse.osgi/resolver/debug=true
org.eclipse.osgi/resolver/uses=true
org.eclipse.osgi/trace/filters=trace.properties
org.eclipse.osgi/debug/objectPool/dups=true
org.eclipse.osgi/debug/bundleTime=true
org.eclipse.osgi/profile/impl=org.eclipse.osgi.internal.profile.DefaultProfileLogger
org.eclipse.osgi/debug/filter=true
org.eclipse.osgi/debug/loader=true
org.eclipse.osgi/debug/events=true
org.eclipse.osgi/trace/classLoading=true
org.eclipse.osgi/profile/benchmark=true
org.eclipse.osgi/eclipseadaptor/debug/platformadmin=true
如果想试一试-console
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.wlp.nd.doc%2Ftopics%2Ftwlp_setup_osgi_console.html
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fconsole_shell.htm
如何给自己的eclipse插件增加trace功能
在plugin根目录下建立一个.options文件,然后将自己的debug参数名字和默认值放入就可以了,
然后在eclipse的debug configuration对话框中的Tracing页,更改它们,启动eclipse就可以了。
http://ramblingabout.wordpress.com/2007/10/20/tracing-plug-ins-in-eclipse/
eclipse中的Menu,toolbar path
create a hello world plug-in in eclipse.
1. if you want to add a menu after “Edit” menu, change the path to “Edit”
2. if you do not want to set the menu location in eclipse main menu, just
leave it empty or set it to “additions”
3. if you want to add this action to “help/helpStart”, change the menubarPath
of “Sample Action” to “help/helpStart”
4. if you want to add this action to “file/import.ext”, change the
menubarPath of “Sample Action” to “file/import.ext”
5. if you want to add this action to debug action set in main toolbar, change
the the toolbarPath of “Sample Action” to
“org.eclipse.debug.ui.launchActionSet/debug”
then if you start the plugin, and try to drag debug action set, the “Sample
Action” will move with the debug action set
6. if you want to add this action to debug action set in main toolbar, change
the the toolbarPath of “Sample Action” to
“org.eclipse.debug.ui.launchActionSet/external”
then if you start the plugin, you will see the “Sample Action” and debug
action set seperated with a separeator,
try to drag debug action set, the “Sample Action” will move with the debug
action
7. if you want to add this action additions set in main toolbar, change the
the toolbarPath of “Sample Action” to “additions”
then if you start the plugin, and try to drag debug action set, the “Sample
Action” will not move with the debug action set
In one words:
A complete menu path is simply “menu name/group name.”
A complete toolbar path is simply “action set ID/toolbar group name.”
org.eclipse.ui.menus
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_cmd_menus.htm
Menu and toolbar paths
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_menupaths.htm
Eclipse Platform Extension Points
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-
points%2Findex.html