首页 文章 精选 留言 我的

精选列表

搜索[web],共10015篇文章
优秀的个人博客,低调大师

WebVM —— Web 虚拟机

WebVM是一个在浏览器中运行的 Linux 虚拟机。 WebVM 是一个无服务器的虚拟环境,完全运行在 HTML5/WebAssembly 客户端中,旨在与 Linux ABI 兼容。它运行未经修改的 Debian 发行版,包括许多本地开发工具链。 WebVM 由 CheerpX 虚拟化引擎提供支持,并支持在任何浏览器上安全、沙盒化的客户端执行 x86 二进制文件。CheerpX 包括一个 x86-to-WebAssembly JIT 编译器、一个基于虚拟块的文件系统和一个 Linux 系统调用模拟器。 一般用法 访问https://webvm.io 使用提供的终端环境 玩得开心! 启用网络 访问https://webvm.io 点击右上角的“Tailscale Login” 登录 Tailscale(如果没有,请创建一个帐户) 如果想访问公共互联网,你需要一个出口节点。请参阅此处了解如何设置。如果只想访问 Tailscale 网络中的一台机器,则不需要 根据网络速度,可能需要等待片刻才能下载 Tailscale Wasm 模块 使用 Tailscale 凭据登录 返回 WebVM 选项卡,将在右上角看到您的 IP 地址 开始触发网络请求! 如何使用授权密钥登录 Tailscale 在网址末尾添加#authKey=<your-key> 完成,不再需要手动登录 建议使用临时密钥。 如何登录到自托管的 Tailscale 网络 (Headscale) 在网址末尾添加#controlUrl=<your-control-url> 可以将此选项与authKey和&结合使用:#controlUrl=<url>&authKey=<key> 如何在本地托管 WebVM 将 index.html 和 tinycore.html 中的CX_VERSION替换为有效版本的 CheerpX。最新版本可以在https://webvm.io找到 运行 nginx -p 。 -c nginx.conf 在 WebVM 目录的根目录中。然后可以在http://localhost:8081找到 WebVM

优秀的个人博客,低调大师

1、web爬虫,requests请求

