5 程序员技术之旅

尚未进行身份认证

我要认证

个人博客地址:https://www.zhangbj.com GitHub地址:https://github.com/fendoudebb

等级
TA的排名 16w+

Linux命令之中英文对照

列出目录内容ls:list改变目录cd:change directory移动mv:move复制cp:copy切换用户su:switch user红帽子打包管理器rqm:redhat package manger打印当前目录显示当前工作目录的绝对路径pwd:print work directory进程状态类似于wins任务管理器常用参数: -auxf ps -auxfps:process status显示磁盘可用空间df:disk free查看已使用

2020-08-08 09:01:33

Linux命令之解压缩

Linux下常见的压缩包格式有5种:zip、tar.gz、tar.bz2、tar.xz、tar.Z。其中tar是种打包格式,gz和bz2等后缀才是指代压缩方式:gzip和bzip2。解压zip:unzip example.zip (如无unzip命令需安装)解压tar.gz:tar -zxvf example.tar.gz解压tar.bz2:tar -jxvf example.tar.bz2解压tar.xz:tar -Jxvf example.tar.xz解压tar.Z:ta.

2020-08-03 20:19:56

Linux命令之OpenSSL生成RSA公钥私钥

使用OpenSSL生成RSA公私钥生成RSA私钥(传统格式的)选其一即可openssl genrsa -out rsa_private_key.pem 1024openssl genrsa -out rsa_private_key.pem 600将传统格式的私钥转换成 PKCS#8格式Java需要使用的私钥需要经过PKCS#8编码,PHP程序不需要,可以直接略过openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outfo.

2020-08-03 20:19:08

Linux之校准服务器时间

查看当前时间date安装ntpyum install ntp设置ntpntpdate cn.pool.ntp.org注意如遇到: Operation not permitted。解决办法:先关闭防火墙,再同步时间,最后再开启防火墙。关闭防火墙service iptables stop同步时间ntpdate cn.pool.ntp.org开启防火墙service iptables start原文地址https://www.zhangbj.com/p/4

2020-08-03 20:18:26

Linux命令之查看进程线程数量

查系统支持的最大线程数一般会很大,相当于理论值cat /proc/sys/kernel/pid_max系统限制某用户下最多可以运行多少进程或线程ulimit -u查询当前某程序的线程或进程数pstree -p 进程id | wc -l查询当前整个系统已用的线程或进程数pstree -p | wc -l树状结构列出所有进程数pstree -p ${pid}原文地址https://www.zhangbj.com/p/40.html...

2020-08-03 20:17:32

Linux之CentOS yum安装Redis

安装sudo yum install redis启动sudo service redis start原文地址https://www.zhangbj.com/p/39.html

2020-08-03 20:16:40

Linux之CentOS yum安装Nginx

