域名检测

博客资料:

https://www.imtqy.com/domain-gfw.html

https://blog.csdn.net/moxun2011/article/details/90258340

检测工具:

https://www.checkgfw.com/

https://00738.com/

http://www.009.com/gfw/

http://www.009.com/polluted/

http://www.620138.com/

https://www.11cm.com/

https://www.ymbq.com/

https://www.toolnb.com/beiqiang/p58.com.html

http://www.gjw123.com/beiqiang/p58.com.html

https://www.xz.com/domainTool/batchSearch

http://api.uomg.com/doc-ck_qiang.html

Git命令使用说明

一、git切换分支

一、git切换分支
1、本地没有对应的远程分支

git fetch origin

git checkout -t origin/远程分支名称

#切换分支

git checkout  分支名称

2、本地有对应的远程分支

git checkout  分支名称

二、git删除本地分支及远程分支

1、删除本地分支

#查看本地分支

git branch

#删除本地分支

git branch -d 分支名称

2、删除远程分支

#查看远程分支列表

git branch -a

#删除远程分支

git push origin –delete 远程分支名称

三、git撤销本地修改与回退版本

1. 使用 git checkout 撤销本地修改;即放弃对本地已修改但尚未提交的文件的修改,还原其到未修改前的状态

注意: 已 add/ commit 的文件不适用个方法,应该用本文提到的第二种方法。

命令如下:

git checkout .      # 撤销对所有已修改但未提交的文件的修改,但不包括新增的文件

git checkout [filename]     # 撤销对指定文件的修改,[filename]为文件名

2. 使用 git reset 回退项目版本;可以回退到任意已经提交过的版本。已 add / commit 但未 push 的文件也适用

命令如下:

git log #查看commit 的哈希值

git reset –hard [commit-hashcode]

# [commit-hashcode]是某个 commit 的哈希值,可以用 git log 查看;因此一般用法是先用 git log 查看具体commit的哈希值,然后 reset 到那个版本

四、创建分支

git checkout -b 分支名称

git branch  分支名称

git clone非标准ssh端口(非22端口)处理方法

公司在内网搭建了gitLab服务器,同时使用了FRP将公司的这个内网服务器映射出去,能够让部分的外网用户可以访问到,但是在设置外网ssh登陆服务器的时候,限制了端口为10022

公司在内网搭建了gitLab服务器,同时使用了FRP将公司的这个内网服务器映射出去,能够让部分的外网用户可以访问到,但是在设置外网ssh登陆服务器的时候,限制了端口为10022
当我使用git clone git@xxx:10022:develop/xxx.git 发现不能实现代码的clone
原来,当ssh的端口访问改变的时候,原来的方式就不行了,就要使用新的方式
git clone ssh://git@hostname:port/…/xxx.git

hostname:可以是主机的IP地址也可以是域名,域名会自动通过DNS进行解析
port:端口号
样例如下所示:
git clone ssh://git@hostname:10022/develop/test.git

Sc create官方使用文档

Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

Creates a subkey and entries for a service in the registry and in the Service Control Manager database.

For examples of how to use this command, see Examples.

Syntax

sc [<ServerName>] create [<ServiceName>] [type= {own | share | kernel | filesys | rec | interact type= {own | share}}] [start= {boot | system | auto | demand | disabled}] [error= {normal | severe | critical | ignore}] [binpath= <BinaryPathName>] [group= <LoadOrderGroup>] [tag= {yes | no}] [depend= <dependencies>] [obj= {<AccountName> | <ObjectName>}] [displayname= <DisplayName>] [password= <Password>]

Parameters

Parameter
Description
<ServerName>
Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \\myserver). To run SC.exe locally, omit this parameter.
<ServiceName>
Specifies the service name returned by the getkeyname operation.
type= {own | share | kernel | filesys | rec | interact type= {own | share}}
Specifies the service type. The default setting is type= own.
own – Specifies that the service runs in its own process. It does not share an executable file with other services. This is the default setting.
share – Specifies that the service runs as a shared process. It shares an executable file with other services.
kernel – Specifies a driver.
filesys – Specifies a file system driver.
rec – Specifies a file system recognized driver (identifies file systems used on the computer).
interact – Specifies that the service can interact with the desktop, receiving input from users. Interactive services must be run under the LocalSystem account. This type must be used in conjunction with type= own or type= shared. Using type= interact by itself will generate an “invalid parameter” error.
start= {boot | system | auto | demand | disabled}
Specifies the start type for the service. The default setting is start= demand.
boot – Specifies a device driver that is loaded by the boot loader.
system – Specifies a device driver that is started during kernel initialization.
auto – Specifies a service that automatically starts each time the computer is restarted. Note that the service runs even if no one logs on to the computer.
demand – Specifies a service that must be started manually. This is the default value if start= is not specified.
disabled – Specifies a service that cannot be started. To start a disabled service, change the start type to some other value.
error= {normal | severe | critical | ignore}
Specifies the severity of the error if the service fails when the computer is started. The default setting is error= normal.
normal – Specifies that the error is logged. A message box is displayed, informing the user that a service has failed to start. Startup will continue. This is the default setting.
severe – Specifies that the error is logged (if possible). The computer attempts to restart with the last-known good configuration. This could result in the computer being able to restart, but the service may still be unable to run.
critical – Specifies that the error is logged (if possible). The computer attempts to restart with the last-known good configuration. If the last-known good configuration fails, startup also fails, and the boot process halts with a Stop error.
ignore – Specifies that the error is logged and startup continues. No notification is given to the user beyond recording the error in the event log.
binpath= <BinaryPathName>
Specifies a path to the service binary file. There is no default for binpath=, and this string must be supplied.
group= <LoadOrderGroup>
Specifies the name of the group of which this service is a member. The list of groups is stored in the registry in theHKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default value is null.
tag= {yes | no}
Specifies whether or not a TagID is to be obtained from the CreateService call. Tags are used only for boot-start and system-start drivers.
depend= <dependencies>
Specifies the names of services or groups that must start before this service starts. The names are separated by forward slashes (/).
obj= {<AccountName> | <ObjectName>}
Specifies the name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run.
displayname= <DisplayName>
Specifies a friendly name that can be used by user interface programs to identify the service.
password= <Password>
Specifies a password. This is required if an account other than LocalSystem is used.
/?
Displays help at the command prompt.