【转载自:https://www.jianshu.com/u/3fe4aab60ac4】requests请求,就是用python的requests模块模拟浏览器请求,返回html源码 模拟浏览器请求有两种,一种是不需要用户登录或者验证的请求,一种是需要用户登录或者验证的请求 一、不需要用户登录或者验证的请求 这种比较简单,直接利用requests模块发一个请求即可拿到html源码 #!/usr/bin/envpython #-*-coding:utf8-*- importrequests#导入模拟浏览器请求模块 http=requests.get(url="http://www.iqiyi.com/")#发送http请求 http.encoding="utf-8"#http请求编码 neir=http.text#获取http字符串代码 print(neir) 得到html源码 <!DOCTYPEhtml> <html> <head> <title>抽屉新热榜-聚合每日热门、搞笑、有趣资讯</title> <metacharset="utf-8"/> <metaname="keywords"content="抽屉新热榜,资讯,段子,图片,公众场合不宜,科技,新闻,节操,搞笑"/> <metaname="description"content=" 抽屉新热榜,汇聚每日搞笑段子、热门图片、有趣新闻。它将微博、门户、社区、bbs、社交网站等海量内容聚合在一起,通过用户推荐生成最热榜单。看抽屉新热榜,每日热门、有趣资讯尽收眼底。 "/> <metaname="robots"content="index,follow"/> <metaname="GOOGLEBOT"content="index,follow"/> <metaname="Author"content="搞笑"/> <metahttp-equiv="X-UA-Compatible"content="IE=EmulateIE8"> <linktype="image/x-icon"href="/images/chouti.ico"rel="icon"/> <linktype="image/x-icon"href="/images/chouti.ico"rel="ShortcutIcon"/> <linktype="image/x-icon"href="/images/chouti.ico"rel="bookmark"/> <linktype="application/opensearchdescription+xml" href="opensearch.xml"title="抽屉新热榜"rel="search"/> 二、需要用户登录或者验证的请求 获取这种页面时,我们首先要了解整个登录过程,一般登录过程是,当用户第一次访问时,会自动在浏览器生成cookie文件,当用户输入登录信息后会携带着生成的cookie文件,如果登录信息正确会给这个cookie 授权,授权后以后访问需要登录的页面时携带授权后cookie即可 1、首先访问一下首页,然后查看是否有自动生成cookie #!/usr/bin/envpython #-*-coding:utf8-*- importrequests#导入模拟浏览器请求模块 ###1、在没登录之前访问一下首页,获取cookie i1=requests.get( url="http://dig.chouti.com/", headers={'Referer':'http://dig.chouti.com/'} ) i1.encoding="utf-8"#http请求编码 i1_cookie=i1.cookies.get_dict() print(i1_cookie)#返回获取到的cookie #返回:{'JSESSIONID':'aaaTztKP-KaGLbX-T6R0v','gpsd':'c227f059746c839a28ab136060fe6ebe','route':'f8b4f4a95eeeb2efcff5fd5e417b8319'} 可以看到生成了cookie,说明如果登陆信息正确,后台会给这里的cookie授权,以后访问需要登录的页面携带授权后的cookie即可 2、让程序自动去登录授权cookie 首先我们用浏览器访问登录页面,随便乱输入一下登录密码和账号,获取登录页面url,和登录所需要的字段 携带cookie登录授权 #!/usr/bin/envpython #-*-coding:utf8-*- importrequests#导入模拟浏览器请求模块 ###1、在没登录之前访问一下首页,获取cookie i1=requests.get( url="http://dig.chouti.com/", headers={'Referer':'http://dig.chouti.com/'} ) i1.encoding="utf-8"#http请求编码 i1_cookie=i1.cookies.get_dict() print(i1_cookie)#返回获取到的cookie #返回:{'JSESSIONID':'aaaTztKP-KaGLbX-T6R0v','gpsd':'c227f059746c839a28ab136060fe6ebe','route':'f8b4f4a95eeeb2efcff5fd5e417b8319'} ###2、用户登陆,携带上一次的cookie,后台对cookie中的随机字符进行授权 i2=requests.post( url="http://dig.chouti.com/login",#登录url data={#登录字段 'phone':"8615284816568", 'password':"279819", 'oneMonth':"" }, headers={'Referer':'http://dig.chouti.com/'}, cookies=i1_cookie#携带cookie ) i2.encoding="utf-8" dluxxi=i2.text print(dluxxi)#查看登录后服务器的响应 #返回:{"result":{"code":"9999","message":"","data":{"complateReg":"0","destJid":"cdu_50072007463"}}}登录成功 3、登录成功后,说明后台已经给cookie授权,这样我们访问需要登录的页面时,携带这个cookie即可,比如获取个人中心 #!/usr/bin/envpython #-*-coding:utf8-*- importrequests#导入模拟浏览器请求模块 ###1、在没登录之前访问一下首页,获取cookie i1=requests.get( url="http://dig.chouti.com/", headers={'Referer':'http://dig.chouti.com/'} ) i1.encoding="utf-8"#http请求编码 i1_cookie=i1.cookies.get_dict() print(i1_cookie)#返回获取到的cookie #返回:{'JSESSIONID':'aaaTztKP-KaGLbX-T6R0v','gpsd':'c227f059746c839a28ab136060fe6ebe','route':'f8b4f4a95eeeb2efcff5fd5e417b8319'} ###2、用户登陆,携带上一次的cookie,后台对cookie中的随机字符进行授权 i2=requests.post( url="http://dig.chouti.com/login",#登录url data={#登录字段 'phone':"8615284816568", 'password':"279819", 'oneMonth':"" }, headers={'Referer':'http://dig.chouti.com/'}, cookies=i1_cookie#携带cookie ) i2.encoding="utf-8" dluxxi=i2.text print(dluxxi)#查看登录后服务器的响应 #返回:{"result":{"code":"9999","message":"","data":{"complateReg":"0","destJid":"cdu_50072007463"}}}登录成功 ###3、访问需要登录才能查看的页面,携带着授权后的cookie访问 shouquan_cookie=i1_cookie i3=requests.get( url="http://dig.chouti.com/user/link/saved/1", headers={'Referer':'http://dig.chouti.com/'}, cookies=shouquan_cookie#携带着授权后的cookie访问 ) i3.encoding="utf-8" print(i3.text)#查看需要登录才能查看的页面 获取需要登录页面的html源码成功 全部代码 get()方法,发送get请求encoding属性,设置请求编码cookies.get_dict()获取cookiespost()发送post请求text获取服务器响应信息 #!/usr/bin/envpython #-*-coding:utf8-*- importrequests#导入模拟浏览器请求模块 ###1、在没登录之前访问一下首页,获取cookie i1=requests.get( url="http://dig.chouti.com/", headers={'Referer':'http://dig.chouti.com/'} ) i1.encoding="utf-8"#http请求编码 i1_cookie=i1.cookies.get_dict() print(i1_cookie)#返回获取到的cookie #返回:{'JSESSIONID':'aaaTztKP-KaGLbX-T6R0v','gpsd':'c227f059746c839a28ab136060fe6ebe','route':'f8b4f4a95eeeb2efcff5fd5e417b8319'} ###2、用户登陆,携带上一次的cookie,后台对cookie中的随机字符进行授权 i2=requests.post( url="http://dig.chouti.com/login",#登录url data={#登录字段 'phone':"8615284816568", 'password':"279819", 'oneMonth':"" }, headers={'Referer':'http://dig.chouti.com/'}, cookies=i1_cookie#携带cookie ) i2.encoding="utf-8" dluxxi=i2.text print(dluxxi)#查看登录后服务器的响应 #返回:{"result":{"code":"9999","message":"","data":{"complateReg":"0","destJid":"cdu_50072007463"}}}登录成功 ###3、访问需要登录才能查看的页面,携带着授权后的cookie访问 shouquan_cookie=i1_cookie i3=requests.get( url="http://dig.chouti.com/user/link/saved/1", headers={'Referer':'http://dig.chouti.com/'}, cookies=shouquan_cookie#携带着授权后的cookie访问 ) i3.encoding="utf-8" print(i3.text)#查看需要登录才能查看的页面 注意:如果登录需要验证码,那就需要做图像处理,根据验证码图片,识别出验证码,将验证码写入登录字段

