blog's People
blog's Issues
In-App Purchase(苹果内购)
https://support.apple.com/zh-cn/HT202023
1 支付流程
IOS 应用内购( In App Purchase)有两种模式:
- 单机模式
- 服务端模式
由于单机模式有安全风险,这里只讲服务器模式,服务端模式的主要流程如下所示:
- App 从服务器获取产品标识列表
- App 从 App Store 获取产品信息
- 用户选择需要购买的产品
- App 发送支付请求到App Store
- App Store 处理支付请求,返回 transaction 信息
- App 将transaction receipt 发送到服务器
- 服务器收到收据后发送到 App Stroe 验证收据的有效性
- App Store 返回收据的验证结果
- 根据 App Store 返回的结果决定用户是否购买成功
2 服务端验证receipt
import requests
receipt = "......"
r = requests.post('https://sandbox.itunes.apple.com/verifyReceipt',json={"receipt-data": receipt,"password": '******'})
r.status_code
r.json()
Status | 描述 |
---|---|
21000 | App Store不能读取你提供的JSON对象 |
21002 | receipt-data域的数据有问题 |
21003 | receipt无法通过验证 |
21004 | 提供的shared secret不匹配你账号中的shared secret |
21005 | receipt服务器当前不可用 |
21006 | receipt合法,但是订阅已过期。服务器接收到这个状态码时,receipt数据仍然会解码并一起发送 |
21007 | receipt是Sandbox receipt,但却发送至生产系统的验证服务 |
21008 | receipt是生产receipt,但却发送至Sandbox环境的验证服务 |
Centos7 hostnamectl update hostname (Centos7 修改主机名)
// 查看主机名
hostnamectl// 修改主机名
hostnamectl set-hostname
/etc/hostname 将被自动更新,/etc/hosts 需要手工更新。
hostname规范:
用途[序号].业务线.机房位置.域名
Extra Packages for Enterprise Linux (企业版 Linux 附加软件包)
1 什么是EPEL?
企业版 Linux 附加软件包(以下简称 EPEL)是一个 Fedora 特别兴趣小组,用以创建、维护以及管理针对企业版 Linux 的一个高质量附加软件包集,面向的对象包括但不限于 红帽企业版 Linux (RHEL)、 CentOS、Scientific Linux (SL)、Oracle Linux (OL) 。
https://fedoraproject.org/wiki/EPEL/zh-cn
2 安装
yum install epel-release
Yum Cheatsheet (速查表)
升级相关命令:
yum update : 安装所有更新软件
yum update xxx : 仅更新指定的软件
yum check-update : 列出所有可更新的软件清单
yum list : 列出所有可安裝的软件清单
安装删除相关命令:
yum install xxx: 仅安装指定的软件
yum remove xxx: 删除指定的软件包
yum查询相关命令:
yum search : 使用YUM查找软件包
yum list : 列出所有可安装的软件包
yum list updates : 列出所有可更新的软件包
yum list installed : 列出所有已安装的软件包
yum list extras : 列出所有已安装但不在 Yum Repository 內的软件包
yum info xxx: 使用YUM获取软件包信息
yum info : 列出所有软件包的信息
yum info updates : 列出所有可更新的软件包信息
yum info installed : 列出所有已安裝的软件包信息
yum info extras : 列出所有已安裝但不在 Yum Repository 內的软件包信息
yum provides : 列出软件包提供哪些文件
yum缓存相关命令:
yum makecache : 生成元数据缓存
yum clean packages : 清除缓存目录(/var/cache/yum)下的软件包
yum clean headers : 清除缓存目录(/var/cache/yum)下的 headers
yum clean oldheaders : 清除缓存目录(/var/cache/yum)下旧的 headers
yum clean, yum clean all (= yum clean packages; yum clean oldheaders) : 清除缓存目录(/var/cache/yum)下的软件包及旧的headers
yum -y update : #手动系统更新
yum install [-y] [rpm包名]:以非交互式(默认选择y)的方式安装指定包
Centos 7 更新安全补丁
- 检查安全补丁
yum --security check-update
- 更新安全更新
yum --security update
Support Life Cycles for Enterprise Linux Distributions(企业Linux发行版支持生命周期)
Support Life Cycles for Enterprise Linux Distributions
Use Public Key Authentication with SSH (SSH证书登录)
1、创建证书
ssh-keygen -t rsa
cat id_rsa.pub >> authorized_keys
文件名 | 说明 |
---|---|
id_rsa | 证书私钥 |
id_rsa.pub | 证书公钥 |
ssh公钥生效需满足至少下面两个条件:
- .ssh目录的权限必须是700
- .ssh/authorized_keys文件权限必须是600
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
2、配置文件
vi /etc/ssh/sshd_config
# SSH端口
Port 2022
#使用证书登陆 证书公钥文件位于.ssh/authorized_keys
RSAAuthentication yes # Centos 7中已废弃,可需要设置PubkeyAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# 禁止使用密码登陆
PasswordAuthentication no
3、重启服务
systemctl restart sshd.service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.