作者归档:John

简单又暴力的单文件php web代理

不多说,适合有自己环境的情况,至少要有虚拟主机,环境只要求php,7.x测试通过,老版本没试

https://github.com/heiswayi/web-proxy-script

亮点:

1.单文件,无配置,不需要数据库,上传即可使用

2.支持很暴力的伪静态类似访问,例如要用代理访问油管:

https://your.domain.name/proxy/script.php 后面直接加上/youguan.com,像这样就可以了:

https://your.domain.name/proxy/script.php/youguan.com

3.支持访问一切内容,包括下载、ajax等等

非常适合偶尔需要爬墙下个文件什么的,这次更新dropbox就刚好用到,顺便给个dropbox完整版直接下载地址:

https://www.dropbox.com/download?full=1&plat=win,可以丢到地址栏敲回车,就可以等下载完成了

用htaccess和http验证保护敏感目录

WordPress的wp-admin目录是个很明显的攻击点,加上一层http authentication可以在web server层面干掉绝大部分scripting bot/boy,特别是脚本工具,几乎都不支持http验证,因为实在是太罕见了,同时也可以多提供一个安全层,哪怕后面的程序用admin/12345都没关系

非常简单:

在需要保护的目录下,运行:

htpasswd -c name_of_password_file name_of_user,接下来输入两次密码,就会创建一个用户名/密码文件

为了提高安全性,再改个名:mv name_of_password_file #unable_to_download_name,加上#在文件名里可以有效阻止意外下载

在目录下新建.htaccess

内容如下:

AuthName “Login Required” #(可以写的更凶猛一点,随意发挥)
AuthType Basic
AuthUserFile /full/path/to/password/file #(刚才创建的用户名密码文件的完整路径)
AuthGroupFile /dev/null
require valid-user
Options -Indexes #(顺手禁止目录浏览)

 

保存,完工,下次访问目录就需要验证了

 

Unable to connect to shared printer with error code 0x00000024b

For some unknown reason (maybe system architecture difference, say you are trying to connect to a 32-bit OS shared printer with a 64-bit client) you may get this error code, here is a trick to save your life.

  1. Make sure you have saved credentials for that shared printer, simplest way to this is type \\IP_ADDRESS or \\Machine_Name of that host, enter and save credentials if you are not in AD.
  2. Add a local printer for same type and driver version you are trying to connect to, use LPTx or COMx as port number when required, atfer installation, you should have a printer in you Control Panel> Devices and Printers.
  3. Type \\IP_ADDRESS or \\Machine_Name of print host machine, and another backslash \ then you will get a dropdown list showing all resources on that host, use downwards arrow on your keyboard to navigate to the printer you are tring to connect. select full path in address bar and copy it like this:
  4. Navigate to Control Panel> Devices and Printers, open Printer Properties of that new printer you have just installed locally, in tab Port, click Add Port, then add a *LOCAL PORT*, in name box, paste full path to that printer you have copied then click Apply or OK all the way. 
  5. You are saved.

 

连接共享打印机提示:windows无法连接到打印机 0x00000024b

64位win10连32位win10下共享出来的打印机,死活连不上,一直报错,百度、bing甚至google都没找到任何有效信息,后来想起来很多年前用过的一个trick,方法如下:

先在资源管理器(如我的电脑之类的窗口)中,连接到相应的电脑,敲\\IP或者机器名,并保存用户名密码(记住凭据),域环境请无视

确保能显示对应机器的资源后,回到控制面板>设备和打印机>添加打印机

自行下载相应添加的打印机的驱动并按照安装本地打印机的流程安装,如果要选择打印机端口,选LPT1或者COM1之类的都可以

或者更简单一点的方法:把打印机直接插到本地电脑用任意方法(如驱动精灵、windows更新、XX卫士、XX助手等等)安装驱动后把打印机插回原位。驱动安装完成后,开始骚操作

先打\\IP或机器名,然后再加一根斜杠“\”,就能看到机器上的资源列表,用键盘上下键选中需要添加的打印机完整路径并复制

然后回到设备和打印机,打开刚才安装的打印机的打印机属性页,在端口页面,添加端口,类型选择默认的本地端口(Local Port),然后点新端口,端口名就是刚才复制的打印机完整路径,确定,完工

 

这一招从xp年代开始就能应对各种奇奇怪怪的无法添加共享打印机的状况,至今仍然适用

You are using a fallback implementation of the intl extension

新装的nextcloud,每秒5次的频率不断报错:

You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at /data/web/nc/3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/intl.php#18

 

后来查了下是缺了php-intl,装了就安静了