关于open flash chart(ofc)的几点总结

最近用了下open flash chart(以下简称ofc), 有几点总结,备忘 因为它的绘图使用的是json数据,所以没必要使用它的其它语言封装,自己输出json即可 使用ajax获取数据,然后更新ofc的图形($swf_element.load(‘json str’)),这个似乎有bug,会时不时的出错,原因不明 ...

May 17, 2010 · notsobad

python的SimpleHTTPServer

想快速的共享些文件给其他人? 用samba,或者简单的起个web server即可。 serv(){ ip=`ifconfig eth0 | sed -n 's/^\s*inet [^:]*://p' | awk '{print $1}'`; echo http://$ip:8000; python -m SimpleHTTPServer; } 加到~/.bashrc中,以后在需要的目录中运行serv 550 /tmp# serv http://10.16.22.1:8000 Serving HTTP on 0.0.0.0 port 8000 ... wang-desktop.local - - [04/Apr/2010 16:17:22] "GET / HTTP/1.1" 200 - wang-desktop.local - - [04/Apr/2010 16:17:22] "GET / HTTP/1.1" 200 - 然后访问把地址, 如“http://10.16.22.1:8000”发给其他人即可。 ...

April 4, 2010 · notsobad

windows下启动一个带有gui的程序

如何在调起一个命令,然后立即返回呢? linux下的好办。windows下怎么做呢?参考下面。 http://www.php.net/manual/en/function.exec.php function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } } windows下web.py中,想启动一个带gui的程序,或者想在一个新的cmd窗口中执行一个命令行程序,如何做呢? 启动带gui的程序: ...

March 19, 2010 · notsobad

virtualbox的虚拟机中使用usb口

virtualbox的虚拟机中使用usb口,我有手机、pda、阅读器需要同步,但是linux下没有对应的客户端,可以让虚拟机里的windows直接使用usb口。 方法请参考[这篇](http://news.softpedia.com/news/How-to-Fix-VirtualBox-USB- Support-111715.shtml)文章 主要的操作就是将当前用户添加到vboxusers这个组中。 处理后的结果: ...

February 9, 2010 · notsobad

php代码格式化工具

对于一些缩进不好的代码,可以利用这些工具来进行缩进美化下。 http://www.codeassembly.com/examples/beautifier.php http://www.beautifyphp.com/ 水木上有人传了sina微博泄漏代码,是个文本,全部都在一行里,没法看 我用sed处理了下, cat att.php\?s.261.77749.629.txt | iconv -f gb2312 -t utf8 | sed -e 's/;/;\n/g' -e 's#//#\n//#g' -e 's#\*/#\*/\n#g' -e 's/\}/\}\n/g' 然后再用http://www.codeassembly.com/examples/beautifier.php 格式化了下,基本能看了 ...

January 15, 2010 · notsobad

利用nmap来解析ip段

nmap支持很多中ip段的格式 ~$ nmap -n -sL 10.16.1-2.3-4 | awk '/Host/{print $2}' 10.16.1.3 10.16.1.4 10.16.2.3 10.16.2.4 ~$ nmap -n -sL 10.16.1-10.1 | awk '/Host/{print $2}' 10.16.1.1 10.16.2.1 10.16.3.1 10.16.4.1 10.16.5.1 10.16.6.1 10.16.7.1 10.16.8.1 10.16.9.1 10.16.10.1 -sL 列出扫描目标,不向目标发送数据,但是会做dns反向解析,可以加-n,去掉dns查询。 参考: -sL (List Scan) . The list scan is a degenerate form of host discovery that simply lists each host of the network(s) specified, without sending any packets to the target hosts. By default, Nmap still does reverse-DNS resolution on the hosts to learn their names. It is often surprising how much useful information simple hostnames give out. For example, fw.chi is the name of one company´s Chicago firewall. Nmap also reports the total number of IP addresses at the end. The list scan is a good sanity check to ensure that you have proper IP addresses for your targets. If the hosts sport domain names you do not recognize, it is worth investigating further to prevent scanning the wrong company´s network. Since the idea is to simply print a list of target hosts, options for higher level functionality such as port scanning, OS detection, or ping scanning cannot be combined with this. If you wish to disable ping scanning while still performing such higher level functionality, read up on the -PN option. ...

January 15, 2010 · notsobad

使用ffmpeg来进行屏幕录像

使用ffmpeg来进行屏幕录像 man里面的: X11 grabbing FFmpeg can grab the X11 display. ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg 0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg 0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10 is the x-offset and 20 the y-offset for the grabbing. 保存为a.avi ffmpeg -f x11grab -s 1024x768 -r 60 -i :0.0 a.avi 结束后q退出,效果还不错。

January 10, 2010 · notsobad

PHP curl_exec() url可被用户控制导致的漏洞

通常情况下curl被用来访问远程链接,并取回数据。但是curl支持很多协议。下面是一段php手册中关于curl的描述: PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. ...

January 8, 2010 · notsobad

vi的自动折行

vi的自动折行太贱了,写代码还好,我一个字符串很长,它也给我截断,字符串一截就给加了换行和tab 我忘了在哪里里配置的了,没办法,临时取消折行: set textwidth=99999

December 30, 2009 · notsobad

php中的allow_url_include

allow_url_include 如果打开,则可以include远程文件 这是个很古老的安全问题了,今天做了下实验,才意识到危害性。 以前一位include 只是取到静态html内容,把它原样输出,没想到它会对获取倒内容中的php代码进行解释执行,很危险。 机器a上: wang@wang-desktop:~/www$ cat inc.php EOF ?> 然后在另一台机器b上: ...

December 17, 2009 · notsobad