Git Product home page Git Product logo

dotbackup's Introduction

置顶 👍

最新 🆕

Typescripts 总结 0 💬 2021-06-29 08:22:54

🏷️ : 面试, typescript

总结TypeScript在项目开发中的应用实践体会

条件类型

type B<T> = T extends string ? '1' : '2'

const a: B<s
[更多>>>](https://github.com/hsipeng/note/issues/96)
---

#### [前端知识总结](https://github.com/hsipeng/note/issues/95) <sup>0 :speech_balloon:</sup> 	 2020-08-08 08:40:10
:label: : [面试](https://github.com/hsipeng/note/labels/%E9%9D%A2%E8%AF%95), [前端](https://github.com/hsipeng/note/labels/%E5%89%8D%E7%AB%AF), [:+1:置顶](https://github.com/hsipeng/note/labels/%3A%2B1%3A%E7%BD%AE%E9%A1%B6)
自己整理出来的针对 P6 级别的前端知识体系

欢迎批评指正

地址是➡️  [http://hsipeng.github.io/fed](http://hsipeng.github.io/fed)
[更多>>>](https://github.com/hsipeng/note/issues/95)
---

#### [Redux 实现原理](https://github.com/hsipeng/note/issues/94) <sup>0 :speech_balloon:</sup> 	 2020-05-12 16:27:43
:label: : [react](https://github.com/hsipeng/note/labels/react), [redux](https://github.com/hsipeng/note/labels/redux)
```javascript
function createStore(reducer, state = null){
    let listeners = [];
    let getState = () => state;
    let subscribe = listener =>
[更多>>>](https://github.com/hsipeng/note/issues/94)
---

#### [ssl 生成 ssl 证书](https://github.com/hsipeng/note/issues/93) <sup>0 :speech_balloon:</sup> 	 2020-05-12 15:30:58
:label: : [linux](https://github.com/hsipeng/note/labels/linux), [ssl](https://github.com/hsipeng/note/labels/ssl)
## nginx 安装

sudo apt get install nginx


nginx 配置

server { listen 80 default; server_name domain; location / {

React 单元测试 0 💬 2019-09-16 08:17:22

🏷️ : react, 单元测试, jest

为何必须做单元测试

  • 单元测试对于任何 React 项目(及其他任何项目)来说都是必须的
  • 我们需要自动化的测试套件,根本目标是支持随时随地的代码调整、持续改进,从而提升团队响应力
  • 使用 TDD 开发是得到好的单元测试的唯一途径
  • 好的单元测试具备几大特征:不关注内部实现 更多>>>

分类 🗃️

词云, 点击展开详细分类

☁️ 词云 ☁️ 点击词云展开详细分类:point_down:

👍置顶 3:newspaper: - [前端知识总结](#95) 0 💬 - [网站工具Api搜集整理](#78) 0 💬 - [Flutter 学习整理](#76) 1 💬
🖼️封面 0:newspaper:
2B青年 4:newspaper: - [初爱](#23) 0 💬 - [关山月](#22) 0 💬 - [雪中歌](#21) 0 💬 - [江上有感](#18) 0 💬
axios 1:newspaper: - [基于 Promise 的 HTTP 请求客户端,axios](#13) 0 💬
babel 1:newspaper: - [react webpack babel 三剑客错误处理](#53) 0 💬
bug 0:newspaper:
centos 1:newspaper: - [ssh 权限问题](#41) 0 💬
coffeeScript 1:newspaper: - [CoffeeScript 基础知识](#8) 0 💬
component 1:newspaper: - [## Re: Zero 学习一个组件](#43) 0 💬
css 1:newspaper: - [前端开发,从草根到英雄(总结)](#12) 0 💬
Curry 1:newspaper: - [柯里化](#29) 0 💬
D3 1:newspaper: - [D3 与 React ](#63) 0 💬
Data Analysis 1:newspaper: - [Data Analysis with Python——01](#75) 0 💬
Data Analysis with Python 9:newspaper: - [Data Analysis with Python——09](#89) 1 💬 - [Data Analysis with Python——08](#88) 0 💬 - [Data Analysis with Python——07](#87) 0 💬 - [Data Analysis with Python——06](#86) 0 💬 - [Data Analysis with Python——05](#85) 0 💬 - [Data Analysis with Python——04](#84) 0 💬 - [Data Analysis with Python——03](#83) 0 💬 - [Data Analysis with Python——02](#82) 0 💬 - [Data Analysis with Python——01](#81) 0 💬
duplicate 0:newspaper:
enhancement 0:newspaper:
ES6 3:newspaper: - [ES6 数组去重](#57) 0 💬 - [ES6 知识点整理](#34) 0 💬 - [【译】ES 6 代理 (Proxy) 简介 ](#32) 0 💬
eslint 1:newspaper: - [vscode AutoSave With Prettier ](#64) 0 💬
flutter 1:newspaper: - [Flutter 学习整理](#76) 1 💬
gh-pages 1:newspaper: - [travis ci 持续集成](#26) 0 💬
git 2:newspaper: - [travis ci 持续集成](#26) 0 💬 - [git 安装与使用](#14) 0 💬
help wanted 0:newspaper:
html 1:newspaper: - [前端开发,从草根到英雄(总结)](#12) 0 💬
invalid 0:newspaper:
java 3:newspaper: - [Oracle 与 MySql 区别(笔记)](#6) 0 💬 - [java基础知识笔记(2)](#5) 0 💬 - [java基础知识笔记(1)](#4) 0 💬
javascript 11:newspaper: - [前端常用算法梳理](#77) 0 💬 - [ES6 数组去重](#57) 0 💬 - [函数式编程](#49) 0 💬 - [javascript 转换](#38) 0 💬 - [算法](#36) 0 💬 - [this的指向](#31) 0 💬 - [闭包的应用](#30) 0 💬 - [手撸一个 redux 实现](#28) 0 💬 - [javascript 精粹](#27) 0 💬 - [基于 Promise 的 HTTP 请求客户端,axios](#13) 0 💬 - [前端开发,从草根到英雄(总结)](#12) 0 💬
jest 1:newspaper: - [React 单元测试](#92) 0 💬
jsonp 1:newspaper: - [Promise Jsonp](#50) 0 💬
koa 1:newspaper: - [Koa 中间件](#60) 0 💬
linux 2:newspaper: - [ssl 生成 ssl 证书](#93) 0 💬 - [Ubuntu安装BTSync](#7) 1 💬
MiniProgram 1:newspaper: - [小程序ios 安卓兼容性](#65) 0 💬
Mybatis 1:newspaper: - [java SSM框架的搭建](#25) 0 💬
mysql 1:newspaper: - [Mysql 备忘](#45) 0 💬
nodejs 3:newspaper: - [Promise Jsonp](#50) 0 💬 - [travis ci 持续集成](#26) 0 💬 - [基于 Promise 的 HTTP 请求客户端,axios](#13) 0 💬
npm 1:newspaper: - [publish package to npmjs.com](#66) 0 💬
NumPy 1:newspaper: - [Data Analysis with Python——01](#75) 0 💬
poem 4:newspaper: - [初爱](#23) 0 💬 - [关山月](#22) 0 💬 - [雪中歌](#21) 0 💬 - [江上有感](#18) 0 💬
prettier 1:newspaper: - [vscode AutoSave With Prettier ](#64) 0 💬
promise 1:newspaper: - [基于 Promise 的 HTTP 请求客户端,axios](#13) 0 💬
python 14:newspaper: - [Data Analysis with Python——09](#89) 1 💬 - [Data Analysis with Python——08](#88) 0 💬 - [Data Analysis with Python——07](#87) 0 💬 - [Data Analysis with Python——06](#86) 0 💬 - [Data Analysis with Python——05](#85) 0 💬 - [Data Analysis with Python——04](#84) 0 💬 - [Data Analysis with Python——03](#83) 0 💬 - [Data Analysis with Python——02](#82) 0 💬 - [Data Analysis with Python——01](#81) 0 💬 - [python数据分析之性能度量](#80) 0 💬 - [python数据分析之数据缺失](#79) 0 💬 - [Data Analysis with Python——01](#75) 0 💬 - [python 环境](#74) 0 💬 - [python之pyenv版本控制](#15) 0 💬
question 0:newspaper:
Raspberry Pi 0:newspaper:
Re: Zero 2:newspaper: - [Re: Zero JSX 回调函数中的 this](#44) 0 💬 - [## Re: Zero 学习一个组件](#43) 0 💬
react 14:newspaper: - [Redux 实现原理](#94) 0 💬 - [React 单元测试](#92) 0 💬 - [D3 与 React ](#63) 0 💬 - [React 单元测试](#62) 0 💬 - [React 服务端渲染](#61) 0 💬 - [redux 写法详解](#59) 0 💬 - [react webpack babel 三剑客错误处理](#53) 0 💬 - [一个可用于生产环境的开发框架的搭建](#48) 0 💬 - [项目结构详解](#47) 0 💬 - [Re: Zero JSX 回调函数中的 this](#44) 0 💬 - [## Re: Zero 学习一个组件](#43) 0 💬 - [无状态函数式组件](#37) 0 💬 - [面试纪要](#33) 0 💬 - [手撸一个 redux 实现](#28) 0 💬
redux 3:newspaper: - [Redux 实现原理](#94) 0 💬 - [redux 写法详解](#59) 0 💬 - [手撸一个 redux 实现](#28) 0 💬
Spring 1:newspaper: - [java SSM框架的搭建](#25) 0 💬
SpringMVC 1:newspaper: - [java SSM框架的搭建](#25) 0 💬
ssh 1:newspaper: - [ssh 权限问题](#41) 0 💬
ssl 1:newspaper: - [ssl 生成 ssl 证书](#93) 0 💬
SSM 1:newspaper: - [java SSM框架的搭建](#25) 0 💬
ssr 1:newspaper: - [React 服务端渲染](#61) 0 💬
this 1:newspaper: - [this的指向](#31) 0 💬
Travis CI 1:newspaper: - [travis ci 持续集成](#26) 0 💬
typescript 2:newspaper: - [Typescripts 总结](#96) 0 💬 - [vue with typescript](#73) 0 💬
ubuntu 2:newspaper: - [Ubuntu使用dnsmasq作本地DNS缓存](#24) 0 💬 - [Ubuntu安装BTSync](#7) 1 💬
vscode 1:newspaper: - [vscode AutoSave With Prettier ](#64) 0 💬
vue 2:newspaper: - [vue with typescript](#73) 0 💬 - [vue全面介绍--全家桶(vue笔记一)](#10) 0 💬
Webpack 10:newspaper: - [webpack to umd package](#72) 0 💬 - [webpack 4 - webpack-merge to config dev prod environment quickly](#71) 0 💬 - [webpack4-HMR with webpack-dev-server](#70) 0 💬 - [webpack4-Atuo serve dist file](#69) 0 💬 - [# webpack4-command line without config file](#68) 0 💬 - [webpack4 - Basic config](#67) 0 💬 - [react webpack babel 三剑客错误处理](#53) 0 💬 - [webpack 3.5.5 文档 再读](#52) 0 💬 - [webpack 4 ](#39) 0 💬 - [Webpack 入门](#11) 0 💬
wechat 1:newspaper: - [小程序ios 安卓兼容性](#65) 0 💬
wontfix 0:newspaper:
函数式编程 1:newspaper: - [函数式编程](#49) 0 💬
前端 3:newspaper: - [前端知识总结](#95) 0 💬 - [前端常用算法梳理](#77) 0 💬 - [柯里化](#29) 0 💬
单元测试 2:newspaper: - [React 单元测试](#92) 0 💬 - [React 单元测试](#62) 0 💬
取整 1:newspaper: - [javascript 转换](#38) 0 💬
学习笔记 1:newspaper: - [javascript 精粹](#27) 0 💬
小程序 3:newspaper: - [小程序热区](#58) 0 💬 - [小程序组件及组件事件转发](#56) 0 💬 - [小程序热区](#55) 0 💬
开源 0:newspaper:
技术 0:newspaper:
数据分析 13:newspaper: - [如何炼就数据分析的思维?](#91) 0 💬 - [数据分析惯用的5种思维方法](#90) 0 💬 - [Data Analysis with Python——09](#89) 1 💬 - [Data Analysis with Python——08](#88) 0 💬 - [Data Analysis with Python——07](#87) 0 💬 - [Data Analysis with Python——06](#86) 0 💬 - [Data Analysis with Python——05](#85) 0 💬 - [Data Analysis with Python——04](#84) 0 💬 - [Data Analysis with Python——03](#83) 0 💬 - [Data Analysis with Python——02](#82) 0 💬 - [Data Analysis with Python——01](#81) 0 💬 - [python数据分析之性能度量](#80) 0 💬 - [python数据分析之数据缺失](#79) 0 💬
数据缺失 1:newspaper: - [python数据分析之数据缺失](#79) 0 💬
文艺 4:newspaper: - [初爱](#23) 0 💬 - [关山月](#22) 0 💬 - [雪中歌](#21) 0 💬 - [江上有感](#18) 0 💬
新生 1:newspaper: - [拿到公司电脑,之后要做些什么](#46) 0 💬
无状态组件 1:newspaper: - [无状态函数式组件](#37) 0 💬
日记 6:newspaper: - [对未来的思考](#20) 0 💬 - [谁说的青春无悔](#19) 0 💬 - [生活,需要一些仪式感 ](#17) 0 💬 - [2015-09-08-反思](#16) 0 💬 - [2017-05-19-总结](#3) 0 💬 - [热爱工作热爱生活](#2) 0 💬
柯里 1:newspaper: - [柯里化](#29) 0 💬
框架 1:newspaper: - [一个可用于生产环境的开发框架的搭建](#48) 0 💬
热区 1:newspaper: - [小程序热区](#55) 0 💬
电影 2:newspaper: - [无问西东](#51) 0 💬 - [姜文的一步之遥](#9) 0 💬
知识点 1:newspaper: - [ES6 知识点整理](#34) 0 💬
算法 2:newspaper: - [前端常用算法梳理](#77) 0 💬 - [算法](#36) 0 💬
翻译 1:newspaper: - [【译】ES 6 代理 (Proxy) 简介 ](#32) 0 💬
读书笔记 1:newspaper: - [生活,需要一些仪式感 ](#17) 0 💬
闭包 1:newspaper: - [闭包的应用](#30) 0 💬
面试 5:newspaper: - [Typescripts 总结](#96) 0 💬 - [前端知识总结](#95) 0 💬 - [面试纪要](#33) 0 💬 - [this的指向](#31) 0 💬 - [柯里化](#29) 0 💬
音乐 0:newspaper:
项目 1:newspaper: - [项目结构详解](#47) 0 💬

dotbackup's People

Contributors

hsipeng avatar

Watchers

 avatar

dotbackup's Issues

arch

开启ssh

pacman.conf 有include支持包含其他文件的内容。在有多个Server的情况下,pacman优先使用第一个。建议把新Server放在第一行

# pacman -Syy openssh  安装openssh

Arch 使用的 init 软件是 systemd。systemd 用来管理服务的命令是 systemctl,启动/查看/停止服务分别用参数选项 start/status/stop。

启动ssh服务

# systemctl start sshd

要让 ssh 服务自启动可以

#systemctl enable sshd  --相应的关闭操作就是disable

mysql 开启远程连接

CentOS下开启mysql远程连接,远程管理数据库
当服务器没有运行php、没装phpmyadmin的时候,远程管理mysql就显得有必要了。因为在CentOS下设置的,所以标题加上了CentOS,以下的命令在debian等系统下应该也OK。

mysql -u root -p mysql 

第1个mysql是执行命令,第2个mysql是系统数据名称

在mysql控制台执行:

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

root是用户名,%代表任意主机,'123456'指定的登录密码(这个和本地的root密码可以设置不同的,互不影响)

flush privileges; # 重载系统权限
exit;

允许3306端口

iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

查看规则是否生效

iptables -L -n # 或者: service iptables status

此时生产环境是不安全的,远程管理之后应该关闭端口,删除之前添加的规则

iptables -D INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

PS,上面iptables添加/删除规则都是临时的,如果需要重启后也生效,需要保存修改:

service iptables save # 或者: /etc/init.d/iptables save

另外,

vi /etc/sysconfig/iptables # 加上下面这行规则也是可以的
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

linux 查询解压缩命令

查询操作

命令 解析
find / -name file1 从 ‘/’ 开始进入根文件系统查找文件和目录
find / -user user1 查找属于用户 ‘user1’ 的文件和目录
find /home/user1 -name *.bin 在目录 ‘/ home/user1’ 中查找以 ‘.bin’ 结尾的文件
find /usr/bin -type f -atime +100 查找在过去100天内未被使用过的执行文件
find /usr/bin -type f -mtime -10 查找在10天内被创建或者修改过的文件
locate *.ps 寻找以 ‘.ps’ 结尾的文件,先运行 ‘updatedb’ 命令
find -name ‘*.[ch]’ | xargs grep -E ‘expr’ 在当前目录及其子目录所有.c和.h文件中查找 ‘expr’
find -type f -print0 | xargs -r0 grep -F ‘expr’ 在当前目录及其子目录的常规文件中查找 ‘expr’
find -maxdepth 1 -type f | xargs grep -F ‘expr’ 在当前目录中查找 ‘expr’

压缩,解压缩

命令 解析
bzip2 file1 压缩 file1
bunzip2 file1.bz2 解压 file1.bz2
gzip file1 压缩 file1
gzip -9 file1 最大程度压缩 file1
gunzip file1.gz 解压 file1.gz
tar -cvf archive.tar file1 把file1打包成 archive.tar(-c: 建立压缩档案;-v: 显示所有过程;-f: 使用档案名字,是必须的,是最后一个参数)
tar -cvf archive.tar file1 dir1 把 file1,dir1 打包成 archive.tar
tar -tf archive.tar 显示一个包中的内容
tar -xvf archive.tar 释放一个包
tar -xvf archive.tar -C /tmp 把压缩包释放到 /tmp目录下
zip file1.zip file1 创建一个zip格式的压缩包
zip -r file1.zip file1 dir1 把文件和目录压缩成一个zip格式的压缩包
unzip file1.zip 解压一个zip格式的压缩包到当前目录
unzip test.zip -d /tmp/ 解压一个zip格式的压缩包到 /tmp 目录

nginx负载均衡(upstream)与反向代理(proxy_pass)

nginx 的负载均衡配置起来很简单, 如下:

    upstream resinserver{
        ip_hash;
        server 127.0.0.1:8000 down;
        server 127.0.0.1:8080 weight=2;
        server 127.0.0.1:6801;
        server 127.0.0.1:6802 backup;
    }

    #Ip_hash:每个请求按访问ip的hash结果分配,这样每个访客固定访问一个后端服务器,可以解决session的问题
    #down:不参与负载均衡
    #weight:比重,越大的分配的越多
    #backup:其他的非backup机器都down或者忙的时候才会请求到这台机器
```

例子:

```
一个简单的负载均衡与反向代理配合使用的例子

http{
  upstream test{
    ip_hash;
    server  127.0.0.1:8888
    server  127.0.0.1:9999
  }

  server {
    listen 80;
    server_name test.com

    location / {
      proxy_pass http://test;
      proxy_set_header Host $host:8888;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  }
}
```

redis

yum install gcc gcc-c++
wget http://download.redis.io/releases/redis-3.2.5.tar.gz
tar -zxvf ./redis-3.2.5.tar.gz
make
make install
vim /etc/redis.conf

启动:
/usr/local/bin/redis-server /etc/redis.conf
关闭:
redis-cli -h 127.0.0.1 -p 6379 shutdown
查看是否启动:
ps -ef | grep redis
进入客户端:
redis-cli
关闭客户端:
redis-cli shutdown
开机启动配置:
echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.local
开放防火墙端口:
添加规则:
iptables -I INPUT -p tcp -m tcp --dport 6379 -j ACCEPT
保存规则:
service iptables save
重启 iptables:
service iptables restart

redis.conf

# 是否以后台daemon方式运行,默认是 no,一般我们会改为 yes
daemonize no
pidfile /var/run/redis.pid
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 0
loglevel notice
logfile ""
# 开启数据库的数量,Redis 是有数据库概念的,默认是 16 个,数字从 0 ~ 15
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

如果用 IP 进入客户端,但是报:Could not connect to Redis at 192.168.1.121:6379: Connection refused

原因:Redis 默认只允许本机访问,可是有时候我们也需要 Redis 被远程访问。
解决办法:
修改 Redis 配置文件:
vim /etc/redis.conf
找到 bind 那行配置,默认是:# bind 127.0.0.1
去掉 # 注释并改为:bind 0.0.0.0

把 redis 添加到系统服务中

vim /etc/init.d/redis

添加如下内容:

#!/bin/sh  
#  
# redis - this script starts and stops the redis-server daemon  
#  
# chkconfig:   - 85 15  
# description:  Redis is a persistent key-value database  
# processname: redis-server  
# config:      /usr/local/redis-2.4.X/bin/redis-server  
# config:      /usr/local/ /redis-2.4.X/etc/redis.conf  
# Source function library.  
. /etc/rc.d/init.d/functions  
# Source networking configuration.  
. /etc/sysconfig/network  
# Check that networking is up.  
[ "$NETWORKING" = "no" ] && exit 0  
redis="/usr/local/bin/redis-server" 
prog=$(basename $redis)  
REDIS_CONF_FILE="/etc/redis.conf" 
[ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis  
lockfile=/var/lock/subsys/redis  
start() {  
  [ -x $redis ] || exit 5  
  [ -f $REDIS_CONF_FILE ] || exit 6  
  echo -n $"Starting $prog: "  
  daemon $redis $REDIS_CONF_FILE  
  retval=$?  
  echo  
  [ $retval -eq 0 ] && touch $lockfile  
  return $retval  
}  
stop() {  
  echo -n $"Stopping $prog: "  
  killproc $prog -QUIT  
  retval=$?  
  echo  
  [ $retval -eq 0 ] && rm -f $lockfile  
  return $retval  
}  
restart() {  
  stop  
  start  
}  
reload() {  
  echo -n $"Reloading $prog: "  
  killproc $redis -HUP  
  RETVAL=$?  
  echo  
}  
force_reload() {  
  restart  
}  
rh_status() {  
  status $prog  
}  
rh_status_q() {  
  rh_status >/dev/null 2>&1  
}  
case "$1" in  
  start)  
      rh_status_q && exit 0  
      $1  
      ;;  
  stop)  
      rh_status_q || exit 0  
      $1  
      ;;  
  restart|configtest)  
      $1  
      ;;  
  reload)  
      rh_status_q || exit 7  
      $1  
      ;;  
  force-reload)  
      force_reload  
      ;;  
  status)  
      rh_status  
      ;;  
  condrestart|try-restart)  
      rh_status_q || exit 0  
  ;;  
  *)  
      echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart| reload|orce-reload}"  
      exit 2  
