因为当时买腾讯云偷了个懒,想着低配也得有性能。所以就买了本地磁盘,结果,本地磁盘不能升配。所以就关机做镜像,然而。。。镜像要时间,在做的时候,我关闭了窗口。。结果 就忘了这事。
一天没有启动服务器。真尴尬
膘叔的简单人生
因为当时买腾讯云偷了个懒,想着低配也得有性能。所以就买了本地磁盘,结果,本地磁盘不能升配。所以就关机做镜像,然而。。。镜像要时间,在做的时候,我关闭了窗口。。结果 就忘了这事。
一天没有启动服务器。真尴尬
基于昨天写的vue+blade+(vue-pjax-adapter),发现没有任何进度提示,感觉比较不直观,但vue-pjax-adapter不能注入方法(或许是我不会)。
window.axios.interceptors.request.use((config) => {
console.log(before);
NProgress.configure({easing: 'ease', speed: 1000, showSpinner: true});
NProgress.start();
return config;
});
window.axios.interceptors.response.use((response) => {
NProgress.done();
console.log(after);
return response;
}, (error) => {
return Promise.reject(error);
});
import nPjaxAdapter from 'vue-nprogress-pjax';
window.Vue.use(nPjaxAdapter);
/**
* 如果不是标准的pjax-container,就是这样使用
* // window.Vue.use(nPjaxAdapter, {
// targetSelector: '#my-custom-target',
// });
*/
就这样简单。现在切换页面有进度条了
如题,利用laravel-mix进行开发。HTML页面的blade,基本上只含主体结构 。具体的页面全部用vue加载(当成一个个的component)
测试了一下,将MYSQL升到了5.7的RDS,但该RDS因为不支持MYISAM,所以将表结构调整为INNODB,同时,因为PHP版本是7.2,可能带来了不少问题。
先这样尝试了。后续有问题我再调整。可能会慢上好多(很纠结)
报了很多异常。估计后续真的要转成Yii2了。其实5年前转过一次。那时候是用Yii1的,但因为中间要改的东西非常多,在写了2/3左右 的时候处理掉了。现在可能真的要重操起来了。(话说,现在PHP的博客好象也就只剩那几个了,什么Wordpress,Typecho还坚挺 的活着。)
是不是要坚持还真是一说。
在网上找了半天,找到两个项目与此相关
db2struct --host localhost -d example.com -t users --package example --struct user -p --user exampleUser --guregu --gorm
我自己的用法,不知道别人是不是这样的
安装sqlite3的时候,报:
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
^
/usr/local/include/stdint.h:59:11: error: #include nested too deeply
# include <stdint.h>
^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
^
/usr/local/include/stdint.h:76:10: error: #include nested too deeply
#include <limits.h>
^
/usr/local/include/stdint.h:82:11: error: #include nested too deeply
# include <inttypes.h>
^
5 errors generated.
mkdir /tmp/includes
brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes
有人说重置SMC可以解决这个问题,然而我没有试。最后看LOG,居然一堆连网错误,难道要校验checksum?
Hi,
Had the same problem, but for me it worked by
removing all DNS search domains
untick the automatic proxy configuration
for the Wifi adapter.
good luck.
节选
Next, let’s try out the basic NVRAM reset (or PRAM for older Macs) on your computer.
Follow these steps if you are not sure about how to do the NVRAM reset
Shut down your Mac
Turn it on and immediately press and hold these four keys together: Option, Command, P, and R macOS Could Not Be Installed, How-To Fix
Release the keys after about 20 seconds, during which your Mac might appear to restart
Open System Preferences and check (and adjust, if necessary) any settings that reset, like volume, display resolution, startup disk selection, or time zone
说白了,就是启动的时候 cmd+option+P+R,等20秒。放开,再重启
要知道gorm的callback看代码就可以知道了:
func init() {
DefaultCallback.Create().Register("gorm:begin_transaction", beginTransactionCallback)
DefaultCallback.Create().Register("gorm:before_create", beforeCreateCallback)
DefaultCallback.Create().Register("gorm:save_before_associations", saveBeforeAssociationsCallback)
DefaultCallback.Create().Register("gorm:update_time_stamp", updateTimeStampForCreateCallback)
DefaultCallback.Create().Register("gorm:create", createCallback)
DefaultCallback.Create().Register("gorm:force_reload_after_create", forceReloadAfterCreateCallback)
DefaultCallback.Create().Register("gorm:save_after_associations", saveAfterAssociationsCallback)
DefaultCallback.Create().Register("gorm:after_create", afterCreateCallback)
DefaultCallback.Create().Register("gorm:commit_or_rollback_transaction", commitOrRollbackTransactionCallback)
}
下述是指在mac下面。linux 8 是这样的
ulimit -n 运行一下,看看是多少,如果是65536就算了。不是的话,如果有需要就自己改一下。常见的ulimit -n 65536,直接运行就行了,但这只是临时的
$ sysctl kern.maxfiles
kern.maxfiles: 12288
$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 10240
$ sudo sysctl -w kern.maxfiles=1048600
kern.maxfiles: 12288 -> 1048600
$ sudo sysctl -w kern.maxfilesperproc=1048576
kern.maxfilesperproc: 10240 -> 1048576
$ ulimit -n
256
$ ulimit -n 1048576
$ ulimit -n
1048576