學校給我一台舊電腦(CPU:Sempron 64 3100+ 1.8Ghz,RAM:512MB)
於是我買了二手RAM:1G*2 300塊含運
電腦就順多了:D
1 2 3 4 f = open("/sys/class/thermal/thermal_zone0/temp","r") for t in f: print "CPU temp:"+t[:2]+"."+t[2:5] f.close()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 import urllib,random,re ip_regex = re.compile("(([0-9]{1,3}\.){3}[0-9]{1,3})") def public_ip(): ''' Returns your public IP address. Output: The IP address in string format. None if not internet connection available. ''' # List of host which return the public IP address: hosts = """http://www.
UNO’s autoindex
Apache autoindex style
FancyIndex
usr’z autoindex
fuchcz’s apache-autoindex-theme
Linux預設帳號設定檔路徑
/etc/skel/
最近我同學問我這個背景移動特效要怎麼用
他以為是JQuery寫出來的
結果我找了老半天,原來是CSS3
animation:160s linear 0s normal none infinite animatedBackground
1
2
3
|
name {
animation: name duration timing-function delay iteration-count direction fill-mode play-state;
}
|
text-overflow: ellipsis;
1 text-overflow: clip|ellipsis|string|initial|inherit; 資料來源:
http://www.w3schools.com/cssref/css3_pr_text-overflow.asp
修改使用者帳號資訊(管理者)
usermod -l newname username # 變更使用者帳號名稱 usermod -o -u 101 username # 變更使用者 UID usermod -g users username # 變更使用者主要群組 usermod -G mis,sales username # 變更使用者次要群組 usermod -c “manager” username # 修改使用者註解內容 usermod -m -d /home/user username # 變更使用者家目錄路徑 usermod -s /usr/bin/ksh username # 變更使用者預設 Shell usermod -e 1/1/2010 username # 變更使用者過期期限 usermod -p FEeig.jYifke username # 變更使用者密碼 來源:http://blog.yam.com/gavint/article/23264761
Linux usermod -p 修改用户密码
passwd也可以修改口令,但是这是一种交互式的方式,需要用户干预。当然也可以使用重定向或者管道向passwd喂数据,暂且不提。
linux下增加用户的命令是useradd,修改用户的命令是usermod,二者都有一个参数 –p,这个参数可以直接指定用户的口令,但是需要注意的是,这个口令并不是明文,而是经过加密的一个字串。
linux下可以用python编辑器通过编程的方法得到加密字串(linux下用python命令启动编辑器):
下面是一个完整的过程,蓝色字体的是用户输入的命令,而红色的是系统输出。
收集一些網路覺得不錯的東西,會記錄下面。
希望有時間要找過去想看的,也是非常方便的一件事。