boot

Spring boot 加入shiro支持

本秂侑毒 提交于 2019-12-05 04:57:44
在项目添加依赖 <!-- shiro spring. --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.4.0</version> </dependency> <!-- shiro core --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactId> <version>1.4.0</version> </dependency> 配置文件目录下新建spring文件夹,在文件夹内新建spring-shiro.xml文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema

一键配置树莓派wifi、静态ip等

泄露秘密 提交于 2019-12-05 04:46:55
系统老是被我玩坏,重新烧录系统后配置又太麻烦,用shell脚本一键配置一下wifi和静态IP #!/bin/bash touch /media/fanghaoyu/boot/ssh echo "add ssh:`ls /media/fanghaoyu/boot/ | grep ssh`" touch /media/fanghaoyu/boot/wpa_supplicant.conf sudo echo -e "country=CN\nctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev\nupdate_config=1\nnetwork={\n ssid=\"HUAWEI\"\n psk=\"Fanghaoyu1\"\n key_mgmt=WPA-PSK\n}">>/media/fanghaoyu/boot/wpa_supplicant.conf cat /media/fanghaoyu/boot/wpa_supplicant.conf sudo chmod 666 /media/fanghaoyu/rootfs/etc/dhcpcd.conf sudo echo -e "interface wlan0\nstatic ip_address=192.168.8.88/24\nstatic routers=192.168.8

spring boot注解梳理

我怕爱的太早我们不能终老 提交于 2019-12-05 04:41:45
一、注解(annotations)列表 @SpringBootApplication: 包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。 @Configuration: 等同于spring的XML配置文件;使用Java代码可以检查类型安全。 @EnableAutoConfiguration: 自动配置。 @ComponentScan: 组件扫描,可自动发现和装配一些Bean。 @Component: 可配合CommandLineRunner使用,在程序启动后执行一些基础任务。 @RestController: 是@Controller和@ResponseBody的合集,表示这是个控制器bean,并且是将函数的返回值直 接填入HTTP响应体中,是REST风格的控制器。 @Autowired: 自动导入。 @PathVariable: 获取参数。 @JsonBackReference: 解决嵌套外链问题。 @RepositoryRestResourcepublic: 配合spring-boot-starter-data-rest使用。 二、注解(annotations)详解

idea配置gradel+spring boot

守給你的承諾、 提交于 2019-12-05 04:41:09
idea 修改 setting-gradel build.gradel文件配置 // buildscript必须在顶部,注意位置 buildscript { repositories { // 优先使用国内源 maven { url 'https://maven.aliyun.com/repository/public' } mavenCentral() } dependencies { // 让spring-boot支持gradle classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE") } } plugins { id 'java' id 'org.springframework.boot' version '2.1.1.RELEASE' } apply plugin: 'java' apply plugin: 'idea' // 使用spring boot apply plugin: "org.springframework.boot" // 使用spring boot的自动依赖管理 apply plugin: 'io.spring.dependency-management' group 'com.genew.nuas' version '1.0-SNAPSHOT' /

BOOT目录磁盘占用满处理

六眼飞鱼酱① 提交于 2019-12-05 04:39:33
背景:Ubuntu:16.04 查看已安装启动镜像 dpkg --get-selections |grep linux-image 这里会列出目前已经安装的启动镜像,一般分两种,一种状态为“install”,一种为“deinstall” 对于"deinstall"的镜像,一般为镜像删除后的残留文件,可以通过下列命令进行删除 dpkg -P linux-image-extra-4.4.0-130-generic 对于“install”的镜像,可以通过下列命令进行删除 apt purge linux-image-4.4.0-142-generic 因为在删除的时候还会在boot目录下生成临时文件,磁盘不足的情况下,上述命令也无法执行,此事可以把一些大文件移出到其他目录,先删除其他的启动镜像,然后有充足空间后再把这些文件移回boot目录,执行上述命令删除即可 来源: https://www.cnblogs.com/zlgxzswjy/p/11906534.html

