个人代码笔记

文章目录

  • text
  • json
  • java
    • 内置函数式接口
    • xml插入后获取mysql主键
    • java日期:
  • js
    • js
    • base64
    • DOM
      • 返回上一页
      • 清除所有 cookies
      • 将 cookie 转换为对象
    • 数组
      • 比较两个数组是否一样
      • 检查数组是否为空
      • 从对象数组中提取指定属性的值
      • 检查一个对象是否是一个数组
      • 数组去重
      • 计算数组中每个元素出现的次数
      • 求和数组
      • 固定值填充数组
      • 数组函数 高级函数
      • 排序
    • 对象
      • 检查多个对象是否相等
    • 日期
      • 计算两个日期之间的不同天数
      • 日期格式化
      • 获取当月第一天、最后一天·
  • html
  • jsp
  • sql
    • mysql
    • orcale
  • css
  • 安装软件
  • linux
    • 虚拟机网络配置
    • redis
    • mysql
    • nginx
  • git
    • git命令
      • 移除不小心提交的文件

ssl_certificate D:\home\ysbs\nginx\nginx-1.15.8\cat\fpsquid.baiwangjs.com.pem;

ssl_certificate_key D:\home\ysbs\nginx\nginx-1.15.8\cat\fpsquid.baiwangjs.com.key;

text

农村村务管理系统

系统包含三种用户管理员,村委,村民。
管理员拥有功能:
	公告管理,村委管理,财务管理,村民管理,社保管理(医保添加,医保列表,养老保险添加,养老保险列表),管理员管理,系统设置
村委拥有功能:
	公告查看,系统设置(修改密码,退出),村民管理。
村民功能:
	公告查看,系统设置,个人信息
	

运行环境:eclipse/idea,MySQL5.6版本,jdk8,Tomcat9
一经售出概不退换,价格绝对优惠,不包运行,运行请另拍运行链接

各种Java管理项目,私人订制,可Jsp,SSM,SSH,springboot,vue,小程序,前后台分离等各种小项目,价格优惠。

1.缓存击穿和缓存雪崩
2.@Autowired和@Resource区别
3.HashMap怎么保证线程安全
4.SpringIoc和AOP
5.线程池设置的参数
6.Http三次握手



excel  
="insert into '"&B2&"'"

原 调试方法 在页面后边加 _ts   修改为 _wbls
https://hnswysc.henan.chinatax.gov.cn/web/dzswj/taxclient/main_wbls.html

终端管理平台:
云厅管理:/ysbs/hljyt/ytgl/ytgl_list.html
坐席管理:/ysbs/hljyt/zxgl/zx_list.html

-----------------------------------------------------------------------------------------------------
.idea 下的 workspace.xml  添加一下配置 调出service窗口 重启idea

 
    
  
  -----------------------------------------------------------------------------------------------------
pom文件引入阿里镜像:


    
      aliyun
      https://maven.aliyun.com/repository/public
      
        true
      
      
        false
      
    
  
  
    
      aliyun-plugin
      https://maven.aliyun.com/repository/public
      
        true
      
      
        false
      
    
  
  -----------------------------------------------------------------------------------------------------
  
1、基础知识关键词
选择器:选择器类型、优先级;
https://www.w3school.com.cn/cssref/css_selectors.asp
盒模型:标准盒模型、怪异盒模型,box-sizing;
https://blog.csdn.net/jhfvuyhgui/article/details/123942537
元素类型:块元素、行内元素、行内块元素=>display>inline|block|inline-block,伪元素=>:after|:before;
居中:水平居中、垂直居中,text-align、margin、line-height、vertical-align、transform、display>flex|grid;
https://blog.csdn.net/weixin_30902251/article/details/99327706
块级格式化上下文BFC:互相独立,解决边距重叠、清除浮动等;
浮动:浮动、高度塌陷、清除浮动,float、clear;
定位:文档流和脱离文档流,position;
https://www.runoob.com/css/css-positioning.html
布局发展:标准流->浮动流->定位流->弹性flex布局->网格grid布局;
https://www.ruanyifeng.com/blog/2015/07/flex-grammar.html
http://www.ruanyifeng.com/blog/2019/03/grid-layout-tutorial.html
过渡和动画:transition、animation。
https://www.runoob.com/css/css-tutorial.html

2、Vue项目搭建:
  配置环境,创建项目:vite=>create-vue或webpack=>vue-cli;
  https://cli.vuejs.org/zh/guide/creating-a-project.html
  https://cn.vitejs.dev/guide/
  选择并配置UI库,快速上手=>依赖引入,进阶用法=>配置按需引入和页面适配(postcss-px-to-viewport、postcss-pxtorem等插件)
  rem,js
  viewport,vw、vh,vmax、vmin
  引入网络请求库、工具类等公共依赖;
  规划页面路由,划分公共部分和路由部分,页面层级结构,代码分割等;
  然后按部就班的开发。

3、Vue的使用:
  官网文档整体浏览一两遍,留下初步印象,开发时没记清楚的随时查询;
  https://cn.vuejs.org/guide/introduction.html
  关键点:基础语法(模板语法、属性绑定、事件监听、条件渲染、列表渲染)、生命周期、计算属性、数据侦听;
  优点:组件化(将整个页面层次化,逻辑更清晰),数据响应式(数据驱动视图),计算属性(表明数据之间的关系,实现数据自动变更)。

json

/temp/1bf67671dba8451e9a51380de445929300.png

java

内置函数式接口

