国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| #!/usr/bin/env python2 | |
| #-*- coding=utf-8 -*- | |
| # © 2013 Mark Harviston, BSD License | |
| from __future__ import absolute_import, unicode_literals, print_function | |
| """ | |
| Qt data models that bind to SQLAlchemy queries | |
| """ | |
| from PyQt4 import QtGui | |
| from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt | |
| import logging # noqa |
| import socket | |
| from cherrypy import wsgiserver | |
| from app import application | |
| server = wsgiserver.CherryPyWSGIServer( | |
| bind_addr=('0.0.0.0', 9808), | |
| wsgi_app=application, | |
| request_queue_size=500, | |
| server_name=socket.gethostname() | |
| ) |
| #!/bin/bash | |
| Version=$(lsb_release -c --short) | |
| Codename=$(lsb_release -r --short) | |
| OSArch=$(uname -m) | |
| User=$(whoami) | |
| # 设置 sudo 免密码 | |
| echo "$(whoami) ALL=(ALL) NOPASSWD : ALL" | sudo tee /etc/sudoers.d/nopasswd4sudo |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| def check_password(): | |
| """Returns `True` if the user had a correct password.""" | |
| def password_entered(): | |
| """Checks whether a password entered by the user is correct.""" | |
| user = authenticate( | |
| username=st.session_state['username'], | |
| password=st.session_state['password'] | |
| ) | |
In this tutorial we assume to launch a distributed training on 2 nodes using DeepSpeed with the OpenMPI Launcher.
# generate a public/private ssh key and make sure to NOT insert a passphrase
ssh-keygen -t rsa
# copy public key 'id_rsa' on the MASTER and SLAVE
| function renderPdfByBase64(base64Data) { | |
| var currPage = 1; // 当前页面 | |
| var numPages = 0; // 总页数,由getDocument后获取 | |
| var thePDF = null; | |
| var pdfData = base64ToUint8Array(base64Data); | |
| PDFJS.getDocument(pdfData).then(function(pdf) { | |
| thePDF = pdf; | |
| numPages = pdf.numPages; | |
| pdf.getPage(1).then(handlePages); | |
| }); |
I'll help you build a 4x4 tic-tac-toe game in Python with a clean terminal interface. Let me create a comprehensive plan for this project.
Game Board Management