字幕校准脚本

1 先在编辑器把时间补充上,内容写上特殊字符,如 OOO
2 然后下载字幕文件如 srt, 拷贝到 linux 下,存成 v.txt
3 运行 ad.py 会把 OOO 杭内容过滤掉,后面的内容依次往上提。
代码如下:

#!/usr/bin/env python

if name == 'main[......]

查看更多内容

Posted in DEVOPS | 1 Comment

rpm 宏定义文档

路径为:
/usr/lib/rpm/macros

内容为:
#/*! \page config_macros Default configuration: /usr/lib/rpm/macros

\verbatim

#

This is a global RPM configuration f[……]

查看更多内容

Posted in DEVOPS | rpm 宏定义文档已关闭评论

suse 上apache 启用 module_headers 并配置 cache-control

启用 headers_moule

在 centos 配置比较简单,只需要 loadmodules 即可:

cat /etc/httpd/conf.modules.d/00-base.conf | grep headers
LoadModule headers_module modules[......]

查看更多内容

Posted in web和容器 | suse 上apache 启用 module_headers 并配置 cache-control已关闭评论

nginx + uwsgi 配置 flask 开发框架

介绍

类似于,nginx 结合 php-fpm 可以支持跳转到 php 程序一样,nginx 后端也可以挂 uwsgi 来用 python 程序作为server端。

参考文档

《一个UWSGI的例子》:https://blog.csdn.net/crazyhacking/article/det[……]

查看更多内容

Posted in web和容器 | nginx + uwsgi 配置 flask 开发框架已关闭评论

nginx + php-fpm 的简易配置

nginx 转发到 php-fpm

安装软件

yum install nginx -y
yum install php-fpm -y

配置nginx

在 /etc/nginx/conf.d/default.conf 基础上直接修改,就可以作为你的应用使用:

server {
    li[......]

查看更多内容

Posted in DEVOPS, web和容器 | nginx + php-fpm 的简易配置已关闭评论

python 的 PIL 生成图片


#!/usr/bin/env python

-- coding: utf-8 --

"""
author= 'Du'
creation_time= '2018/1/5 9:08'
"""

import os, math
import sys
from PIL import Image[......]

查看更多内容

Posted in DEVOPS | python 的 PIL 生成图片已关闭评论

python 字符串操作通用异常处理


#!/bin/env python

-- coding: utf-8 --

import json

a={}
a['name'] = "test"
a['age'] = '18'
b="fdsfdsfdsfd"
a1=[]
a1.append(a)

try:
str1=json.d[......]

查看更多内容

Posted in DEVOPS | python 字符串操作通用异常处理已关闭评论

git 使用技巧

push时报错:

git push origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com

如下解决:

在远程主机生成 ssh key 文件[……]

查看更多内容

Posted in DEVOPS | 1 Comment