Supplier  特点:①无参数     ②有返回值     		--------->这种无参数 有返回值的接口,称之为"供给型接口"
Consumer  特点:①有参数     ②无返回值     		--------->这种有参数 无返回值的接口,称之为"消费型接口"
Function  特点:①有参数     ②有返回值     		--------->这种有参数 有返回值的接口,称之为"类型转换接口"
Predicate 特点:①有参数     ②返回 bollean值     	--------->这种 返回 bollean 类型 接口,就是用来做判断的,我们也可以叫它为"判断型接口"
    
     //文件url转输入流
URL url = new URL(entity.getFilePath());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
InputStream inputStream = conn.getInputStream();

//uuid
java.util.UUID.randomUUID().toString().replaceAll("-","")
    
    
//看不懂   
public static void main(String[] args) {
    // \u000d System.out.println("coder Hydra");
}

输出的是:coder Hydra

    
    

xml插入后获取mysql主键

<insert id="addBusLine" parameterType="busLine">
		<selectKey resultType="integer" order="AFTER" keyProperty="lineId">
	      SELECT LAST_INSERT_ID()
	    selectKey>
		insert into t_busLine(name,startStation,endStation,startTime,endTime,company,tjzd,polylinePoints) values 
		(#{name},#{startStation.stationId},#{endStation.stationId},#{startTime},#{endTime},#{company},#{tjzd},#{polylinePoints})
	insert>

java日期:

java日期:
	//当前日期
	 LocalDate shq = LocalDate.now();
	 //格式化 日期 2012-12-12
	 LocalDate gshtext = LocalDate.parse(shqStr);
	 //获取 gshtext 日期 2012-12-12 的月份的第一天
	 LocalDate shq = gshtext.with(TemporalAdjusters.firstDayOfMonth());
	 //获取 shq的月份的第一天
	 LocalDate startMonth = shq.getMonthStart();
	 //日期比较   startMonth 在 shq 之前  shq大 ture
	 boolean flag = startMonth.isBefore(shq); 
	 
	 
	 

js

js

	/* //用户名解码
		if(document.cookie.length > 0){
			var username = getCookie('USERNAME');
				$("#username").val(username);
		}

	//复选框选中不选中传值
	$('#remember').click(function(){
		$('#remember').val($('#remember').get(0).checked);
	}); */

	/* 	//获取指定名称的cookie的值
function getCookie(objName) {
    var arrStr = document.cookie.split("; ");
    for (var i = 0; i < arrStr.length; i++) {
	var temp = arrStr[i].split("=");
	if (temp[0] == objName) return decodeURIComponent(temp[1]);  //解码
    }
    return "";
} */

//乱码问题  java
 new String(request.getParameter("result").trim().getBytes("ISO8859-1"), "UTF-8");
///中文加密解密
js
encodeURI(encodeURI(title))
java
import java.net.URLDecoder;
URLDecoder.decode(request.getParameter("title").trim(), "UTF-8");

单选按钮选中传值
$("input[name='sex']:checked").val(); 

阻止a默认行为
<a href="javascript:;" >  Click Me  </a>
<a href="javascript:void(0);" >  Click Me  </a>

保留两位小数    num.toFixed(2)

//base64图片预览
function open_win(url) {
            const img = new Image();
            img.src = "data:image/jpeg;base64," + url;
            const newWin = window.open("", "_blank");
            newWin.document.write(img.outerHTML);
            newWin.document.title = "图片预览"
            newWin.document.close();

        }


//点击监听
 $('body').on("click",".zhuowei",function () {});
$(document).on('click', '.yulan', function () {});
     

 $.ajax({
                url:"${pageContext.request.contextPath}/apply/add",
                data: data.field,
                type:"post",
     dataType:"json",
     async: false
                success: function (obj1) {
                    if(obj1.code == 200){
                        parent.layer.msg(obj1.massage, {icon: 6,time:800},function () {
                            layer.close(index); //再执行关闭
                            //重新渲染表格
                            renderTable();
                        });
                    }else{
                        parent.layer.msg(obj1.massage, {icon: 5,time:800});
                    }
                }
            });

//获取路径参数 ?123
var id = window.location.search.substring(1,window.location.search.length);

//获取路径参数 ?id=12&name=?
function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
        if(pair[0] == variable){return pair[1];}
    }
    return(false);
}

//message处理html字符串标签,提出除img和a标签之外的所有标签
message.replace(/<(?!img|a).*?>/g, '');


js导入引用外部js

方法一:
include_js(baseUrl + "/static/aesTools.js");
function include_js(file, target) {
    var js;
    if (target == undefined) {
        target = self;
    }
    var html_doc = target.document.getElementsByTagName('head')[0];
    js = target.document.createElement('script');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', file);
    html_doc.appendChild(js);
}
方法二:
  document.write("")
方法三:
  document.createElement("script").setAttribute("src","aesTools.js");

// 动态加载js文件
		loadJs : function(url, callback) {
			var done = false;
			var script = document.createElement('script');
			script.type = 'text/javascript';
			script.language = 'javascript';
			script.src = url;
			if (callback) {
				script.onload = script.onreadystatechange = function() {
					if (!done && (!script.readyState || script.readyState == 'loaded' || script.readyState == 'complete')) {
						done = true;
						script.onload = script.onreadystatechange = null;
						if (callback) {
							callback.call(script);
						}
					}
				};
			}
			document.getElementsByTagName("head")[0].appendChild(script);
		},
		// 动态加载css文件
		loadCss : function(url, callback) {
			var link = document.createElement('link');
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.media = 'screen';
			link.href = url;
			document.getElementsByTagName('head')[0].appendChild(link);
			if (callback) {
				callback.call(link);
			}
		},
            

C笔记


/**
 * 动态载入js
 * @param url
 */