Remarks

  • For each command-line option, the equal sign is part of the option name.
  • A space is required between an option and its value (for example, type= own. If the space is omitted the operation will fail.

Examples

The following examples show how you can use the sc create command:

sc \\myserver create NewService binpath= c:\windows\system32\NewServ.exe

sc create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= “+TDI NetBIOS”

Additional references

Command-Line Syntax Key

Centos7上yum升级nginx或安装最新版本nginx

1、查看是否为最新版

1、查看是否为最新版

yum info nginx

2、设置nginx.repo文件

vi /etc/yum.repos.d/修改nginx.repo

#添加内容如下所示

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/7/$basearch/

gpgcheck=0

enabled=1

3、升级或安装

yum update nginx

# 或

yum install -y nginx

4、若nginx模块版本之间的冲突,例如下列情况,则卸载模块

如果碰到 file /usr/lib64/nginx/modules/ngx_http_geoip_module.so from install of nginx-module-geoip-1:1.16.0-1.el7.ngx.x86_64 conflicts with file from package nginx-mod-http-geoip-1:1.12.2-3.el7.x86_64 这类模块错误。

yum remove nginx-mod*

5、重新安装模块

yum install nginx-module-*

6、重启nginx服务

systemctl restart nginx

若之前是用nginx启动的,先执行

pkill nginx

Intellij Idea2018乱码解决方案

一、乱码情景

一、乱码情景

使用Intellij Idea经常遇到乱码问题,可以总结为以下几类乱码的场景。

1、工程代码乱码。

2、main方法运行,控制台乱码。

3、tomcat运行,控制台乱码。

二、解决方案

1、工程代码乱码

Settings > Editor > File Encodings > Global Encodings & Project Encodings 设置为:UTF-8。

2、main方法运行,控制台乱码

Settings > Build, Execution, Deployment > Compile > Java Compiler > Additional command line parameters > 设置为:-encoding utf-8。

3、tomcat运行,控制台乱码

Edit Configurations > Tomcat Server > server > VM options > 设置为:-Dfile.encoding=UTF-8。

Python打包exe工具pyinstaller使用总结

pyinstaller打包工具

pyinstaller打包工具

官网:https://pypi.org/project/PyInstaller/

一、安装命令:pip3 install pyinstaller

二、打包命令(首先打开cmd命令窗口):

1.进入项目目录下,否则打包后的文件要在以c:/user/Owner下面

C:\Users\Owner> cd E:\pythonworkspaces\DealTXT

C:\Users\Owner> E:

E:\pythonworkspaces\DealTXT> pyinstaller  –clean –win-private-assemblies -Fw WinMain.py -p FileUtil.py –hidden-import FileUtil   #注意此方法在其它电脑会报找不到动态链接库

E:\pythonworkspaces\DealTXT> pyinstaller  –clean –win-private-assemblies -Dw WinMain.py -p FileUtil.py –hidden-import FileUtil

E:\pythonworkspaces\DealTXT> pyinstaller -Fw WinMain.py -p FileUtil.py –hidden-import FileUtil   #注意此方法在其它电脑会报找不到动态链接库

E:\pythonworkspaces\DealTXT> pyinstaller -Dw WinMain.py -p FileUtil.py –hidden-import FileUtil

三、多文件打包

命令格式如下,下命令为一条命令,为方便显示做了分行处理:

pyinstaller [主文件] -p [其他文件1] -p [其他文件2]

–hidden-import [自建模块1]

–hidden-import [自建模块2]

# 以上为一整条命令

例如:

pyinstaller main.py -p mysql.py -p other.py –hidden-import mysql –hidden-import other

四、用到其它依赖时,用上面的方法打包比较麻烦,可以采用spec文件方法

1、整体流程

pyi-makespec WinMain.py     # 先生成spec文件

pyinstaller WinMain.spec    # 再生成exe文件

2、参数说明

-F :打包成一个exe文件(在dist文件夹下)

pyi-makespec -Fw WinMain.py

pyinstaller WinMain.spec

-D :生成一个包含exe的文件夹

pyi-makespec -Dw WinMain.py

pyinstaller WinMain.spec

需要打包数个文件时,编辑spec文件

用文本编辑器打开spec文件,修改文件中的参数 datas=[]

例如要打包 global_popu.tif 到exe中时

pec文件中的参数修改为datas=[('global_popu.tif', '.')]

然后将spec文件编译成exe,两点注意:

将数据文件和xxx.py文件放在同一目录

对xxx.py程序读取数据的部分需要修改,修改方法如下

a = Analysis(['trip_popu.py'],

             pathex=['E:\\GitHub\\Zone\\Zone'],

             binaries=[],

             datas=[('global_popu.tif', '.')],

             hiddenimports=[],

             hookspath=[],

             runtime_hooks=[],

             excludes=[],

             win_no_prefer_redirects=False,

             win_private_assemblies=False,

             cipher=block_cipher,

             noarchive=False)

复制代码# 对xxx.py的修改

# 添加自定义的函数

def resource_path(relative_path):

    base_path = getattr(

        sys, '_MEIPASS', os.path.dirname(

            os.path.abspath(__file__)))

    return os.path.join(base_path, relative_path)

#global_popu_Dic = resource_path("global_popu.tif")  # 打包时使用

global_popu_Dic = "../data/global_popu.tif"            # 调试时使用

复制代码如果要打包两个或者多个数据文件,则对spec中的datas 修改参考下例:

datas=[('china_light_2016.tif', '.'),('china_population_2016.tif', '.')]

多个PY文件

整体操作与上述类似,关键在于修改spec中的参数

例如:code文件夹下的trip_popu.py用到了zone_func文件夹目录下的func.py文件,

在spec文件中的Analysis的第一个参数中加上func.py文件的绝对路径,然后生成exe即可

a = Analysis(['trip_popu.py','E:\\GitHub\\Zone\\Zone\\zone_func\\func.py'],

             pathex=['E:\\GitHub\\Zone\\Zone'],

             binaries=[],

             datas=[('global_popu.tif', '.')],

             hiddenimports=[],

             hookspath=[],

             runtime_hooks=[],

             excludes=[],

             win_no_prefer_redirects=False,

             win_private_assemblies=False,

             cipher=block_cipher,

             noarchive=False)

复制代码多进程打包

编写的程序中包含多进程处理时,正常打包运行exe后,电脑会卡死

所以在打包前,需先要对xxx.py文件进行修改,修改内容为:

import multiprocessing

if __name__ == "__main__":

    multiprocessing.freeze_support()    # 这一句一定要放在if __name__ == "__main__":下面

复制代码修改后,正常打包即可

问题记录

程序有使用到shapely库,打包时会提示缺少geos.dll

将提示的shapely库的路径下的geos_c.dll复制一份重命名为geos.dll,重新打包即可

程序有使用到geopandas库,打包时运行后提示

File "site-packages\geopandas\datasets\__init__.py", line 7, in <module>

StopIteration

[6764] Failed to execute script application

复制代码找到geopandas库文件下的__init__.py,将import geopandas.datasets这句注释掉

程序有使用到sklearn库时,打包运行时提示缺少一些模块,如sklearn.utils._cython_blas

修改spec文件中的hiddenimports参数后,重新打包,修改如下

a = Analysis(['mainarea_buffer.py','E:\\GitHub\\Zone\\Zone\\zone_func\\func.py'],

             pathex=['E:\\GitHub\\Zone\\Zone'],

             binaries=[],

             datas=[('global_popu.tif', '.')],

             hiddenimports=['sklearn.utils._cython_blas','cython', 'sklearn', 'sklearn.ensemble','sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree._utils','scipy._lib.messagestream'],

             hookspath=[],

             runtime_hooks=[],

             excludes=[],

             win_no_prefer_redirects=False,

             win_private_assemblies=False,

             cipher=block_cipher,

             noarchive=False)

五、命令语法:pyinstaller -F 文件名(带后缀py)

#常用参数说明:

#–icon=图标路径

#-F 打包成一个exe文件

#-w 使用窗口,无控制台

#-c 使用控制台,无窗口

#-D 创建一个目录,里面包含exe以及其他一些依赖性文件

#pyinstaller -h 来查看参数

#将cmd的目录切换至(命令:cd 文件路径(注意空格))需要打包的py文件目录下:

#有命令窗口弹出

pyinstaller -F WinMain.py

#无命令窗口弹出

pyinstaller -F -w WinMain.py

#或者

pyinstaller -F WinMain.py  –noconsole

打包好的exe文件,在同目录的 dist 文件中,如果有依赖文件,就可以放到dist文件夹下即可