esac
修改权限:
chmod 755 /etc/init.d/redis
启动服务:
service redis start
停止服务:
service redis stop
重启服务:
service redis restart

centos PHP phpize安装拓展

phpize简介

phpize 是属于 php-devel 中的东西,主要是设定 php 外挂模块的一些设定

所以安装 php-devel 相关套件就会有 phpize 可以使用 (档案预设存放于 /usr/bin/phpize )

phpize 命令是用来准备 PHP 外挂模块的编译环境的。下面例子中,外挂模块的源程序位于 extname 目录中 :

$ cd extname
$ phpize
$ ./configure ( 注一)
$ make
$ make install

成功的安装将建立 extname.so 并放置于 PHP 的外挂模块目录中 (预设存放于 /usr/lib/php/modules/ 内) 。

需要调整 php.ini,加入 extension=extname.so 这一行之后才能使用此外挂模块。

实例

比如你要安装php 的openssl拓展

你需要下载当前php对应版本的源码,这边假设是php-5.4.32版本,然后你就要首先进入php-5.4.32/ext/openssl目录下,不然下面的命令会会报错.
然后就可以执行命令了:

mv config0.m4 config.m4
(3) /data/php/bin/phpize
(4) ./configure --with-openssl --with-php-config=/data/php/bin/php-config,如果此步报Cannot find OpenSSL's <evp.h> 的错误执行以下命令:
    yum install openssl openssl-devel
    ln -s /usr/lib64/libssl.so /usr/lib/