function loadJS( url, callback ){
    var script = document.createElement('script'), fn = callback || function(){};
    script.type = 'text/javascript';
    //IE
    if(script.readyState){
        script.onreadystatechange = function(){
            if( script.readyState == 'loaded' || script.readyState == 'complete' ){
                script.onreadystatechange = null;
                fn();
            }
        };
    }else{
        //其他浏览器
        script.onload = function(){
            fn();
        };
    }
    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);

}

//当前js的完整路径
    var includePath = document.currentScript ? document.currentScript.src :function () {
        var js = document.scripts
            , last = js.length - 1
            , src;
        for (var i = last; i > 0; i--) {
            if (js[i].src.indexOf("newQrcodeMin.js") != -1) {
                src = js[i].src;
                break;
            }
        }
        return src || js[last].src;
    }();



//页面加载完成
if (window.addEventListener){
    window.addEventListener('load',function(){
        init();
    })
}else{
    window.attachEvent("onload",function () {
        init();
    });
}



    //当前js的完整路径
    var includePath = document.currentScript ? document.currentScript.src : function () {
        let js = document.scripts
            , last = js.length - 1
            , src;
        for (let i = last; i > 0; i--) {
            if (js[i].readyState === 'interactive') {
                src = js[i].src;
                break;
            }
            return src || js[last].src;
        }
    }();
    console.log("includePath:", includePath)

base64


Base64
/**
 * 兼容IE浏览器的Base64编码和解码
 * window.Base64.decode(str)
 * window.Base64.encode(str)
 */
(function(){
    var Base64;
    if(false){
        Base64 = window.Base64 || {
            encode : function (input) {
                return window.Base64.b64EncodeUnicode(input);
            },
            decode : function (input) {
                return window.Base64.b64DecodeUnicode(input);
            }
        }
    } else{
        Base64 = window.Base64 || {
            /* private property*/
            _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
            /* public method for encoding */
            encode : function (input) {
                var output = "";
                var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
                var i = 0;
                input = Base64._utf8_encode(input);
                while (i < input.length) {
                    chr1 = input.charCodeAt(i++);
                    chr2 = input.charCodeAt(i++);
                    chr3 = input.charCodeAt(i++);
                    enc1 = chr1 >> 2;
                    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
                    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
                    enc4 = chr3 & 63;
                    if (isNaN(chr2)) {
                        enc3 = enc4 = 64;
                    } else if (isNaN(chr3)) {
                        enc4 = 64;
                    }
                    output = output +
                        Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) +
                        Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);
                }
                return output;
            },
            /* public method for decoding */
            decode : function (input) {
                var output = "";
                var chr1, chr2, chr3;
                var enc1, enc2, enc3, enc4;
                var i = 0;
                input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
                while (i < input.length) {
                    enc1 = Base64._keyStr.indexOf(input.charAt(i++));
                    enc2 = Base64._keyStr.indexOf(input.charAt(i++));
                    enc3 = Base64._keyStr.indexOf(input.charAt(i++));
                    enc4 = Base64._keyStr.indexOf(input.charAt(i++));
                    chr1 = (enc1 << 2) | (enc2 >> 4);
                    chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
                    chr3 = ((enc3 & 3) << 6) | enc4;
                    output = output + String.fromCharCode(chr1);
                    if (enc3 != 64) {
                        output = output + String.fromCharCode(chr2);
                    }
                    if (enc4 != 64) {
                        output = output + String.fromCharCode(chr3);
                    }
                }

                output = Base64._utf8_decode(output);

                return output;

            },

            /* private method for UTF-8 encoding */
            _utf8_encode : function (string) {
                string = string.replace(/\r\n/g,"\n");
                var utftext = "";

                for (var n = 0; n < string.length; n++) {

                    var c = string.charCodeAt(n);

                    if (c < 128) {
                        utftext += String.fromCharCode(c);
                    }
                    else if((c > 127) && (c < 2048)) {
                        utftext += String.fromCharCode((c >> 6) | 192);
                        utftext += String.fromCharCode((c & 63) | 128);
                    }
                    else {
                        utftext += String.fromCharCode((c >> 12) | 224);
                        utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                        utftext += String.fromCharCode((c & 63) | 128);
                    }

                }

                return utftext;
            },

            /* private method for UTF-8 decoding */
            _utf8_decode : function (utftext) {
                var string = "";
                var i = 0;
                var c = c1 = c2 = 0;

                while ( i < utftext.length ) {
                    c = utftext.charCodeAt(i);
                    if (c < 128) {
                        string += String.fromCharCode(c);
                        i++;
                    }
                    else if((c > 191) && (c < 224)) {
                        c2 = utftext.charCodeAt(i+1);
                        string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                        i += 2;
                    }
                    else {
                        c2 = utftext.charCodeAt(i+1);
                        c3 = utftext.charCodeAt(i+2);
                        string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                        i += 3;
                    }
                }
                return string;
            }
        }
    }
    window.Base64 = Base64;
})();

DOM

返回上一页

history.back();
//或者
history.go(-1);

清除所有 cookies

const cookies = document.cookie.split(';').map((item) => 
	item.split('=')).reduce((acc, [k, v]) => (acc[k.trim().replace('"', '')] = v) && acc, {});

将 cookie 转换为对象

const cookies = document.cookie.split(';').map((item) => item.split('=')).reduce((acc, [k, v]) => (acc[k.trim().replace('"', '')] = v) && acc, {});

数组

比较两个数组是否一样

// `a` 和 `b` 都是数组
const isEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b);

// 或者
const isEqual2 = (a, b) => a.length === b.length && 
  a.every((v, i) => v === b[i]);

// 事例
const flag1 = isEqual([1, 2, 3], [1, 2, 3]); // true
const flag2 = isEqual([1, 2, 3], [1, '2', 3]); // false
const flag3 = isEqual2([1, 2, 3], [1, '2', 3]); // false
const flag4 = isEqual2([1, 2, 3], [1, 2, 3]); // true

