Odoo10 macOS开发环境配置

  1. 执行 xcode-select --install ,如果已安装请忽略
  2. 下载odoo10,执行 git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 --single-branch odoo10
    1. 速度慢使用镜像: git clone https://gitee.com/mirrors/odoo.git --depth 1 --branch 10.0 --single-branch odoo10
  3. 安装pip
    1. curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
    2. python get-pip.py
    3. 需要在.bash_profile.zprofile添加export PATH=~/Library/Python/2.7/bin:${PATH}
    4. pip镜像使用,执行pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
      1. 镜像说明: https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
Read more   2023/05/12 posted in  Python 后端

nginx certbot 免费泛域名证书

系统: CentOS 7

Read more   2023/05/12 posted in  后端

nginx 配置https

update: 2018-08-20

已支持泛域名申请:https://certbot.eff.org/

Trying to get a wildcard certificate? Please use the dropdown menus below to get instructions specific to your system, and read those instructions carefully.


$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx 
$ service nginx stop
$ certbot certonly --standalone --email your@email.com -d yourdomain.com

安装参考:[https://www.cnblogs.com/SzeCheng/p/8075799.html](https://www.cnblogs.com/SzeCheng/p/8075799.html)
证书三个月需要续签一次,使用crontab每个月检查一次,自动续期
0 0 1 * * certbot renew -q --pre-hook "service nginx stop" --post-hook "service nginx start"

2023/05/12 posted in  后端

Ubuntu 14.04.5 安装 MySQL 5.7

安装

下载地址:https://dev.mysql.com/downloads/mysql/

  • wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.21-1ubuntu14.04_amd64.deb-bundle.tar
Read more   2023/05/12 posted in  后端

MySQL+Koa从0开始

2023/05/12 posted in  后端

linux一些命令

linux文件权限

-rw------- (600) 只有所有者才有读和写的权限
-rw-r--r-- (644) 只有所有者才有读和写的权限,组群和其他人只有读的权限
-rwx------ (700) 只有所有者才有读,写,执行的权限
-rwxr-xr-x (755) 只有所有者才有读,写,执行的权限,组群和其他人只有读和执行的权限
-rwx--x--x (711) 只有所有者才有读,写,执行的权限,组群和其他人只有执行的权限
-rw-rw-rw- (666) 每个人都有读写的权限
-rwxrwxrwx (777) 每个人都有读写和执行的权限

Every possible UNIX/Linux file permission: Listed and explained (All 4,096 of them)

Read more   2023/05/12 posted in  Linux

Swift方法声明可选参数

声明

str2:String? = nil

如:

func test(str:String, str2:String? = nil){
}
test("哈哈");
test("哈哈", str2: "哈哈哈");
2023/05/12 posted in  iOS

查看Swift代码执行时间

func measure(title: String!, call: () -> Void) {
    let startTime = CACurrentMediaTime()
    call()
    let endTime = CACurrentMediaTime()
    if let title = title {
        print("\(title): ")
    }
    print("Time - \(endTime - startTime)")
 }
Read more   2023/05/12 posted in  iOS

Swift常用类库

awesome-swift

这里收集了一些常用的swift类库

https://github.com/matteocrippa/awesome-swift

awesome-ios

当然还有OC的

https://github.com/vsouza/awesome-ios

Read more   2023/05/12 posted in  iOS