0%

\sc – case in … esac (n, i)
\sei – elif then (n, i)
\sf – for in do done (n, i, v)
\sfo – for ((…)) do done (n, i, v)
\si – if then fi (n, i, v)
\sie – if then else fi (n, i, v)
\ss – select in do done (n, i, v)
\su – until do done (n, i, v)
\sw – while do done (n, i, v)
\sfu – function (n, i, v)
\se – echo -e "…" (n, i, v)
\sp – printf "…" (n, i, v)
\sa – 数组元素, ${.[.]} (n, i, v) 和其它更多的数组功能。


\rr – 更新文件,运行脚本(n, i)
\ra – 设置脚本命令行参数 (n, i)
\rc – 更新文件,检查语法 (n, i)
\rco – 语法检查选项 (n, i)
\rd – 启动调试器(n, i)
\re – 使脚本可/不可执行(*) (n, i)

#bash语法,等号两边不能有空格
[root@xhs bash]# FreeMem=`free -m | grep Mem: | awk '{print $4}'`
[root@xhs bash]# echo $FreeMem

#设置时区
[root@xhs ~]# timedatectl set-timezone Asia/Shanghai
[root@xhs ~]# ll /etc/localtime 
lrwxrwxrwx. 1 root root 35 Feb  2 11:28 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai

#用户权限
是 SGID 的第二个功能,即在某个目录中创建的文件自动继承该目录的用户组(只可以对目录进行设置)

#分区
分区的知识,可以只有一个分区,但效率不高,一个扇区最多只能存四个主分区,一般是在第四个扇区里存逻辑分区的指针;
fdisk进行分区
mkfs格式化
mount 挂载
#查看
df -h 
du -sh /newFS/

mysql> insert into user (host,user,password, ssl_cipher, x509_issuer,x509_subject) values('192.168.3.%','root',password('123456'),'', '','');
mysql> flush privileges;

点安装增强功能

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

sudo yum update
sudo yum upgrade

yum install gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel
yum install -y "kernel-devel-$(uname -r)" gcc bzip2
yum install bzip2 tar
shutdown -r now
mount /dev/cdrom /mnt/
cd /mnt
./VBoxLinuxAdditions.run 
mkdir /mnt/share
在虚拟机新建共享文件夹,名叫share
#有两种方式用共享文件夹
#一是手动挂载,如下,挂载后文件就在 /mnt/share下
mount -t vboxsf share /mnt/share
#二是重启让虚拟机自动挂载,挂载后文件夹在 /media 下,且文件夹多了前缀 sf_
reboot
ls /media

$ nginx -t
nginx: the configuration file D:\soft\server\nginx1.6.3/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
nginx: configuration file D:\soft\server\nginx1.6.3/conf/nginx.conf test failed

netstat -ano|findstr "80"

解决:
netstat -ano|findstr "80"
Sc config http start= disabled

参考:
https://www.cnblogs.com/hope-help/archive/2013/05/13/3076606.html
https://jingyan.baidu.com/article/870c6fc37678c4b03fe4bef6.html

过程:
1、在pom.xml加插件配置
在plugins加入:
			<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.6</version>
                <configuration>
                    <configurationFile>
                        ${basedir}/src/main/resources/generator/generatorConfig.xml
                    </configurationFile>
                    <overwrite>true</overwrite>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.29</version>
                    </dependency>
                    <dependency>
                        <groupId>tk.mybatis</groupId>
                        <artifactId>mapper</artifactId>
                        <version>${mapper.version}</version>
                    </dependency>
                </dependencies>
            </plugin>


2、建generator/generatorConfig.xml配置文件
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

<generatorConfiguration>
<properties resource="config.properties"/>