优秀的个人博客,低调大师

Web page

目录 4. gulpjs 4.1. Tasks automation 4.1.1. gulp-changed 4.1.2. 显示处理进度 4.1.3. notify 4.1.4. del 4.1.5. start 4.2. watch 4.3. HTML Minification 4.4. CSS Minification 4.4.1. gulp-minify-css 4.4.2. gulp-clean-css 4.4.3. gulp-make-css-url-version 4.4.4. CSS 冗余分析 4.5. JS Minification 4.5.1. JS 校验 4.6. CSS Sprite 4.7. Compress Images 4.8. WEBP格式图片 4.9. Sass Compilation 4.10. Less Compilation 4.11. 重命名文件名 4.12. 合并文件 4.13. 文件头 4.14. yargs 命令行参数传递 4.14.1. gulp-util 4.14.2. minimist 4.15. gulp-sourcemaps 4.16. gulp-zip 4.17. 清理JS中的console.log()调试语句 4.18. copy-dir 4.19. gulp-copy 4.20. 4.21. Example 4.21.1. HTML,JS,CSS 4.21.2. 命令行传递参数 5. webpack 6. minifier 7. CSS Frameworks 7.1. 浏览器判断 7.2. Sass: Syntactically Awesome Style Sheets 7.2.1. 7.3. Less 7.4. css 冗余/废弃样式检查 9. HTML 9.1. iPhone WebApp 9.1.1. 拨打电话 9.1.2. iphone 图标设置 9.2. frame 10. HTML5 10.1. header 10.2. article 11. Javascript 11.1. window 11.1.1. window.location 11.2. navigator 11.2.1. userAgent 11.3. document 11.3.1. referrer 11.3.2. domain 11.4. String 字符串处理 11.4.1. JSON.parse 11.4.2. replace 替换 11.5. Date and Time 11.6. from 表单相关事件 11.6.1. onblur 11.7. 禁止复制与鼠标右键 11.8. DOMDocument 11.8.1. createTextNode 11.9. Microsoft.XMLHTTP 11.9.1. Get 11.9.2. POST 11.10. jQuery 11.10.1. Selectors(选择器) 11.10.2. jQuery 属性操作 11.10.2.1. is 11.10.2.2. css 11.10.3. 时间触发 11.10.3.1. setTimeout 定时执行一次 11.10.3.2. setInterval 间隔执行 11.10.4. text 11.10.5. inArray 11.10.6. Ajax 11.10.6.1. Load 11.10.6.2. GET 11.10.6.3. Post 11.10.6.4. jsonp 11.10.6.5. No 'Access-Control-Allow-Origin' header is present on the requested resource. 11.10.6.6. 同步 AJAX 11.10.7. Form 表单处理 11.10.7.1. select 11.10.7.2. input 11.10.8. Jquery 事件 11.10.8.1. click 事件 11.10.9. Garlic.js - 表单数据持久化 11.11. Bootstrap 11.12. ActiveWidgets - WebUI 11.13. Highslide 11.14. JavaScript 代码混淆 11.14.1. JavaScript Packer 11.15. phantomjs - headless WebKit with JavaScript API 11.16. Javascript MVC Frameworks 11.16.1. Backbone 11.16.2. example 12. SSI 12.1. SSI 环境变量 12.1.1. QUERY_STRING GET参数传递 12.1.2. SERVER_NAME 与 HTTP_HOST 12.2. set 12.3. echo 12.4. 包含网页 12.5. if 条件判断 12.6. FAQ 常见问题 12.6.1. SERVER_NAME 与 HTTP_HOST 有什么不同? 13. Theme & UI 13.1. bootstrap 14. 3rd party 14.1. Share Buttons 14.2. discussions 14.3. Highlight 14.3.1. SyntaxHighlighter 14.3.2. highlight.js 14.4. 所见即所得现在编辑工具 14.4.1. FCKeditor 14.4.2. NicEdit 14.4.3. TinyMCE 14.4.4. WYSIWYG 14.4.5. Quill 15. Div+CSS页面设计 15.1. 页面元素命名 15.2. XHTML+DIV+CSS 15.3. 页面结构设计 15.3.1. Home page (首页) 15.3.2. 导航烂 15.3.3. Left Bar 15.3.4. 区块设计 Block 15.4. 表格 15.5. 图片优化 15.5.1. onMouseOver/onMouseOut 15.5.2. 使用一幅图片处理BLOCK四角 15.5.3. 图片用背景图代替 img 标记 15.5.4. 合并图片 15.6. HTML嵌入图片 15.7. 页面内容安全 15.7.1. 禁止鼠标右键 15.7.2. 禁止复制剪切 及粘贴 15.8. html,css 有效性检查 Validation 15.9. 自适应宽度超出截取并显示省略字符 16. Angular 16.1. Function 16.1.1. 16.1.2. ng-bind 原文出处:Netkiller 系列 手札 本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

