峯言凬语 O ever youthful O ever weeping~
本无意与众不同,怎奈何口味太重。
首页
平水韵
颜色表
ABOUT
文章分类
友情链接
您正在查看:2019年3月
在win+R快捷键打开运行,输入diskpart。
输入 list part
sel disk x 
list part
sel part x
最后输入“set id=C12A7328-F81F-11D2-BA4B-00A0C93EC93B”,把x换成EFI分区。
2019-03-26 |Nonni

Typecho默认是不支持emoji的,这也是因为编码的问题。这时,只需要将数据库的编码utf8修改为utf8mb4就好了。还有一点,utf8mb4编码只有在MySQL5.5.3以后才支持的。

如果你的博客还没搭好的话,也可以在创建数据库时排序规则使用utf8mb4,这样就可以跳过第一个步骤。
1.修改数据库编码

进入PhpMyAdmin,选择你安装Typecho的数据库。菜单栏里进入操作,找到“排序规则”,选择utf8mb4_unicode_ci。
2.修改表的编码

在菜单栏里进入SQL,执行以下语句。

alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_relationships convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_unicode_ci;

3.修改Typecho配置文件

在网站根目录里找到“config.inc.php”,找到这一段代码。

$db->addServer(array (
'host' => localhost,
'user' => 'youruser',
'password' => 'yourpassword',
'charset' => 'utf8mb4', //修改这一行
'port' => 3306,
'database' => 'yourdatabase'
), Typecho_Db::READ | Typecho_Db::WRITE);

a.使用语法:
check interval=milliseconds [fall=count] [rise=count] [timeout=milliseconds] [default_down=true|false] [type=tcp|http|ssl_hello|mysql|ajp] [port=check_port]

b.默认值:
如果没有配置参数,默认值是:interval=30000 fall=5 rise=2 timeout=1000 default_down=true type=tcp

c.上下文: upstream模块

upstream mogo {

server mogo:8080 weight=4;
server mogo2:8080 weight=4;
check interval=3000 fall=5 rise=2 timeout=1000;
ip_hash;

}

对mogo负载均衡条目中的所有节点,每个3秒检测一次,请求 2 次正常则标记realserver状态为up,如果检测 5 次都失败,则标记 realserver的状态为down,超时时间为1秒.

nginx负载均衡策略:

a.RR(Round Robin-默认) - 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,会自动剔除。

b.ip_hash - 客户端ip绑定,每个请求按访问ip的hash结果分配,这样每个访客固定访问一个后端的服务器,可以解决session问题。

c.least_conn - 最少连接,下一个请求将被分配到活动连接数量最少的服务器。

Linux或Mac首次运行Android Studio,报如下的错误:

ERROR: Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-25 Android SDK Platform 25
build-tools;28.0.2 Android SDK Build-Tools 28.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
...

错误提示没有接受Licence,在widnows下不存在这种报错,因为在点击"下一步"的过程中勾选了"I Agree",Linux和Mac下需要切换到SDK的Tools文件夹下,执行:

$ cd /home/xiaotang/Android/Sdk/tools/bin
$ ./sdkmanager --licenses

然后一路Y。

Warning: File /home/xiaotang/.android/repositories.cfg could not be loaded.
5 of 5 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? y

1/5: License android-googletv-license:

Terms and Conditions

...

Accept? (y/N): y
All SDK package licenses accepted