cd /etc/apt
sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
也可以使用 163 源:mirrors.163.com
。
cd /etc/apt
sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
也可以使用 163 源:mirrors.163.com
。
官网下载:babun
zsh配置:oh-my-zsh 安装和配置方法
安装完 zsh-autosuggestions
插件后,自动提示出来的文字颜色和背景色太近,看不清楚,到选项中(右击标题栏)把背景色调黑一点就行了。
可以考虑换一下cygwin的源:
cd ~
vim .pact/pact.repo
PATC_REPO=http://mirrors.163.com/cygwin
Babun Python配置。因为Babun默认的Python是python2,于是先删除了连接再根据我系统中Python所在文件夹创建了python的链接:
cd /usr/bin
rm -rf python
ln -s /cygdrive/c/ProgramData/Anaconda3/python.exe /usr/bin/python
python -i #在Babun中,需要加上-i参数,才能正常启动python
公司旧路由越来越不稳定,后期要有一批人员进入,于是升级一下路由。
原先的组网情况:
感觉 iKuai 还挺稳定,自从安装过后没有重启过也没有卡过,因此想用 iKuai 的硬件试一下。因此买了 iKuai A320 。
show variables like 'sql_mode';
在 5.7.22
版本中,结果是 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
。
set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
mysql.cnf
,在 [mysqld]
下面添加:sql_mode=
pip3 install 时出现错误,最后一行信息为 locale.Error: unsupported locale setting
,解决办法是,在终端输入 export LC_ALL=C
即可。
首先申请 ssl证书,可以在 腾讯云 或 阿里云 或 利用Let’s Encrypt创建 。这里以 腾讯云 为例。
sudo a2enmod ssl
/etc/apache2/ssl
。default-ssl.conf
,然后修改新文件中的 域名,DocumentRoot,证书路径,如:<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/domain.com-ssl-error.log
CustomLog ${APACHE_LOG_DIR}/domain.com-ssl-access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/2_domain.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/3_domain.com.key
SSLCertificateChainFile /etc/apache2/ssl/1_root_bundle.crt
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
.htaccess
文件,添加以下代码,实现 http 自动跳转到 https:<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]
</IfModule>
使用 阿里云ECS 或者 VPS 时,因为安装的系统是 英文版linux,所以vim默认中文件显示乱码,解决办法是:编辑 /etc/vim/vimrc
或 ~/.vimrc
,添加以下代码:
set fileencodings=utf-8,gbk,utf-16le,cp1252,iso-8859-15,ucs-bom
set termencoding=utf-8
set encoding=utf-8
右击“我的电脑”,“映射网络驱动器”,输入以下内空:
\vmware-host\Shared Folders\共享目录名
~/bin
)。
运行需要 jre 环境,安装: sudo apt install openjdk-8-jre
(不同系统可能不一样,如果有多个版本可以选择高版本)。
运行时出现 发生了错误。请参阅日志文件
,打开提示中的日志文件,发现有一行 Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.0.v20160319-0612
,是因为缺少组件。但是其实组件已经安装了,使用以下方法解决:打开运行目录 XMind_amd64
,打开 XMind.ini
,文件最后添加一行 --add-modules=ALL-SYSTEM
。
添加启动器
1. 在 XMind_amd64
目录中,添加文件 XMind.sh
,添加以下内容(注意目录路径要和自己的实际情况一致):
cd ~/bin/xmind-8-update7-linux/XMind_amd64
./XMind $*
添加运行权限。
/usr/share/applications
(或者 ~/.local/share/applications
,此目录仅当前用户可见) 添加文件 xmind.desktop
,添加以下内容:
[Desktop Entry]
Name=XMind
Exec="~/bin/xmind-8-update7-linux/XMind_amd64/XMind.sh" %F
Comment=
Terminal=false
Icon=xmind
Type=Application
Categories=GTK;GNOME;Office;
无需添加运行权限。
通过文件直接打开(以 mint 为例):右键 .xmind
文件,选择“属性”->“打开方式”,选择“XMind”,点击“设为默认”。这步操作不建议设置。xmind文件实际上是一个压缩包,如果默认使用xmind打开,所有压缩包都会如此,反而增加麻烦。建议添加到打开方式列表就行。
%F
可以让启动器显示在“打开方式”列表中。;
隔开public function withValidator($validator)
{
// 有企业ID时必须是企业身份
$validator->sometimes('group', 'in:1', function ($input) {
return $input->company_id;
});
// 没有企业ID时必须是管理员身份(管理员必须没有企业ID)
$validator->sometimes('group', 'in:2', function ($input) {
return !$input->company_id;
});
}