优秀的个人博客,低调大师

第 24 章 Web Server

目录 24.1. Apache httpd 24.1.1. Install 24.1.2. Uninstall 24.1.3. Configure 24.1.3.1. Apache 24.1.3.2. MySQL 24.1.4. Starting 24.1.5. FAQ 24.1.5.1. compile php 24.2. Nginx 24.2.1. install nginx 24.2.1.1. spawn-fcgi script 24.2.1.2. php-fpm 24.2.1.3. fastcgi backend 24.1.Apache httpd [root@development httpd-2.2.14]# yum install zlib-devel.x86_64 ./configure --prefix=/usr/local/httpd-2.2.14 \ --with-mpm=worker \ --enable-so \ --enable-mods-shared=all \ --enable-static-support \ --enable-static-htpasswd \ --enable-static-htdigest \ --enable-static-ab \ --disable-include \ --disable-actions \ --disable-alias \ --disable-asis \ --disable-autoindex \ --disable-auth_basic \ --disable-authn_file \ --disable-authn_default \ --disable-authz_groupfile \ --disable-authz_user \ --disable-authz_default \ --disable-cgi \ --disable-cgid \ --disable-env \ --disable-negotiation \ --disable-status \ --disable-userdir 24.1.1.Install Apache [root@development ~]# yum -y install httpd PHP [root@development ~]# yum -y install php [root@development ~]# yum -y install php-mysql php-gd php-mbstring php-bcmath [neo@development ~]$ sudo yum -y install php-pecl-memcache mysql [root@development ~]# yum -y install mysql-server 24.1.2.Uninstall # yum remove httpd 24.1.3.Configure 24.1.3.1.Apache 24.1.3.1.1.VirtualHost [root@development ~]# vim /etc/httpd/conf.d/vhost.conf # # Use name-based virtual hosting. # NameVirtualHost *:80 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. # # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot /www/docs/dummy-host.example.com ServerName dummy-host.example.com ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> 24.1.3.2.MySQL reset mysql's password [root@development ~]# /usr/bin/mysqladmin -u root password 'new-password' [root@development ~]# /usr/bin/mysqladmin -u root -h development.domain.org password 'new-password' Alternatively you can run: [root@development ~]# /usr/bin/mysql_secure_installation 24.1.4.Starting levels [root@development ~]# chkconfig --list mysqld mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@development ~]# chkconfig --list httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@development ~]# chkconfig httpd on [root@development ~]# chkconfig --list httpd httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@development ~]# chkconfig mysqld on [root@development ~]# chkconfig --list mysqld mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off Apache [root@development ~]# service httpd start MySQL [root@development ~]# service mysqld start [root@development ~]# netstat -nat | grep 80 tcp 0 0 :::80 :::* LISTEN [root@development ~]# netstat -nat | grep 3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 24.1.5.FAQ 24.1.5.1.compile php [root@development php-5.3.0]# yum install libxml2-devel [root@development php-5.3.0]# yum install curl-devel [root@development php-5.3.0]# yum install gd-devel [root@development php-5.3.0]# yum install libjpeg-devel [root@development php-5.3.0]# yum install libpng-devel [root@development php-5.3.0]# yum install openldap-devel [root@development php-5.3.0]# yum install mysql-devel [root@development php-5.3.0]# yum install net-snmp-devel Please enable JavaScript to view the &lt;a href="http://disqus.com/?ref_noscript"&gt;comments powered by Disqus.&lt;/a&gt;comments powered by Disqus 原文出处:Netkiller 系列 手札 本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册