然后重复(3)(4)步骤
(5)make
(6)make install,安装成功会生成一个目录里面包含openssl.so


安装完成更新php.ini

修改php.ini文件,首先应设置一个扩展组件的存放目录,例如我的存放目录为/data/php/ext,那么修改php.ini中的extension_dir为extension_dir = "/data/php/ext",然后在扩展组件最后添加extension=openssl.so,最后保存文件

重启php和nginx

php -i验证是否安装成功.

ngork

介绍

http://www.ittun.com/apply.html
服务器端命令
sudo ./ngrokd -domain="i.lirawx.live" -httpAddr=":8080" -httpsAddr=":443" -tunnelAddr=":44433"

客户端命令
ngrok -subdomain test 80

tomcat 重启脚本

#!/bin/bash  
export BUILD_ID=dontkillme #必须加  
TOMCATTHREAD=`ps aux | grep '/usr/local/tomcat/apache-tomcat-8.0.47/' | grep -v grep`  
if test -z "$TOMCATTHREAD"  
then  
   echo "TOMCAT NOT START"  
else  
    THREADLIST=(${TOMCATTHREAD// / })  
    PID=${THREADLIST[1]}  
    kill -9 $PID  
    sleep 3s  
fi  
   cd /usr/local/tomcat/apache-tomcat-8.0.47/webapps  
   rm -f CSJ-Buttonz.war  
   rm -rf CSJ-Buttonz  
   cd /usr/local/tomcat/apache-tomcat-8.0.47/bin  
   ./startup.sh  
   sleep 5s
``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.