1、查看当前版本 lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty 2、执行更新命令 apt-get update && apt-get dist-upgrade 3、重启系统 reboot 4、升级系统 将源改为 16.04 的源 do-release-upgrade 5、验证升级完成 lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenia...
TortoiseSVN 在 show log 时候出现 want to go offline 问题的解决
现象: 同事使用 TortoiseSVN 在 show log 时候出现 want to go offline 的异常,不能查看日志,操作系统为 Win7。 查找与解决问题: 1、清除同事电脑上的各种缓存都没有效果; 2、在我的 Win10 系统上用相同账户登录没有任何异常;(客户端存在版本差异) 3、升级同事的 TortoiseSVN 到最新的版本(1.10.0),问题依旧; 4、修改服务器上库中的 svnserve.conf 文件,设置 anon-access = none,重启 VisualSVN(3.8.1) 后同事的电脑恢复正常。 后注:后来发现似乎与 svnserve.conf 的修改无关,如果先在根目录 show log,然后在中文子目录 show log 是可以正常查看日志的。 5、再将 anon-access = 改为 read 或恢复为注释状态,重启服务器后同事的电脑上仍然正常。 后注:所以,与 svnserve.conf 应该没有关系的。 通过以上现象分析,该问题似乎与客户的操作系统、服务器上库的默认配置都有关系。根本原因仍未查明。 后来发现在自己的电脑上也不能 show log 了,再进一步仔细观察,发现在中文目录上 show log 会失败。 切换了几个 VisualSVN Server 版本没有作用,同时与操作系统 Win2012、Win10 也不相关。 最终发现 TortoiseSVN 版本从 1.9.5 开始,后续版本都存在同样的问...
mstsc 远程桌面连接 Windows Server 时报函数不受支持错误的解决方法
远程桌面连接时提示:“发生身份验证错误,要求的函数不受支持”(Win7) 或者“远程桌面发生身份验证错误,要求的函数不受支持”(Win10)。 这可能是由于 CredSSP 加密 Oracle 修正。 解决方法: Win + R 运行 gpedit.msc 本地计算机策略 > 计算机配置 > 管理模板 > 系统 > 凭据分配 > 加密 Oracle 修正,配置为已启用,保护级别选择易受攻击。 Win10 家庭版没有 gpedit,需要修改注册表。 路径:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters 在 System 下面手动建两级项:CredSSP、Parameters 在 Parameters 下建一个 DWORD 值,AllowEncryptionOracle 值为...
非 Docker 方式安装 GitLab
GitLab 是一个基于 Git 的代码托管与协作平台,可以实现代码的版本管理、代码的审阅、问题追踪等功能。它是一个开源的、管理代码的全流程解决方案,用户可以通过其提供的 Web 界面轻松地管理代码仓库、代码版本、任务列表、CI/CD 等。 GitLab 不仅仅是一个代码托管平台,还提供了许多其他的功能,如代码审查、问题追踪、Wiki、持续集成和交付等。其中,代码审查是 GitLab 最突出的功能之一,它可以让团队成员在代码合并之前对代码进行评审和讨论,确保代码的质量和一致性。此外,GitLab 还支持多人协作开发,用户可以通过它方便地与团队成员进行代码共享和协作开发。它还提供了强大的问题追踪功能,可以让团队成员轻松地跟踪和解决问题。 安装 CentOS 7 安装和配置必要的依赖: yum install policycoreutils openssh-server openssh-clients systemctl enable sshd systemctl start sshd yum -y install postfix systemctl enable postfix systemctl start postfix firewall-cmd --permanent --add-service=http systemctl reload firewalld 获取并安装软件包: yum 方式安装: vim /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key yum makecache yum -y install gitlab-ce 或直接安装 rpm 包: wget http://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.5.1-ce.0.el7.x86_64.rpm sudo rpm -i gitlab-ce-8.5.1-ce.0.el7.x86_64.rpm Ubuntu curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null sudo vim /etc/apt/sources.list.d/gitlab-ce.list deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu trusty main sudo apt-get update sudo apt-get install gitlab-ce=10.1.3-ce.0 配置 创建仓库位置 sudo mkdir -p /data/git-data sudo chown -R git:git /data/git-data 创建备份位置 sudo mkdir -p /backups/gitlab sudo chown -R git:git /backups/gitlab 修改配置文件 sudo vim /etc/gitlab/gitlab.rb external_url "https://192.168.1.223:8888" git_data_dir "/data/git-data" //// gitlab10 git_data_dirs({ "default" => { "path" => "/data/git-data" } }) /////////////////////////////// gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.mculoop.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "gitlab@mculoop.com" gitlab_rails['smtp_password'] = "***" gitlab_rails['smtp_domain'] = "smtp.mculoop.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['gitlab_email_from'] = "gitlab@mculoop.com" user["git_user_email"] = "gitlab@mculoop.com" #nginx['redirect_http_to_https'] = true ##注意:8.5.1版本 redirect_http_to_https 不能打开,否则会提示:no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking #nginx['redirect_http_to_https_port'] = 8888 nginx['ssl_certificate'] = "/data/ssl/localhost.crt" nginx['ssl_certificate_key'] = "/data/ssl/localhost.key" gitlab_rails['backup_path'] = '/backups/gitlab' 防火墙放端口 firewall-cmd --permanent --add-port=8888/tcp systemctl restart firewalld 配置并运行 gitlab-ctl reconfigure #每次配置后都运行这个命令 好了,已经可以访问了。 默认用户名及密码: Username: root Password: 5iveL!fe 其他命令 重启命令: gitlab-ctl restart 查看运行情况命令: gitlab-ctl status 备份: sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq sudo gitlab-ctl stop nginx sudo gitlab-rake gitlab:backup:create sudo gitlab-ctl restart 定时备份: crontab -e 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create #凌晨2点执行备份 #格式:minute hour day month dayofweek command 从备份恢复: # 停止相关数据连接服务 sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq # 从1393513186编号备份中恢复 gitlab-rake gitlab:backup:restore BACKUP=1515653671_2018_01_11_10.3.3 # 启动Gitlab gitlab-ctl restart 升级 Gitlab: 如果是用 yum 方式安装的,只需执行 yum install gitlab-ce 即可。 如果是用下载的 rpm 安装包安装的,升级过程: wget http://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.5.3-ce.0.el7.x86_64.rpm rpm -Uvh gitlab-ce-8.5.3-ce.0.el7.x86_64.rpm Ubuntu 下的与 CentOS 下的类...
Debian Xfce4 VNC 服务
1、安装服务: apt-get install vnc4server 2、设置密码: vncpasswd 3、停止服务 vncserver -kill :1 Killing Xtigervnc process ID 12510... success! 4、编辑 xstartup vi ~/.vnc/xstartup #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS vncconfig -iconic & xfce4-session & 5、启动服务 vncserver :1 -localhost n...
Python 包管理
distutils distutils 是 Python 标准库的一部分,其初衷是为开发者提供一种方便的打包方式, 同时为使用者提供方便的安装方式。 setuptools (easy_install) setuptools 是 Python 的基础包工具,可以帮助我们轻松的下载,构建,安装,升级,卸载 python 的软件包。setuptools 是对 distutils 的增强, 尤其是引入了包依赖管理。setuptools 可以为 Python 包创建 egg 文件, Python 与 egg 文件的关系,相当于 Java 与 jar 包的关系。setuptools 提供的 easy_install 脚本可以用来安装 egg 包。 另外, easy_install 可以自动从 PyPI 上下载相关的包,并完成安装,升级。 地址:https://pypi.python.org/pypi/setuptools 安装: 进入源文件根目录,执行 python setup.py install 安装完后 CMD 中执行 easy_install 命令,进行检测,如果提示: error: No urls, filenames, or requirements specified (see –help) 说明安装成功。 pip pip 是安装,管理 Python 包的工具。它是对 easy_install 的一种增强。 同样可以从 PyPI 上自动下载,安装包。在 pip 中,安装前所有需要的包都要先下载,所以不会出现安装了一部分,另一部分没安装的情况所有安装的包会被跟踪,所以你可以知道为什么他们被安装,同时可以卸载。无需使用 egg 文件。使用方式比 setuptools 更简单: pip install pkg_name pip uninstall pkg_name 如果已安装 setuptools,则可以直接用 easy_install 来安装 pip: easy_install pip 当然也可以下载源代码,进入根目录执行 python setup.py install 来安...
Qt 5.9 静态编译笔记
静态编译 使用 Windows 系统 1、安装环境要求: Supported compiler (Visual Studio 2012 or later, MinGW-builds gcc 4.9 or later) Perl version 5.12 or later http://www.activestate.com/activeperl/ Python version 2.7 or later http://www.activestate.com/activepython/ Ruby version 1.9.3 or later http://rubyinstaller.org/ 2、确保环境变量 Path 中已经加入 Python 、Per、Ruby、D:\Qt\Qt5.9.0\Tools\mingw530_32\bin 的路径。 配置 configure -opensource -confirm-license -static -release \ -platform win32-g++ \ -prefix "D:\Qt\qt_5.9.0_mingw32_static_kits" \ -no-opengl \ -no-openssl \ -nomake tools \ -nomake examples \ -nomake tests \ -qt-freetype \ -qt-libpng \ -qt-libjpeg \ -qt-sqlite \ -qt-pcre \ -qt-zlib \ -skip qt3d \ -skip qtactiveqt \ -skip qtandroidextras \ -skip qtcanvas3d \ -skip qtcharts \ -skip qtconnectivity \ -skip qtdatavis3d \ -skip qtdeclarative \ -skip qtdoc \ -skip qtgamepad \ -skip qtgraphicaleffects \ -skip qtimageformats \ -skip qtlocation \ -skip qtmacextras \ -skip qtmultimedia \ -skip qtnetworkauth \ -skip qtpurchasing \ -skip qtquickcontrols \ -skip qtquickcontrols2 \ -skip qtremoteobjects \ -skip qtscript \ -skip qtscxml \ -skip qtsensors \ -skip qtspeech \ -skip qtsvg \ -skip qttools \ -skip qttranslations \ -skip qtvirtualkeyboard \ -skip qtwebchannel \ -skip qtwebengine \ -skip qtwebsockets \ -skip qtwebview \ -skip qtwinextras \ -skip qtx11extras \ -skip qtxmlpatterns \ -no-feature-dbus -skip 选项可以排除 Qt 标准库(standard repository)之外的子模组(Git Submodule),子模组名就是源码目录中对应的目录名。有些子模组会包含多个模块(Qt modules),比如说 qtconnectivity 子模组就包含了 Qt NFC 模块和 Qt Bluetooth 模块。 -feature-<feature> and -no-feature-<feature> 选项用于包含与排除 Qt 基础库(qtbase 库)的特征。qtbase/src/corelib/global/qfeatures.txt 文件中列出了所有的特征。 -qt-<library>、-system-、-no-<library> 选项用于选择使用源码中自带的还是系统提供的第三方库(third-party libraries),或者都不使用。这些第三方库位于 qtbase/src/3rdparty 编译 mingw32-make -j 4 安装 mingw32-make install 修改连接选项 D:\Qt\qt_5.9.0_mingw32_static_kits\mkspecs\win32-g++\qmake.conf 加入 QMAKE_LFLAGS = -static 或 修改 QMAKE_LFLAGS_RELEASE = -Wl,-s 为 QMAKE_LFLAGS_RELEASE = -Wl,-s -static 或 在工程文件中加入 QMAKE_LFLAGS = -static 通过实验来看应该不用修改 QMAKE_LFLAGS_DLL 的值为 -static,暂时还不了解 QMAKE_LFLAGS_DLL 的用途(估计是指链接生成 dll 文件时用的)。 有些时候还需要配置 qt.conf 如果编译好的 Qt 库的存放位置发生了变化(与 -prefix 参数所指定的不同),则 Qt Versions 提示“Qt没有被正确安装,请运行make install”,解决方法使在 qmake.exe 目录创建 qt.conf,内容为: [paths] prefix = D:/Qt/qt_5.9.0_mingw32_static_kits #当前的实际路径 在 Qt Creator 中配置 注意事项 从 Qt 5.7 开始,已经不支持 Windows XP 平台了,运行程序会提示找不到 dwmapi.dll 。如果编译后的程序需要在 XP 系统上使用,需要使用 Qt 5.6 编...
BusyBox inittab 文件介绍
除了基本的命令之外,BusyBox 还支持 init 功能,如同其它的 init 一样,BusyBox 的 init 也是完成系统的初始化工作,关机前的工作等等,我们知道在 Linux 的内核被载入之后,机器就把控制权转交给内核,内核启之后做了一些工作,然后找到根文件系统里面的 init 程序,并执行它。init 进程会依次进行以下工作: 为 init 设置信号处理过程; 初始化控制台; 剖析 /etc/inittab 文件; 执行系统初始化命令行,缺省情况下会使用 /etc/init.d/rcS; 执行所有导致 init 暂停的 inittab 命令(动作类型:wait); 执行所有仅执行一次的 inittab命令(动作类型:once); 一旦完成以上工作,init 进程便会循环执行以下进程: 执行所有终止时必须重新启动的 inittab 命令(动作类型:respawn) 执行所有终止时必须重新启动但启动前必须询问用户的 inittab 命令(动作类型:askfirst) 初始化控制台之后,BusyBox 会检查 /etc/inittab 文件是否存在,如果此文件不存在,BusyBox 会使用缺省的 inittab 配置,它主要为系统重引导,系统挂起以及 init 重启动设置缺省的动作,此外它还会为四个虚拟控制台(tty1 到 tty4)设置启动 shell 的动作。如果未建立这些设备文件,BusyBox 会报错。 Busybox 的 init 进程在初始化的时候会查看是否有 /etc/inittab 文件,如果有则解析它。 inittab 文件中每一行的格式如下所示: id:runlevel_ignored:action:command id:对 BusyBox 而言,id 用来指定启动进程的控制终端。如果省略,则使用与 init 进程一样的控制终端。 runlevel_ignored:对于 Busybox init 程序,这个字段没有意义,可以省略。 action:表示 init 程序如何控制这个子进程: action 说明 sysinit 为 init 提供初始化命令脚本的路径 wait 告诉 init 必须等到相应的进程完成之后才能继续执行 once 仅执行相应的进程一次,而且不会等待它执行完成 respawn 每当 init 进程监测到该进程终止时,重新启动该它 askfirst 与 respawn 类似,不过 init 进程先输出 “Please press Enter to actvie this console”,等用户输入回车键之后才启动子进程 shutdown 当系统关机(halt/reboot)时,执行相应的进程 restart 当 init 重新启动时(restart init when a QUIT is received),执行相应的进程,通常此处所执行的进程就是 init 本身 ctrlaltdel 当按下 Ctrl + Alt + Delete 组合键时,执行相应的进程 process:要执行的程序,它可以是可执行程序,也可以是脚本 实例: # Note: BusyBox init works just fine without an inittab. If no inittab is # found, it has the following default behavior: # ::sysinit:/etc/init.d/rcS # ::askfirst:/bin/sh # ::ctrlaltdel:/sbin/reboot # ::shutdown:/sbin/swapoff -a # ::shutdown:/bin/umount -a -r # ::restart:/sbin/init # tty2::askfirst:/bin/sh # tty3::askfirst:/bin/sh # tty4::askfirst:/bin/sh # # Boot-time system configuration/initialization script. # This is run first except when booting in single-user mode. # ::sysinit:/etc/init.d/rcS # /bin/sh invocations on selected ttys # # Note below that we prefix the shell commands with a "-" to indicate to the # shell that it is supposed to be a login shell. Normally this is handled by # login, but since we are bypassing login in this case, BusyBox lets you do # this yourself... # # Start an "askfirst" shell on the console (whatever that may be) ::askfirst:-/bin/sh # Start an "askfirst" shell on /dev/tty2-4 tty2::askfirst:-/bin/sh tty3::askfirst:-/bin/sh tty4::askfirst:-/bin/sh # /sbin/getty invocations for selected ttys tty4::respawn:/sbin/getty 38400 tty5 tty5::respawn:/sbin/getty 38400 tty6 # Example of how to put a getty on a serial line (for a terminal) #::respawn:/sbin/getty -L ttyS0 9600 vt100 #::respawn:/sbin/getty -L ttyS1 9600 vt100 # # Example how to put a getty on a modem line. #::respawn:/sbin/getty 57600 ttyS2 # Stuff to do when restarting the init process ::restart:/sbin/init # Stuff to do before rebooting ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r ::shutdown:/sbin/swapoff -...
HTTP 协议知识点
目前 HTTP 协议使用的最多的是 1.1 版本。 HTTP 1.0 与 HTTP 1.1 的区别 1、HTTP 1.1 支持长连接和请求流水线 1.0 只能使用短连接,每次请求完成后断开连接,新的请求需要重建新的连接。而 1.1 则支持长连接(持久连接,Persistent Connection),所以可以在一个连接中传送多个请求和响应,并且可以同时进行。 2、HTTP 1.1 增加 Host 字段 由于 HTTP 1.0 不支持 Host 请求头字段,浏览器无法使用主机头名来明确表示要访问服务器上的哪个 WEB 站点,这样就无法使用 WEB 服务器在同一个 IP 地址和端口号上配置多个虚拟 WEB 站点。1.1 则解决了这个问题。 3、HTTP 1.1 增加了一些新的状态代码,如 100(Continue)、101(Switching Protocols)等 4、HTTP 1.1 新增了 RANGE:bytes,用于断点续传。 5、HTTP 1.1 还提供了与身份认证、状态管理和 Cache 缓存等机制相关的请求头和响应头。 请求 标准协议支持六种请求方法:GET、HEAD、PUT、DELETE、POST、OPTIONS,与 CRUD 的对应关系是:PUT-->CREATE,GET-->READ,POST-->UPDATE,DELETE-->DELETE。 GET 可以直接写 URL 地址处传递数据,因为它没有消息体,需要传输的数据参数只能通过 URL 地址传递。 POST 可以插入消息体,所以客服端向服务端传递数据时可以通过这个消息体传递。 状态消息 当浏览器从 web 服务器请求服务时,服务器会返回状态消息,主要有几类: 1xx(信息)、2xx(成功)、3xx(重定向)、4xx(客户端错误)、5xx(服务器错误)。 HTTP 请求消息的结构 包括请求行、消息头、空行、消息体。 请求行只能通过一行发送,如:GET /index.html HTTP/1.1 消息头一般包括浏览器信息、用户认证等附加信息 空行用于在有消息体时与消息头分开; 消息体中装有客户端向服务端传输的数据,GET 没有消息体,POST 有消息体。 HTTP 响应消息的结构 包括状态行、消息头、空行、消息体。 状态行包含客服端请求的处理结...
解决 glibc 库版本不匹配的问题
使用高版本的 GCC 编译的程序在低版本 glibc 的机器上运行的时候会提示: libc.so.6: version 'GLIBC_2.14' not found 之类的错误,这是因为 GCC 所连接的 glibc 版本高于目标系统的 glibc 的版本。查看 libc.so.6 所支持的版本的方法: strings /lib/libc.so.6 | grep GLIBC_。 解决这一问题要么升级系统的 libc,要么使程序使用自己的一套 libc 。如果选择后者,需要在连接的时候指定库的优先搜索位置。并且还要指定 ld-linux.so 的位置,否则会提示段错误 Segmentation fault。 QMAKE_LINK += -Wl,-rpath=./lib:/usr/local/bs230/lib -Wl,-dynamic-linker=/usr/local/bs230/lib/ld-linux.so.3 注意:使用相对路径时所相对的是执行者所在的位置(pwd) 比如在 /home 调用 /usr/local/bs230/bsinfo 会在查找 /home/lib 文件夾,而不是 /usr/local/bs230/l...