ESXI install patch under 5.1.0

youtube上有个视频教程,做的很好,详细看下面链接:
https://www.youtube.com/watch?v=_O0Pac0a6g8

下面是升级过程简述:

1. 开启ESXI的SSH:
esxi-ssh
完整阅读

Python – Spaceship 讲解

1. 引用相关的module

import simplegui
import math
import random

2. 全局参量

WIDTH = 800 # 画布的宽
HEIGHT = 600 # 画布的高
score = 0 # 初始分数0
lives = 3 # 3条命
time = 0.5 # 时间为0.5
FRICTION = 0.95 #摩擦系数

完整阅读

Python Simplegui Images

Simplegui中的图片加载功能不是特别熟悉,每次用都要查文档,比较麻烦,所以我把解释放到这里以备复习:

import simplegui
 
def draw_handler(canvas):
    canvas.draw_image(image, (1521 / 2, 1818 / 2), (1521, 1818), (200, 200), (100, 100))
#(1521 / 2, 1818 / 2):图片的中心位置
#(1521, 1818):图片的实际大小
#(200, 200):画布的中心位置
#(100, 100):缩放到100X100,这个值跟画布大小有关
 
image = simplegui.load_image('http://commondatastorage.googleapis.com/codeskulptor-assets/gutenberg.jpg')
 
frame = simplegui.create_frame('Testing', 600, 600)
#画布的尺寸600X600
frame.set_draw_handler(draw_handler)
frame.start()

Python Classes 类的概念

参加《An Introduction to Interactive Programming in Python》有一段时间了,快结课了,这是第5期,前几周都没总结,到了week 6,发现听着有点困难,到了我最不理解的“类”这块,所以把老师讲的案例拿出来,加了一些说明,强加记忆吧,日后用多了,希望能有更新的理解,然后再更新此文章
PS:大学时JAVA就没学好,特别是继承和类这块。。。

class Ball:
#类的名字首字母大写
    def __init__(self, pos, rad):
    #init是初始方法,这个初始函数不需要任何返回值
        self.position = pos
        self.radius = rad
    
    def get_position(self):
        return self.position

b = Ball([0,0], 10)
#b作为类Ball的一个对象,执行这个时,除了传递[0,0]和10外,还会传递b本身,其实b就是self

print b.get_position()
#b作为对象调用Ball类中的方法get_position

TigerVNC on RHEL7/Centos7

Install TigerVNC

[root@trex-161 ~]# yum install xterm xorg-x11-xinit
[root@trex-161 ~]# yum -y install tigervnc tigervnc-server
[root@trex-161 ~]# systemctl disable firewalld.service
[root@trex-161 ~]# systemctl stop firewalld.service
[root@trex-161 ~]# cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
[root@trex-161 ~]# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

Enable TigerVNC – Way1

ps: follow content of ”[email protected]“ had changed

[root@trex-161 ~]# vim /etc/systemd/system/vncserver@:1.service 
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 1024x768"
PIDFile=/home/root/.vnc/%H%i.pid
[root@frank rc.d]# chmod 777 rc.local
[root@frank rc.d]# vim rc.local 
/sbin/runuser -l root -c /usr/bin/vncserver :1
完整阅读
blonde teen swallows load.xxx videos