console.log(flag1);
console.log(flag2);
console.log(flag3);
console.log(flag4);


//分组  遍历map
let group = data.reduce((map, health) => {
                    if (!map[health.pjlb]) {
                        map[health.pjlb] = [];
                    }
                    map[health.pjlb].push(health);
                    return map;
                }, {});
                let list = [];
                Object.keys(group).forEach(key => {
                    list.push({'title': key, 'value': splitArray(group[key], 8)});
                });

检查数组是否为空

const isNotEmpty = (arr) => Array.isArray(arr) && Object.keys(arr).length > 0;

// 事例
let flag1 = isNotEmpty([]); // false
let flag2 = isNotEmpty([1, 2, 3]); // true

console.log(flag1);
console.log(flag2);

从对象数组中提取指定属性的值

const pluck = (objs, property) => objs.map((obj) => obj[property]);
// Example
const arr = [
{ name: '小智', age: 20 },
{ name: '大志', age: 25 },
{ name: '王大志', age: 30 },
];
const flag1 = pluck(arr,'name');
const flag2 = pluck(arr,'age');

console.log(flag1);// [ '小智', '大志', '王大志' ]
console.log(flag2);//[20, 25, 30]

检查一个对象是否是一个数组

const isArray = (obj) => Array.isArray(obj);
  console.log(isArray(1)) //false
  console.log(isArray([])) //true
  console.log(isArray([1])) //true

数组去重

let arr = [1,2,3,4,4,1]
let newArr = arr.reduce((pre,cur)=>{
    if(!pre.includes(cur)){
      return pre.concat(cur)
    }else{
      return pre
    }
},[])
console.log(newArr);// [1, 2, 3, 4]

计算数组中每个元素出现的次数

let names = ['Alice', 'Bob', 'Tiff', 'Bruce', 'Alice'];

let nameNum = names.reduce((pre,cur)=>{
  if(cur in pre){
    pre[cur]++
  }else{
    pre[cur] = 1 
  }
  return pre
},{})
console.log(nameNum); //{Alice: 2, Bob: 1, Tiff: 1, Bruce: 1}

求和数组

var  arr = [];
var sum = arr.reduce(function(prev, cur, index, arr) {
    console.log(prev, cur, index);
    return prev + cur;
}0)
console.log(arr, sum); // [] 0

固定值填充数组

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.fill("Runoob");
fruits 输出结果:Runoob,Runoob,Runoob,Runoob

数组函数 高级函数

let nums = filter((n)=>return n<100)  过滤
let nums = map((n)=>return n*2)   每个数据都*2  映射
let totle = nums.reduce((preValue,n)=>{return preValue+n},0)  //对数组进行求和

排序

 //数组排序  倒序
            arrSort(arr,item){
                return arr.sort(function(obj1,obj2){
                    var val1 = obj1[item];
                    var val2 = obj2[item];
                    if (val1 > val2) {
                        return -1;
                    } else if (val1 < val2) {
                        return 1;
                    } else {
                        return 0;
                    }
                });
            }

对象

检查多个对象是否相等

const isEqual = (...objects) => objects.every((obj) =>
  JSON.stringify(obj) === JSON.stringify(objects[0]));
// 事例

console.log(isEqual({ foo: 'bar' }, { foo: 'bar' })); // true
console.log(isEqual({ foo: 'bar' }, { bar: 'foo' })); // false

日期

计算两个日期之间的不同天数

//计算两个日期之间的不同天数
const diffDays = (date, otherDate) => Math.ceil(Math.abs(date - otherDate) / (1000 * 60 * 60 * 24));
	
// 例子
const eg = diffDays(new Date('2020-12-19'), new Date('2021-01-01')); // 13

	console.log(eg); //13

日期格式化

function showTime(t) {
                var time
                time = t > 10 ? t : '0' + t
                return time
            },

function dateFormat(date) {
                console.log(showTime(date.getHours()));
                var year = date.getFullYear();                // 年
                var month = showTime(date.getMonth() + 1);        // 月
                var week = showTime(date.getDay());           // 星期
                var day = showTime(date.getDate());          // 日
                var hours = showTime(date.getHours());         // 小时
                var minutes = showTime(date.getMinutes());    // 分钟
                var second = showTime(date.getSeconds());     // 秒
                var str = '';
                str = str + year + '-' + month + '-' + week + '-' + day + '-' + hours + '-' + minutes + '-' + second
                return str;
            },

获取当月第一天、最后一天·

 //获取当前月第一天
            getCurrentMonthOfone(){
                const date = new Date();
                // 设置为日期1号
                date.setDate(1);
                // 获取当前月份(date.getMonth()返回的是0-11)
                let month = parseInt(date.getMonth() + 1);
                // 获取当月第一天日期
                let startDay = date.getDate();
                // 获取当前月的最后一天。参数0代表上个月的最后一天
                const endOfMonth = new Date(date.getFullYear(), month, 0).getDate();
                // 设置日期为当前月的最后一天
                date.setDate(endOfMonth);
                // 获取当月最后一天日期
                let endDay = date.getDate();
                if (month < 10)  month = '0' + month
                if (startDay < 10)  startDay = '0' + startDay
                if (endDay < 10)  endDay = '0' + endDay
                const startTime = date.getFullYear() + '-' + month + '-' + startDay ;
                const endTime = date.getFullYear() + '-' + month + '-' + endDay  ;

                 this.form.skssqq = startTime;
                 this.form.skssqz = endTime;
                 this.form.skssqqtime = new Date(startTime);
                 this.form.skssqztime = new Date(endTime);
            },

