- 博客(7)
- 资源 (10)
- 收藏
- 关注
原创 crontab 启动定时任务
Linux 主要命令列出进程的id:ps | grep "sh ./run.sh" | grep -w "sh ./run.sh" | grep -v "grep" | awk '{print $1}列出 python main.py 进程的个数ps |grep "python main.py"|grep -v grep|wc -lcrontab 定时监测脚本,监测python ...
2019-06-24 13:04:27 1991
原创 codeigniter的Redis使用
Redis的配置和简单使用1:1.system/config/redis.php:<?php$config['redis_host'] = '127.0.0.1';$config['redis_port'] = '6379';$config['redis_isopen'] = true;./application/config/config.php:r...
2019-06-19 01:02:21 926
转载 crontab 详细用法,定时任务,时间规则
Linux crontab和Windows task schedules非常的相似。Crontab可以用来在系统中定期的执行任务。比如:写了一个爬虫需要每天早上八点执行,就可以用到Crontab;安装的Tomcat服务器需要每天凌晨重启一次,也可以使用到Crontab。总之,几乎所有的定时任务,我们都可以通过Crontab这个工具来完成。安装:apt-get install cron查看C...
2019-06-12 22:02:00 3350 1
原创 bash 脚本检测程序中断后重启
#!/bin/bash while true do procnum=` ps |grep "python main.py"|grep -v grep|wc -l` if [ $procnum -eq 0 ]; then python main.py fi sleep 600 done
2019-06-12 21:54:46 429
原创 c++ 单例模式
#include <iostream>#include <vector>class SingleClass{public: static std::shared_ptr<SingleClass> GetSingle(); // 禁止拷贝构造函数 SingleClass(const SingleClass& single)= d...
2019-06-08 15:50:47 116
原创 C++ 静态断言(static_assert)
简介:c++0x 中引入了static_cast 这个关键字。可以在 编译期间检测模版函数是不是正确。下面是一个来自MSDN的简单范例:static_assert(sizeof(void *) == 4, "64-bit code generation is not supported.");该static_assert用来确保编译仅在32位的平台上进行,不支持64位的平台,该语句可以放...
2019-06-05 23:34:11 695
转载 c++使用宏检测类是否包含某个函数或者变量属性
对于特定的函数或者变量属性检测一个特定的参数类:#include <iostream>#include <boost/smart_ptr.hpp>#include <type_traits>using namespace boost;using namespace std;#define _CAT(A, B) A##B#define STR(s...
2019-06-05 23:12:19 2008 1
McGrawHill_-_Machine_Learning_-Tom_Mitchell课后答案
2016-04-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人