&lt;context id=&quot;Mysql&quot; targetRuntime=&quot;MyBatis3Simple&quot; defaultModelType=&quot;flat&quot;&gt;
    &lt;property name=&quot;beginningDelimiter&quot; value=&quot;`&quot;/&gt;
    &lt;property name=&quot;endingDelimiter&quot; value=&quot;`&quot;/&gt;

    &lt;plugin type=&quot;tk.mybatis.mapper.generator.MapperPlugin&quot;&gt;
        &lt;property name=&quot;mappers&quot; value=&quot;tk.mybatis.mapper.common.Mapper&quot;/&gt;
        &lt;property name=&quot;caseSensitive&quot; value=&quot;true&quot;/&gt;
    &lt;/plugin&gt;

    &lt;jdbcConnection driverClass=&quot;${jdbc.driverClass}&quot;
                    connectionURL=&quot;${jdbc.url}&quot;
                    userId=&quot;${jdbc.user}&quot;
                    password=&quot;${jdbc.password}&quot;&gt;
    &lt;/jdbcConnection&gt;

    &lt;javaModelGenerator targetPackage=&quot;com.xhs.oa.entity&quot;
                        targetProject=&quot;src/main/java&quot;/&gt;

    &lt;sqlMapGenerator targetPackage=&quot;com.xhs.oa.mapper&quot;
                     targetProject=&quot;src/main/java&quot;/&gt;

    &lt;javaClientGenerator targetPackage=&quot;com.xhs.oa.mapper&quot;
                         targetProject=&quot;src/main/java&quot;
                         type=&quot;XMLMAPPER&quot;/&gt;

    &lt;table tableName=&quot;over_budget_apply&quot;&gt;
        &lt;generatedKey column=&quot;id&quot; sqlStatement=&quot;JDBC&quot;/&gt;
    &lt;/table&gt;
&lt;/context&gt;

</generatorConfiguration>


3、建config.properties文件,放在resources目录下,填数据库连接信息
示例:

jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://192.168.3.4:3306/test
jdbc.user=xxx
jdbc.password=123456

4、运行 mvn mybatis-generator:generate 生成

遇到的问题:

报generatorConfig.xml 找不到,对比代码输出的路径和文件路径,发现少了xml后缀

报缺少config.properties文件,的确是缺少,但不知道放哪里好,程序没有报路径,后来查到是配置文件这节配置的

报 Cannot instantiate object of type tk.mybatis.mapper.generator.MapperPlugin
maven依赖,因为pom.xml里上面这个tk.mybatis引入过了,以为插件这里就不用引了,还是要的

参考:https://github.com/abel533/Mapper/wiki/4.1.mappergenerator


Generate code Alt + Ins
Debuggin
Smart step into/Step out Shift + F7 / Shift + F8

Edit
Expand/collapse code block Ctrl + NumPad+ / -
Expand all Ctrl +  Shift + NumPad+
Collapse all Ctrl + Shift + NumPad-
VCS
Push commits Ctrl + Shift + K
Navigation
Go to class Ctrl + N
Go to file Ctrl + Shift + N
Go to symbol Ctrl + Alt + Shift + N
Go to editor (from tool window) Esc
#函数调用层次
Call hierarchy Ctrl + Alt + H

#查看maven的依赖树
mvn dependency:tree
#打包
mvn package
运行
java -jar demo-0.0.1-SNAPSHOT.jar --server.port=9090

进入git服务端仓库钩子目录
/home/git/repositories/blog/.git/hooks
cp post-receive.sample post-receive
vi post-receive
内容为:
#!/bin/sh
#
# An example hook script for the "post-receive" event.
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated.  It is passed arguments in through
# stdin in the form
#    
# For example:
#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
#
# see contrib/hooks/ for a sample, or uncomment the next line and
# rename the file to "post-receive".

unset GIT_INDEX_FILE
git --work-tree=/usr/share/nginx/html/blog checkout -f

保存
这时注意看钩子 post-receive的属主和权限,因为我是用root用户复制的,要改回git用户所有
chown git:git post-receive

ll 查看权限如下,要注意要有执行权限
-rwx--x--x 1 git  git   672 Dec 29 22:36 post-receive

测试发现不行,看了别的文章猜想是代码目录权限问题

代码目录 blog是nginx所有,将git用户加入nginx用户组里
usermod -a -G nginx git

再push代码,发现服务端有反应了
Total 6 (delta 3), reused 0 (delta 0)
remote: error: unable to unlink old 'backend/views/wechatUser/_form.php' (Permis
sion denied)
remote: error: unable to unlink old 'backend/views/wechatUser/_search.php' (Perm
ission denied)
remote: error: unable to unlink old 'backend/views/wechatUser/create.php' (Permi
ssion denied)
remote: error: unable to unlink old 'backend/views/wechatUser/index.php' (Permis
sion denied)
remote: error: unable to unlink old 'backend/views/wechatUser/update.php' (Permi
ssion denied)
remote: error: unable to unlink old 'backend/views/wechatUser/view.php' (Permiss
还是权限,
又把这些文件属主改为nginx,再push,就可以了
参考
https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks

#安装一个包
composer require "sunra/php-simple-html-dom-parser:1.5.2"
#设置全局参数
 composer config -g repo.packagist composer http://xxx.com
#查看配置
 composer config -l -g