html

 <a class="hhh" href="${pageContext.request.contextPath}/adminindex"
           style="line-height: 38px;color: #d3d3d3;"
           onMouseOver="this.style.color='#fffff';this.style.textDecoration='underline',this.style.fontWeight='bold'"
           onMouseOut="this.style.color='#d3d3d3';this.style.textDecoration='none',this.style.fontWeight='normal'">后台管理a>

jsp


${pageContext.request.contextPath}



<%
		AdminBean admin = new AdminBean();
		String aid = (String) session.getAttribute("aid");
		if(aid == null || aid == ""){
			response.sendRedirect("login.jsp");
			return;
		}
		AdminDao admindao = new AdminDao();
		admin = admindao.get_AidInfo2(aid);
	%>



    <%
      Admin admin = new Admin();
      String aid = (String) session.getAttribute("aid");
      if(aid==null || aid.equals("")){
    	  //没有登录
    	  response.sendRedirect("../login.jsp"); //重定向到登录页面
          return ;
      }
      else{
    	  AdminDao admindao = new AdminDao();
          admin = admindao.get_AidInfo2(aid);
      }

    %>


sql

mysql

="insert into '"&B2&"'"

SELECT * FROM employee ORDER BY STR_TO_DATE(joinTime,'%Y-%m-%d') DESC
'%Y-%m-%d %H:%i:%s'
查询字符串日期排序

SELECT CURDATE()  
当前日期

 SELECT  DATE_SUB(CURDATE(),INTERVAL 1 DAY)
前一天

 SELECT DATE_SUB(CURDATE(),INTERVAL -1 DAY)
 后一天

 SELECT * FROM records
	WHERE DATE_FORMAT(times,'%Y-%m-%d')>DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
一周之内	

SELECT * FROM records
	WHERE DATE_FORMAT(times,'%Y-%m-%d')>DATE_SUB(CURDATE(),  INTERVAL 3 MONTH)
一月	

SELECT * FROM records
	WHERE DATE_FORMAT(times,'%Y-%m-%d')>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
一年

---------
计算时间差
TIMESTAMPDIFF(MONTH,'2016-01-03','2016-04-08')
DATEDIFF('2008-11-30','2008-11-29')

DEFAULT CURRENT_TIMESTAMP
表示当插入数据的时候,该字段默认值为当前时间

ON UPDATE CURRENT_TIMESTAMP
表示每次更新这条数据的时候,该字段都会更新成当前时间


insert ignore表示,如果中已经存在相同的记录,则忽略当前新数据;

replace into表示插入替换数据,需求表中有PrimaryKey,或者unique索引的话,
如果数据库已经存在数据,则用新数据替换,如果没有数据效果则和insert into一样;

REPLACE语句会返回一个数,来指示受影响的行的数目。该数是被删除和被插入的行数的和。
如果对于一个单行REPLACE该数为1,则一行被插入,同时没有行被删除。
如果该数大于1,则在新行被插入前,有一个或多个旧行被删除。
如果表包含多个唯一索引,并且新行复制了在不同的唯一索引中的不同旧行的值,则有可能是一个单一行替换了多个旧行。


SELECT
	COLUMN_NAME AS "字段名称",
	COLUMN_TYPE AS "数据类型",
	COLUMN_COMMENT AS "字段注释",
	IS_NULLABLE	"是否为空"
FROM
	information_schema.COLUMNS 
WHERE
	TABLE_NAME = "sku_item_provider"


给表中数据编号:
SELECT t.*,@rowno :=@rowno+1 rowno FROM sys_role_menu t,(SELECT @rowno:=0) R 

重置自增
ALTER TABLE znwt_socket_connect AUTO_INCREMENT = 1;

格式化小数:
SELECT CAST(12.5AS decimal(9,2))

orcale


DDL数据定义语言  
创建用户
	 create user gao identified by 123456;
授予用户权限
	 grant create session to gao;
移除权限
	 revoke create session from gao;
授予角色
	grant connect,resource to gao; 
建表
	  create table student(
		 id varchar2(30) primary key, --primary key 主键约束
		 name varchar2(10) unique, --唯一约束
		 age number(3) check (age>=5), --check年龄大于5
		 score number(5,2),
		 birthday date,
		 classid varchar(30),
		 foreign key(classid) references school(id) --外键约束foreign key(id) references table(id);
	  )
表重命名
	rename oldname to newname
	rename student1 to student
查询
  select * from student
插入
	insert into student(id,name,age,score,birthday) values('123','张三',12,33.33,to_date('2019-11-11 11:11:11','yyyy-mm-dd hh24-mi-ss'))
创建表复制数据
	create table student2 as select * from student
删除表
	drop table student;
向表中插入一列
	alter table student add class varchar2(10);
	alter table student add class varchar2(10) default 'one'; 
	alter table t	 add class varchar2(10) default 'two' not null;
添加虚拟列
	alter table student add (avg as (score / 2));
删除表中的列
	alter table student drop column avg;
修改表中字段的数据类型
	alter table student modify name varcahr2(12);
修改表中列名
	alter table student rename column age to newage;
插入
	insert into student 
		select 666,name,age,sex from student 
			where id='111';
	可以复制一张表到另一张表
		insert into student select * from student;
	commit;
修改表
	update person set age = age + 1;
	commit;
删除行
	delete from person where id='111';
	commit;as
	select name as "姓名" from person
查询
	select * empno,ename from emp;
	select * concat(empno,ename) as 姓名编号 from emp;
	select * empno||ename as 姓名编号 from emp;
	select * '编号:'||empno||'姓名:'||ename from emp;
	select * from emp where hiredate = to_date('1980/12/17','yyyy/mm/dd')
	select sysdate from dual
	select * from emp where empno!=7777
	select * from emp where sal > any(333,111)
	select * from emp where sal > all(333,1111)
