- Install SQUID
apt-get install squid- Create an user
htpasswd -md /etc/squid3/users myuserlogin`| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| CC = gcc | |
| CFLAGS = -O3 -Wall -Wextra | |
| LDFLAGS = -lm | |
| all: microgpt | |
| microgpt: microgpt.c | |
| $(CC) $(CFLAGS) microgpt.c -o microgpt $(LDFLAGS) | |
| clean: |
| # OpenResty 默认安装在 /usr/local/openresty | |
| # 该文件应该放在 /usr/lib/systemd/system/nginx.service | |
| # 放好后请运行: | |
| # - systemctl enable nginx.service | |
| # - systemctl start nginx.service | |
| # 然后之后就可以用 service nginx [start/reload/stop] 等命令了 | |
| [Unit] | |
| Description=The nginx HTTP and reverse proxy server | |
| After=syslog.target network.target remote-fs.target nss-lookup.target |
| # install haproxy | |
| yum install -y haproxy | |
| # config haproxy for rabbitmq | |
| cat > /etc/haproxy/haproxy.cfg << "EOF" | |
| global | |
| log 127.0.0.1 local0 notice | |
| maxconn 10000 | |
| user haproxy |
| # -*- coding: utf-8 -*- | |
| """ | |
| Generate a file tree table of contents for a directory of markdown files | |
| run from command line: | |
| $ python md_file_tree.py | |
| will generate a markdown index of all markdown files in the current working | |
| directory and its sub folders and insert it into a file `index.md`. |
apt-get install squidhtpasswd -md /etc/squid3/users myuserlogin`| /** | |
| * Check emoji from string | |
| * | |
| * @return bool if existed emoji in string | |
| */ | |
| function checkEmoji($str) | |
| { | |
| $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; | |
| preg_match($regexEmoticons, $str, $matches_emo); | |
| if (!empty($matches_emo[0])) { |
| import sys | |
| from SimpleHTTPServer import SimpleHTTPRequestHandler | |
| import BaseHTTPServer | |
| def test(HandlerClass=SimpleHTTPRequestHandler, | |
| ServerClass=BaseHTTPServer.HTTPServer): | |
| protocol = "HTTP/1.0" | |
| host = '' |
| #!/bin/sh | |
| # | |
| # rabbitmq-server RabbitMQ broker | |
| # | |
| # chkconfig: - 80 05 | |
| # description: Enable AMQP service provided by RabbitMQ | |
| # | |
| ### BEGIN INIT INFO | |
| # Provides: rabbitmq-server |
| /* This is the original elf.h file from the GNU C Library; I only removed | |
| the inclusion of feature.h, which is not needed. | |
| On OSX, simply copy the file to /usr/local/include/. | |
| Mathias Lafeldt <mathias.lafeldt@gmail.com> */ | |
| /* This file defines standard ELF types, structures, and macros. | |
| Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011 | |
| Free Software Foundation, Inc. |