lynx

Creating a static copy of a web page on UNIX commandline / shell script

☆樱花仙子☆ 提交于 2019-12-04 15:47:00
I need to create a static copy of a web page (all media resources, like CSS, images and JS included) in a shell script. This copy should be openable offline in any browser. Some browsers have a similar functionality (Save As... Web Page, complete) which create a folder from a page and rewrite external resources as relative static resources in this folder. What's a way to accomplish and automatize this on Linux command line to a given URL? You can use wget like this: wget --recursive --convert-links --domains=example.org http://www.example.org this command will recursively download any page

windows 下的 Cygwin 安装

我与影子孤独终老i 提交于 2019-12-03 15:07:39
Cygwin是一个在windows平台上运行的类UNIX模拟环境,是cygnus solutions公司开发的 自由软件 (该公司开发的著名工具还有eCos,不过现已被 Redhat 收购)。它对于学习UNIX/ Linux 操作环境,或者从UNIX到Windows的应用程序移植,或者进行某些特殊的开发工作,尤其是使用GNU工具集在Windows上进行 嵌入式系统开发 ,非常有用 1:下载cygwin http://www.cygwin.com/ 2:安装 一直默认下一步,这步是选择代理或者是直连,默认即可。 这步选择下载点,默认第一个就可以。有的是国内的可能下载速度快一下,根据自己情况选择 这一步选择安装的插件,一定要安装lynx (说明一下利用lynx,可以安装 apt-cyg ,利用apt-cyg就可以安装其他软件了),这里也可以安装其他的插件,例如wget,openssh等等。 3:安装完成,进入cygwin,安装 apt-cyg 1 : lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg 2 :install apt-cyg /bin 4:安装其他软件 apt-cyg install vim apt-cyg install openssh 其他操作和linux基本相同。 ps:

Script to Mobile-Friendly test

徘徊边缘 提交于 2019-12-03 00:48:13
I wanted to write a shell/python script which will check if a website is mobile friendly or not. Using browser this can be easily done by visiting- https://www.google.com/webmasters/tools/mobile-friendly/?url=<website_addr> For eg.- https://www.google.com/webmasters/tools/mobile-friendly/?url=http://facebook.com I tried fetching the content through curl, wget , lynx commands but it did not worked. How can I do so? Sanchit, I suggest you look at the requests library for retrieving the url. Also, as has already been said (I don't have experience with this api) you need to call ' https://www

Which CPAN module would you recommend for turning HTML into plain text?

半城伤御伤魂 提交于 2019-11-30 22:17:55
Which CPAN module would you recommend for turning HTML into formatted plain text? One strict requirement is that the module must handle Unicode characters. I like HTML::FormatText and HTML::FormatText::WithLinks See the example script htext that comes with HTML::Parser . 来源: https://stackoverflow.com/questions/1934638/which-cpan-module-would-you-recommend-for-turning-html-into-plain-text

Which CPAN module would you recommend for turning HTML into plain text?

老子叫甜甜 提交于 2019-11-30 05:44:55
问题 Which CPAN module would you recommend for turning HTML into formatted plain text? One strict requirement is that the module must handle Unicode characters. 回答1: I like HTML::FormatText and HTML::FormatText::WithLinks 回答2: See the example script htext that comes with HTML::Parser. 来源: https://stackoverflow.com/questions/1934638/which-cpan-module-would-you-recommend-for-turning-html-into-plain-text

关于 Windows XP 与 HTTPS 兼容的事情

好久不见. 提交于 2019-11-26 11:47:44
不兼容 SNI 的现象 众所周知,伟大的 Windows XP 对 Server Name Indication 的支持不好。表现为打不开某些 https 网页。 为了兼容性,需要关闭SNI以保证IE6能正常访问。这样的代价就是:需要更多的服务器资源(IP不可复用,资源不易复用)。 某些云厂商,开启SNI选项的情况下价格会更优惠、关闭SNI会有 额外收费 。 故障现象 Windows XP + IE6 无法打开 https 网页: 实际上缓解的办法在上图中已显示: 请单击工具菜单,然后单击 Internet 选项。在“高级”选项卡上,滚动到“安全”部分,复选 SSL 2.0、SSL 3.0、TLS 1.0、PCT 1.0 设置。 开启IE6的TLS支持后,重启浏览器。确认安全警告后,能正常打开如下: 但拿到的证书都是被第1个加载的证书,欣慰的时访问到的内容(vhost)是正确的: 测试方法 安装Nginx 以 Nginx 为例,测试 https 证书与 IE6 的兼容性 apt-get -y install nginx # yum -y install nginx 自制证书 SNI 允许一个 IP 指向多个证书,那么我们做两个域名使用两个证书。简要如下: openssl genrsa -des3 -out /etc/nginx/conf.d/s1.key 1024 openssl