查询修改
	select * from emp for update;
模糊查找
	%匹配0个或者多个字符     _匹配任意一个字符
	select * from emp where ename like '%o%';
	select * from emp where ename like '_o%';
	select * from emp where ename not like '%oo';
	特殊字符转移
	select * from emp where ename like '%\_%' escape '\';
in
	select * from emp where empno not in(7369,7698)
between 
	select * from emp where sal between 900 and 1300;
order by 排序
	select * from emp order by sal asc; --asc 升序  desc降序
distinct 去重
	select distinct job from emp;
定义一个变量,输入
	select * from emp where ename = &a;
第一个单词大写
	select initcap(ename),ename from emp;
统计字符串长度
	select length(ename),ename from emp;
固定长度,不够补
	select rpad(ename,10,'ab'),ename from emp;
替换
	select replace(ename,'AR','啊啊'),ename from emp;
聚集函数
	select avg(sal) from emp;
	select count(*) from emp;
	select count(job) from emp;
	select count(distinct job) from emp;
	select max(sal) 最高工资,min(sal) 最低薪资 from emp;
	select sum(sal) from emp;
分组
	select deptno,avg(sal) from emp group by deptno;

select deptno as'部门编号',
	avg(sal) 部门平均工资,
	max(sal) 最高工资,
	min(sal) 最低工资,
	count(empno) 部门人数,
	sum(sal) 部门总收入,
	from emp
	where deptno >= 20
	group by deptno
	having avg(sal)>2500 and max(sal)>6000
	order by avg(sal);
rownum 编号
oracle的分页写法
	select tb.* from (select rownnum rn,emp.* from emp) tb
		where tb.rn>=&total*(&n-1)+1 and tb.rn<=&total*&n;
union关键字

表的横向拼接                                  
select tb1.s1,tb1.s_name,tb2.s_name,tb3.s_name from
(
select  rownum s1,s_name  from student 
	where s_id in (
		select s_id from ( 
			select rownum rn,s.* from (
				select *  from score 
					where c_id='01' 
					order by s_score desc) s
					) 
				where rn<3)
) tb1
left join 
(
select  rownum s2,s_name  from student where s_id in                             
(select s_id from ( select rownum rn,s.* from (select *  
from score where c_id='02' order by s_score desc) s )  where rn<3)
) tb2
on tb1.s1 = tb2.s2
left join
(
select  rownum s3,s_name  from student where s_id in                             
(select s_id from ( select rownum rn,s.* from (select *  
from score where c_id='03' order by s_score desc) s )  where rn<3)
) tb3
on tb1.s1 = tb3.s3


横向拼接 纵向拼接
select s_name 姓名,nvl(s.s_score,0) 语文, s2.s_score 数学 ,s3.s_score 英语,s4.su 总分  from student left join
       (select s_id,s_score from score where c_id='01') s on student.s_id = s.s_id
       left join
       (select s_id,s_score from score where c_id='02') s2 on student.s_id = s2.s_id 
       left join
       (select s_id,s_score from score where c_id='03') s3 on student.s_id = s3.s_id
       left join
       (select s_id,sum(s_score) su from score group by s_id) s4 on student.s_id = s4.s_id
union
       select '总计',
              (select sum(s_score) from score where c_id='01'),
              (select sum(s_score) from score where c_id='02'),
              (select sum(s_score) from score where c_id='03'),
              0
        from dual
    
    -- 追溯 查询树形结构 递归
     select zzjg_dm
        from jspt.pt_dm_zzjg
        start with zzjg_dm = #{zzjgDm}
        connect by prior sj_zzjg_dm = zzjg_dm
    
   

css

//鼠标小手
cursor: pointer;

border-collapse: collapse;
border-spacing:0;
text-shadow:0px 1px 4px rgba(0,0,0,.2);
box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset;  水平偏移 垂直偏移  阴影边框 模糊值 颜色· inset内阴影
verticle-align:middle; 居中
   position: relative;
            top: 50%; /*偏移*/
            transform: translateY(-50%);