Dubbo 启动报错 CLassNotFondException

大憨熊 提交于 2019-12-05 04:33:27
java.lang.IllegalStateException: Error processing condition on com.alibaba.boot.dubbo.DubboAutoConfiguration.dubboProtocolConfig at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) ~[spring-boot-autoconfigure-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod

fedora 20的安装过程以及遇到的错误,Could not boot问题

不羁的心 提交于 2019-12-05 04:05:15
安装fedora很简单,我不是很懂linux,上大学前压根都没听说过这东西。但上大学后一直非常感兴趣吧,觉得蛮神奇的。 之前一直是用的ubuntu,因为同学用的。这次尝试安装fedora 我去官网下载了镜像,用ultraISO刻录进U盘,写入方式USB-HDD+V2,然后在一台破电脑里改bios用U盘引导 然后……出错了 然后显示 darcut-initqueue[309]:Warning:Could not boot. darcut-initqueue[309]:Warning:/dev/disk/by-label/Fedora-Live-Desktop-x86_64-20-1 does not exist darcut-initqueue[309]:Warning:/dev/mapper/live-rw does not exists Starting Dracut Emergency Shell... Warning:/dev/disk/by-label/Fedora-Live-Desktop-x86_64-20-1 does not exist Warning:/dev/mapper/live-rw does not exists Generating "/run/initramfs/rdsosreport.txt" Entering emergency mode.Exit

Spring Boot 集成 Mybatis 实现双数据源

牧云@^-^@ 提交于 2019-12-05 03:39:05
这里用到了Spring Boot + Mybatis + DynamicDataSource配置动态双数据源,可以动态切换数据源实现数据库的读写分离。 添加依赖 加入Mybatis启动器,这里添加了Druid连接池、Oracle数据库驱动为例。 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> </dependency> 添加启动类 @EnableMybatis @EnableTransactionManagement @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) public class Application { public static void main

硬盘分区知识

孤人 提交于 2019-12-05 02:56:26
前言 硬盘使用前,一般要分区,格式化(创建文件系统)<== 存放数据 类比,房子使用前,一般要隔断,装修,买家具,再住人。 分区 一块硬盘: 主分区、扩展分区、逻辑分区 主分区+扩展分区的数量<=4,其中一个主分区可以用一个扩展分区替代,扩展分区最多只能有一个。 扩展分区不能直接使用,还需要在上面创建逻辑分区,逻辑分区可以有多个。 主分区+扩展分区 编号只能是1-4,逻辑分区的编号只能从5开始 示例: 1. 常规分区:数据不是特别重要的业务,例如集群的某个节点 /boot 引导分区 200M 主分区 /swap 交换分区 内存的1.5倍,一旦内存大于8G,给8G即可 / Linux所有目录的顶点,剩余所有空间 2. 数据重要的分区(数据库,存储服务器) /boot 引导分区 200M 主分区 /swap 交换分区 内存的1.5倍,一旦内存大于8G,给8G即可 / Linux所有目录的顶点,100-200G,给定固定的大小 /data 剩下所有,存放数据 3. 特大网站,门户(产品线特别多,需求) /boot 引导分区 200M 主分区 /swap 交换分区 内存的1.5倍,一旦内存大于8G,给8G即可 / Linux所有目录的顶点,100-200G,给定固定的大小 剩余空间不分配,哪个部门领导了服务器,根据需求再进行分区 错误的分区方案: 把/usr, /home,

C# - How to know when Windows is “settled” after startup?

南笙酒味 提交于 2019-12-05 02:30:28
I'm writing an application that will have an option to run on Windows Startup. I can't stand when applications bog my PC down before it has really settled, and this is a non-critical application. I'd like my application to politely wait for all other startup items to finish and settle so that the user's PC becomes responsive before it starts doing any work. How would I go about detecting this condition? I suppose I could traverse the registry and look for all startup processes to be running, or use a longish timer. I'm just hoping there is another less hackish trick I might use. EDIT: The