This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <arpa/inet.h> | |
#include <sys/socket.h> | |
#define BUF_SIZE 1024 | |
void error_handling(char *message); | |
int main(int argc, char *argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <arpa/inet.h> | |
#include <sys/stat.h> | |
#include <sys/socket.h> | |
#include <fcntl.h> | |
#define BUF_SIZE 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_logger(self): | |
>> 18 filename = "/access.log" if self.log_name == "access_log" else "/server.log" | |
17 fmt = ( | |
>> 16 "%(color)s[%(levelname)1.1s %(asctime)s {listen_port}:%(module)s:%(lineno)d:%(funcName)s] %(end_color)s" | |
15 "%(message)s".format(listen_port=ServerBaseConfig["listen_port"]) | |
14 ) | |
13 import os | |
12 | |
11 if not os.path.isdir(ServerBaseConfig["log_dir"]): | |
10 os.mkdir(ServerBaseConfig["log_dir"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotifierOP(Notifier): | |
def __init__(self): | |
pass | |
def send_message(self, message): | |
self.post_process(message) | |
def post_process(self, message): | |
""" | |
Process error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
redis = "*" | |
logzero = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from tornado import httpclient, gen, queues | |
from tornado import escape | |
import os | |
# test | |
from tornado.ioloop import IOLoop | |
from apscheduler.schedulers.tornado import TornadoScheduler |