背景渐变
backfround-image:linear-gradient()
background: linear-gradient(to right,#FFB95E ,#F35C70); 
background: -webkit-linear-gradient(to right,#FFB95E 15%,#FCA661 5%,#FCA362 5%,#FA8F66 25%,#F5736B 20%,#F35C70 30%);
background: linear-gradient(#fff, #333);
closest-side:指定径向渐变的半径长度为从圆心到离圆心最近的边
closest-corner:指定径向渐变的半径长度为从圆心到离圆心最近的角
farthest-side:指定径向渐变的半径长度为从圆心到离圆心最远的边
farthest-corner:指定径向渐变的半径长度为从圆心到离圆心最远的角


autocomplete
	“on”  “off”用在form里
	规定form和input的自动完成功能,用户填写时,浏览器自动显示。
novalidate
	boolean属性     用在form里
	规定在提交表单是不应该验证form或input,直接提交
autofocus
	boolean属性		 input里
	规定页面加载时自动获取焦点
form
	规定该input属于哪个from表单
formaction
	规定提交的地址,可以同时提交给多个页面
formnovalidate
	input的属性,会覆盖form里的属性,用在提交按钮,强制不验证提交
multiple
	boolean
	规定可以多选
pattern
	表单验证  pattern="[A-Za-z]{3}" title="三个字符"
placeholder
	输入框提示信息
required
	boolean
	不能为空
readonly
	boolean
	只读
input[name=findType]:checked 选中单选按钮


.dis{
	pointer-events: none;/*取消点击事件*/
}

/****单选按钮样式****/
body
{ display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; min-height: 100vh; } .radio { margin: 0.5rem; } .radio input[type="radio"] { position: absolute; opacity: 0; } .radio input[type="radio"] + .radio-label:before { content: ''; background: #f4f4f4; border-radius: 100%; border: 1px solid #b4b4b4; display: inline-block; width: 1.4em; height: 1.4em; position: relative; top: -0.2em; margin-right: 1em; vertical-align: top; cursor: pointer; text-align: center; -webkit-transition: all 250ms ease; transition: all 250ms ease; } .radio input[type="radio"]:checked + .radio-label:before { background-color: #3197EE; box-shadow: inset 0 0 0 4px #f4f4f4; } .radio input[type="radio"]:focus + .radio-label:before { outline: none; border-color: #3197EE; } .radio input[type="radio"]:disabled + .radio-label:before { box-shadow: inset 0 0 0 4px #f4f4f4; border-color: #b4b4b4; background: #b4b4b4; } .radio input[type="radio"] + .radio-label:empty:before { margin-right: 0; } /****单选按钮样式****/ $("input[name='gzdw']:radio[value="+flag+"]").attr('checked','true'); /***文字显示行数限制**/ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2;(行数) -webkit-box-orient: vertical; /*行数 超过隐藏*/ display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; /*两端对齐 一般用于输入框label*/ width:4em; display:inline-block; text-align:justify; text-align-last:justify; /***li 单行列表,超出部分隐藏***/ list-style: none; background: url("../img/dot.png") left center no-repeat; line-height: 1; padding: 10px 0 10px 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;

安装软件

jdk 安装目录 C:\Program Files\Java\jdk1.8.0_121
java环境变量设置
CLASSPATH   .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
JAVA_HOME   D:\tools\Java\jdk1.8.0_171
Path        D:\tools\Java\jdk1.8.0_171\bin
java -version  测试java
javac
-------------------------------------------------------------------------------
首先运行SQLyog-11.3.3-0.x64.exe 进行安装
然后,运行SQLyog-11.3.3-0.Regged.reg
mysql5.6.17安装:
1.先将mysql-5.6.17-winx64或32解压在文件夹,例如:D:\set\MySQL56\mysql-5.6.17-winx64\bin
2.打开命令窗口(管理员身份),执行下列命令,安装MySQL服务:
d:               
cd D:\set\MySQL56\mysql-5.6.17-winx64\bin
mysqld.exe  -install
3、启动MySQL服务:
net  start  mysql
(这一步会启动MySQL,之后在控制面板管理工具服务中可以看到)
4、连接MySQL
d:
cd  D:\set\mysql-5.6.17-winx64\mysql-5.6.17-winx64\bin   --如果已经在此目录下,此步骤可缺省
mysql -u root -p
quit 退出
修改密码
update mysql.user set password=password('12345678') where host='localhost';
FLUSH PRIVILEGES;

、、windows查询端口 杀死
netstat -aon|findstr "80"
tasklist|findstr "111"

taskkill /pid 1 -t -f
----------------------------------------------------------------------------
命令行 net user administrator /active:yes  开启超级管理员账户
------------------------------------------------------------------
ps序列码 1325-1001-8585-0906-8544-9596
------------------------------------------------------------------------------------------
https://blog.csdn.net/cjiankai/article/details/79363637解决ecilipse中tomcat版本问题
---------------------------------------------------------------------------------------------
netsh wlan show profiles "连你妹" key=clear  查看指定wifi的密码
netsh wlan show profiles 查看自己连过的wifi
-----------------------------------------------------------------------
python  安装D:\set\Python
------------------------------------
pycharm  01 恢复初始设置
		关掉pycharm,删除pycharm配置信息,就是
		在C:\Users\Administrator\.PyCharmCE2019.2存放的配置信息
ctrl + d  复制一整行
ctrl + alt + l  代码格式化
----------------------------------------------------------------
C:\Users\Administrator\Documents\WeChat Files\G18237531403\FileStorage\File\2019-09
微信文件存储的位置
---------------------------------------------------------------------------
netsh winsock reset --重启网络

maven idea配置:
Maven home directory: 
	D:\tools\maven/apache-maven-3.5.4
User settings file: 
	 D:\set\maven\apache-maven-3.5.4\conf\settings.xml
local repository:
	D:\set\maven\mvnRepository\repository

idea:
3AGXEJXFK9-eyJsaWNlbnNlSWQiOiIzQUdYRUpYRks5IiwibGljZW5zZWVOYW1lIjoiaHR0cHM6Ly96aGlsZS5pb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8T2idDFL7cAirJwcrbfpawPeXr52oKTPnXfi0l5+g9Gnt/wfiXCrPElX6ycTR6iL3GC2VR4jTz6YatT4Ntz59/THOT7NJQhr6AyLkhhJCdkzE2cob/KouVp4ivV7Q3Fc6HX7eepHAAF/DpxwgOrg9smX6coXLgfp0b1RU2u/tUNID04rpNxTMueTtrT8WSskqvaJd3RH8r7cnRj6Y2hltkja82HlpDURDxDTRvv+krbwMr26SB/40BjpMUrDRCeKuiBahC0DCoU/4+ze1l94wVUhdkCfL0GpJrMSCDEK+XEurU18Hb7WT+ThXbkdl6VpFdHsRvqAnhR2g4b+Qzgidmuky5NUZVfEaZqV/g==


阿里云镜像:


    
        
            aliyun-repos
            https://maven.aliyun.com/repository/public
            
                true
            
            
                false
            
        
    
    
        
            aliyun-repos
            https://maven.aliyun.com/repository/public
            
                true
            
            
                false
            
        
    


linux

查看端口使用情况:
	netstat -tunlp
查看应用运行状态:
	ps -aux | grep tomcat
	ps -ef | grep tomcat
liunx 查询端口并杀死端口:
    netstat -tunlp|grep 8080
    kill -9 9999

linux日志查询:
	查询2021-10-10 00:13这个时间点的日志
		sed -n '/2021-10-10 00:13/p' app.log
	
	查询2022年10月11日,并包含dealAgentUser的日志
	 sed -n '/2022-10-12 *.*.*dealAgentUser/p' /home/apache-tomcat-8.5.33/logs/catalina.out 
	 
	 远程复制文件
	 scp /mnt/.aone-ci.logs.d/kefu-nafu-b8c4b489f-tr5lv-20221130152611/supervisor.root.out.log      [email protected]:/home


scp -r /mnt/.aone-ci.logs.d/kefu-nafu-new-5779477bf7-k45qm-20230304233008   [email protected]:/home
htjs2021


	 
	 
	 



虚拟机网络配置

vi ../etc/sysconfig/network-scripts/ifcfg-enp0s3 
------------------------------------------------------------
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=d8a850f8-56a6-4615-8826-0dcd49743d37
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.96
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
DNS1=8.8.8.8
------------------------------------------------------------

systemctl restart network

redis


https://blog.csdn.net/weixin_43996168/article/details/127286238?spm=1001.2014.3001.5501

mysql

https://blog.csdn.net/weixin_43996168/article/details/127692094?spm=1001.2014.3001.5501


set password=password('123456'); 

alter user 'root'@'%' password expire never;

flush privileges;

nginx

//一键安装上面四个依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

//创建一个文件夹
cd /usr/local
mkdir nginx
cd nginx
//下载tar包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
//进入nginx目录
cd /usr/local/nginx
//进入目录
cd nginx-1.13.7
//执行命令 考虑到后续安装ssl证书 添加两个模块
./configure --with-http_stub_status_module --with-http_ssl_module
//执行make命令
make && make install
//执行make install命令
make install

 ​​​​​​​/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
 
 # 打开配置文件
vi /usr/local/nginx/conf/nginx.conf

/usr/local/nginx/sbin/nginx -s reload

开放80端口:

firewall-cmd --zone=public --add-port=8091/tcp --permanent

查询端口号80 是否开启:

firewall-cmd --query-port=8/tcp

重启防火墙:

firewall-cmd --reload

 ps -ef | grep nginx
 
cd /usr/local/nginx/sbin
./nginx 启动

./nginx -s stop 关闭

./nginx -s reload 重启


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

	#配置负载均衡
	# weight 权重 越高被访问次数越多  
    # down 该服务暂时宕机,不参与负载均衡
    # backup 备用服务
	upstream httpurls{
		#server  192.168.56.111 weight=5 backup;
		#server  192.168.56.111 weight=5 down;
		server  192.168.56.111 weight=5;
		server  192.168.56.112:80 weight=2;
	}

    server {
        listen       80;
        server_name  gdy.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

		#proxy_pass 反向代理 
        location / {
        #valid_referers none |  server_name | i
        valid_referers 192.168.56.1;
        if($invalid_referer){
        	return 403;
        }
        #重定向
        #rewrite ^/([0-9]+).html   /50x.html break;
        #rewrite ^/2.html   /50x.html break;
		proxy_pass   http://httpurls;
		#proxy_pass  http://192.168.56.111;
            #root   html;
            #index  index.html index.htm;
        }
        # 正则匹配
        location ~*/(js|css|img) {
        	root html;
        	index index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    server {
        listen       8888;
        server_name  gdycxr.com;

        location / {
            root   /usr/www;
            index  index.html index.htm;
        }

                 error_page   500 502 503 504  /50x.html;
                       location = /50x.html {
                              root   html;
                        }

       
    }



    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

fpsquid.baiwangjs.com
/data/imas/base_soft/nginx/8210938_fpsquid.baiwangjs.com.key
/data/imas/base_soft/nginx/8210938_fpsquid.baiwangjs.com.pem

git

git命令

移除不小心提交的文件


-- 移除不小心提交的文件   本地保留,服务器移除
git rm --cached -r .idea/

Git 全局设置
git config --global user.name "高东阳"
git config --global user.email "[email protected]"
创建一个新仓库
git clone 

[email protected]:gaodongyang/kefu-nafu-new.git
cd kefu-nafu-new
git switch -c master
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
推送现有文件夹
cd existing_folder
git init --initial-branch=master
git remote add origin [email protected]:gaodongyang/kefu-nafu-new.git
git add .
git commit -m "Initial commit"
git push -u origin master
推送现有的 Git 仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:gaodongyang/kefu-nafu-new.git
git push -u origin --all
git push -u origin --tags

port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

fpsquid.baiwangjs.com
/data/imas/base_soft/nginx/8210938_fpsquid.baiwangjs.com.key
/data/imas/base_soft/nginx/8210938_fpsquid.baiwangjs.com.pem


# git

## git命令

### 移除不小心提交的文件 

– 移除不小心提交的文件 本地保留,服务器移除
git rm --cached -r .idea/

Git 全局设置
git config --global user.name “高东阳”
git config --global user.email “[email protected]
创建一个新仓库
git clone

[email protected]:gaodongyang/kefu-nafu-new.git
cd kefu-nafu-new
git switch -c master
touch README.md
git add README.md
git commit -m “add README”
git push -u origin master
推送现有文件夹
cd existing_folder
git init --initial-branch=master
git remote add origin [email protected]:gaodongyang/kefu-nafu-new.git
git add .
git commit -m “Initial commit”
git push -u origin master
推送现有的 Git 仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:gaodongyang/kefu-nafu-new.git
git push -u origin --all
git push -u origin --tags


你可能感兴趣的:(java,笔记)