MySQL utf8mb4

my.cnf

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
collation-server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character_set_server = utf8mb4

如果是设置成utf8的话

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

如果你的数据表不是utf8mb4,那么我们应该如何存储utf8mb4的字符呢?

你可以 uri_escape 后再存储,用的时候 uri_unescape


这篇文章: 有用 无用 创建 2016-11-08 07:23:39 / 更新 2017-02-03 14:34:20

硬盘的挂载

什么是 sda sdb

/dev/sda 表示第一块硬盘

/dev/sda1 表示第一块硬盘的第一个分区

/dev/sda2 表示第一块硬盘的第二个分区

/dev/sdb 表示第二块硬盘

怎样查看硬盘

sudo fdisk -l

怎样查看已经挂载的硬盘

df -h    
mount
nfsstat -m
cat /etc/mtab
cat /etc/fstab

怎样挂载硬盘

# -o 如果有多个参数,用","隔开
mount -a # 依照配置文件 /etc/fstab 的数据将所有的未挂载的磁盘都挂载上来
mount /dev/sdc2 /mnt/sdc2 # 挂载Ext2/Ext3文件系统
mount -t vfat -o iocharset=cp950 /dev/sdb1 /mnt/flash  # 挂载U盘

怎样将设备文件卸载

unmount [-fn] 挂载点 
-f 强制卸载 
-n 不更新 /etc/mtab 的情况下卸载    

unmount /mnt/flash

文件系统 NFS

Network File System

挂载上了,但是 df -h 看不到

挂载的时候需要添加 -o nfsvers=2 或者 -o vers=2

nfsvers=2 or nfsvers=3 — Specifies which version of the NFS protocol to use. This is useful for hosts that run multiple NFS servers. If no version is specified, NFS uses the highest supported version by the kernel and mount command. This option is not supported with NFSv4 and should not be used.

这篇文章: 有用 无用 创建 2016-10-31 00:58:22 / 更新 2016-11-25 03:55:25

JavaScript DOM 学习[2]

document.title
document.baseURI    
document.URL
document.documentURI
document.referrer
document.domain

document.body                  # Returns the <body> element
document.documentElement           # Returns the <html> element
document.cookie

document.scripts                   # Returns all <script> elements
document.forms
document.links                     # Returns all <area> and <a> elements that have a href attribute

这篇文章: 有用 无用 创建 2016-10-27 06:37:49 / 更新 2016-10-27 06:40:34

JavaScript DOM 学习[1]

http://www.w3schools.com/js/js_htmldom.asp

# DOM(Document Object Model)

# The document object represents your web page.

# If you want to access any element in an HTML page, you always start with accessing the document object.

# The innerHTML property can be used to get or change any HTML element, including <html> and <body>.

# document.getElementById(id)
# document.getElementsByTagName(name)
# document.getElementsByClassName(name)

# element.innerHTML =  new html content
# element.attribute = new value
# element.setAttribute(attribute, value)
# element.style = new style

<html>
<body>

<p id="demo">Hi</p>

<script>
alert(document.getElementById("demo").innerHTML);
document.getElementById("demo").innerHTML = "Hello World!";
</script>

</body>
</html>

这篇文章: 有用 无用 创建 2016-10-26 22:01:56 / 更新 2017-02-07 14:58:21

JavaScript 如何捕获匹配数据

var myString = "something format_abc";
var myRegexp = /format_(.*?)/;
var match = myRegexp.exec(myString);
console.log(match[1]); // abc

这篇文章: 有用 无用 创建 2016-10-26 07:17:41 / 更新 2017-02-07 14:58:28