添加nginx源方法一sudo vim /etc/yum.repos.d/nginx.repo插入内容Centos6[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/6/$basearch/gpgcheck=0enabled=1Centos7[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/7/$basearch/gp

2020-08-03 20:15:36

Linux之CentOS yum安装PHP7.2

配置安装yum源 EPEL and Remi repositoryCentos7 可以将链接中的6改为7即可sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpmsudo yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm如果6误装了7,可先卸载yum remove epel-rele

2020-08-03 20:13:34

Linux之CentOS glibc版本过低安装不了软件

问题libc.so.6: version `GLIBC_2.14’ not found解决方案glibc官网下载查看系统版本cat /etc/redhat-release查看glibc版本strings /lib64/libc.so.6 | grep GLIBC_输出:GLIBC_2.2.5GLIBC_2.2.6GLIBC_2.3GLIBC_2.3.2GLIBC_2.3.3GLIBC_2.3.4GLIBC_2.4GLIBC_2.5GLIBC_2.6GLIB

2020-08-03 20:12:21

Linux之CentOS yum更换阿里源

备份原先数据源mv /etc/yum.repos.d /etc/yum.repos.d.bakCentos 5.X 安装阿里或者网易的源# 阿里sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo# 网易sudo wget http://mirrors.163.com/.help/CentOS5-Base-163.repoCentos 6.X 安装阿里或

2020-08-03 20:11:28

Linux之Ubuntu apt-get更换阿里源

备份原先数据源mv /etc/apt/sources.list /etc/apt/sources.list.bak添加阿里源cat > /etc/apt/sources.list << EOF deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main res

2020-08-03 20:03:51

Linux之CentOS安装JDK及JRE

查看CentOS自带JDK是否已安装yum list installed | grep java假使存在自带的jdk,删除centos自带的JDKyum -y remove java-1.7.0-openjdk*yum -y remove tzdata-java.noarch# 结果显示为Complete!表示卸载完成!再次检查安装包是否删除yum list installed | grep java查看yum库下的java安装包yum -y list java*(查看你想要的版

2020-08-02 09:59:20

Linux之Ubuntu安装JDK及JRE

安装Jave8导入Webupd8 PPAsudo add-apt-repository ppa:webupd8team/javasudo apt-get update安装sudo apt-get install oracle-java8-installer设置为默认jdksudo apt install oracle-java8-set-default安装Java9导入Webupd8 PPAsudo add-apt-repository -y ppa:webupd

2020-08-02 09:57:57

Git 提示error failed to push some refs to git@github.com

error: failed to push some refs to 'git@github.com:…" Updates were rejected because the remote contains work that you do not have locally.本地和远程的文件应该合并后才能上传本地的新文件git pull origin mastergit push -u origin master原文地址https://www.zhangbj.com/p/31.html.

2020-08-02 09:56:37

Git 提示You asked me to pull without telling me which branch you...

错误信息Git未关联本地分支与远程分支,报错如下:You asked me to pull without telling me which branch youwant to merge with, and 'branch.master.merge' inyour configuration file does not tell me, either. Pleasespecify which branch you want to use on the command line andtry a

2020-08-02 09:55:31

Git 提示refusing to merge unrelated histories

错误提示git push时提示:fatal: refusing to merge unrelated histories解决方法git pull --allow-unrelated-histories原文地址https://www.zhangbj.com/p/29.html

2020-08-02 09:53:23

GitHub访问慢解决方案

配置hosts文件Windows hosts文件位置C:\Windows\System32\drivers\etc\hostsLinux hosts文件位置/ect/hosts修改hosts文件追加以下内容# GitHub Start 192.30.253.112 github.com 192.30.253.119 gist.github.com 151.101.100.133 assets-cdn.github.com 151.101.100.133 raw.github

2020-08-02 09:51:34

Git命令之查看及设置用户名邮箱

GitHub统计contributions是以邮箱依据的查看用户名和邮箱地址git config user.namegit config user.email修改用户名和邮箱地址git config --global user.name "username"git config --global user.email "email"原文地址https://www.zhangbj.com/p/27.html...

2020-08-02 09:50:17

Nginx配置之屏蔽某IP访问

查看Nginx日志中ip访问次数awk '{print $1}' access.log |sort |uniq -c|sort -n结果:42 222.64.157.10048 106.120.173.11450 47.98.251.5651 47.98.233.17956 47.98.248.21468 58.38.91.17171 124.76.148.25在http, server, location, limit_except语句块新加deny 124.76.148.25

2020-08-02 09:47:52

Nginx配置之开启状态检查

查看是否安装所需模块–with-http_stub_status_modulenginx -V如若未安装改模块,需重新编译安装./configure --with-http_stub_status_modulemake & make install配置可参考如下location /ngx_status { allow 127.0.0.1; #允许的IP deny all; stub_status on; access_log off;}页面返回的信息

2020-08-02 09:45:57

查看更多

勋章 我的勋章
  • 签到新秀
    签到新秀
    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。
  • 分享精英
    分享精英
    成功上传11个资源即可获取