Controlling the exam with Python

Predicaments

We’re asked to learn a library about safety.

However, if the duration is greater than 5 minutes (~300 seconds), we need to click agree to let the timing continue. So, when we finish the learning progress, we’ll click 6*60/5 = 72 times ……..

Read More

Trick of binned_statistic_2d

Official example

>>> from scipy import stats

Calculate the counts with explicit bin-edges:

>>> x = [0.1, 0.1, 0.1, 0.6]
>>> y = [2.1, 2.6, 2.1, 2.1]
>>> binx = [0.0, 0.5, 1.0]
>>> biny = [2.0, 2.5, 3.0]
>>> ret = stats.binned_statistic_2d(x, y, None, 'count', bins=[binx,biny])
>>> ret.statistic
array([[ 2., 1.],
[ 1., 0.]])

Read More

Send e-mail when file modified

mailx

Download mailx (openSUSE is the distribution of my server) and install it.

$ make PREFIX=/public/home/zhangxin/softwares/mailx SYSCONFDIR=/public/home/zhangxin/softwares/mailx/etc
$ make install UCBINSTALL=/usr/bin/install PREFIX=/public/home/zhangxin/softwares/mailx SYSCONFDIR=/public/home/zhangxin/softwares/mailx/etc

Get your authorization code and edit mailx/etc/nail.rc

set smtp=smtp.qq.com
set smtp-auth-user="[email protected]"
set smtp-auth-password="authorization_code"
set smtp-auth=login

Read More

Set up personal Anaconda mirror

Predicaments

If you encounter any problems as follows, you should try to set up a personal Python(Anaconda) mirror:

  1. Deploy a python environment on servers that have no access to the Internet;
  2. Deploy a python environment which can be used directly by other users on the server;
  3. Internet speed or connection to cloud mirror is slow.

Steps

Installation

Just install Anaconda according to this guide.

Of course, you can download Anaconda installer archive from here.

Download(mirror)

You can use wget to mirror the packages from official Anaconda websites or other mirror websites (TUNA and USTC).

If your server is located in China, I recommend the later one.

I’ll take the later one as example.

Read More

万千之思

此梦,体悟心中,怖,惘,怅,豁,悦,茫,屈,震,清。

续恐怖之屋,开门只见黑色乌云悬于屋内,变为惊惧之丝,缠绕心头。

抛思绪之绳,牵云欲走,然屋顶黑洞旋转,万种灵魂奔逃,欲吞噬。

同行之友心伤重。

未几,相约谈于北点楼。然吾被邀歌于楼。欣悦而无感,倚于墙,似卧于树,一言不发。

欲言而无声,突生悲戚。群人讥笑而去,唯两三好友,掏逝词,签并诵之。

一言一词,皆自肺腑,经地狱之火,灼心至深。

境地

境地之见,

唯相通者方可领会。

春日之花

若诉与

冬天之树,

恐如融化之雪,

物是形非。

兴奋

兴奋,

这种按捺不住的喜悦,

应为简单纯粹:

半夜,

期待着

明日的皑雪,

守盼着

来年的新物。

纽扣

纽扣

并非只是维系

亦可联结,创造

而一切的本质,重心

应为原本的衣物

Create RAID 5

Reference: https://www.tecmint.com/create-raid-5-in-linux/

Install mdadm and verify drives

yum install mdadm

mdadm -E /dev/sd[b-h]

mdadm: No md superblock detected on /dev/sdc.
mdadm: No md superblock detected on /dev/sdb.
mdadm: No md superblock detected on /dev/sdd.
mdadm: No md superblock detected on /dev/sde.
mdadm: No md superblock detected on /dev/sdf.
mdadm: No md superblock detected on /dev/sdg.
mdadm: No md superblock detected on /dev/sdh.

Partitioning the Disks for RAID

Actually this is optional. If you want to partition first, you should make sure you’re using gpt or others which support larger than 2T.

Create /dev/sdb Partition

Please follow the below instructions to create partition on /dev/sdb drive.

fdisk /dev/sdb

Read More


Powered by Hexo and Hexo-theme-hiker

Copyright © 2013 - 2019 Dreambooker All Rights Reserved.

UV : | PV :