开发随笔

oneinstack:一键PHP/JAVA安装工具,可以生成命令。


服务器安装mysql后 如果想远程访问需要一下配置:服务器进入mysql (mysql -pxxxx(ip) -uxxxx(用户名,一般是root) -pxxxx(密码,一般是admin)),update user set host='%' where user='root'

服务器如何确认端口号是否添加到安全组里:可以用curl ip/1.php, 随便写个文件 如果内网ip成功 公网失败 就是端口问题


mysql查询显示编号

SELECT

​ @num := @num + 1 AS no,

​ user_info.*

FROM

​ user_info,

​ ( SELECT @num := 0 ) r


maven网址:https://mvnrepository.com/ 可以获取依赖


eclipse方法返回值快捷键 alt+shift+l


使用的东西不要放在外层,所有的东西放在使用的地方(堆栈)


@RequestParam(required=false) 参数不是必须的


重启服务后直接查看对应服务的启动日志,节省切换时间。参考如下:
journalctl -u zjcloud-site -f

journalctl -e


@ConfigurationProperties注解的使用
@ConfigurationProperties是springboot提供读取配置文件的一个注解
将该注解作用于方法上时,如果想要有效的绑定配置,那么该方法需要有@Bean注解且所属Class需要有@Configuration注解。
例:
代码:
@ConfigurationProperties(prefix = "application.target.site")
@Bean(name="targetSetting")
public Map<String ,Map<String , Object>> targetSetting(){
return new HashMap<String ,Map<String , Object>>();
}

配置文件:
application.target.site.1.domain=http://10.10.134.63:8880/
application.target.site.1.header.app_key=zjcloud-site
application.target.site.1.header.app_secret=6AnVTtXFx9VOqquNT66G
application.target.site.1.channels=ghrm
application.target.site.1.header.Cache-Control=no-cache
application.target.site.1.outputdir=${application.mirror.common.outputdir}
application.target.site.1.mode=column
application.target.site.1.tenantId=ghrm
application.target.site.1.urlreplace.a=http://10.10.134.63/,http://10.10.134.63/

遍历配置文件以application.target.site开头,将信息放到map中
Map<String ,Map<String , Object>> 的信息是:
{1=
{header=
{Cache-Control=no-cache, app_key=zjcloud-site, app_secret=6AnVTtXFx9VOqquNT66G},
domain=http://10.10.134.63:8880/, channels=ghrm, outputdir=/data/mirror-result, mode=column, tenantId=ghrm,
urlreplace={a=http://10.10.134.63/,http://10.10.134.63/}
}
}


运行以下命令立即重启Linux服务器。

[root@sharplee creatfile]# shutdown -r now


Java中||和|的区别
用做逻辑运算符
|:两边都会执行。不管第一个表达式是怎样的结果。 两边都为true,结果为true。两边有一个为false,则结果为false;符号左右两边有一个为true,结果为true

用于位运算中
& 按位与操作,按二进制位进行"与"运算。运算规则:(有 0 则为 0)
0&0=0;
0&1=0;
1&0=0;
1&1=1;
1
2
3
4
| 按位或运算符,按二进制位进行"或"运算。运算规则:(有 1 则为 1)
0|0=0;
0|1=1;
1|0=1;
1|1=1;
1
2
3
4

posted @ 2021-07-12 14:27  FY丶  阅读(35)  评论(0)    收藏  举报