• Mongodb introduction and Development Guide


    catalogue1、 Introduction to mongodb2、 Build mongodb3、 Java with mongodb4、 Spring session mongodb5、 Mongodb development specifications and examples6、 Mongodb + nodejs See Annex: mongodb introduction and Development Guide for details_ 20200409224211.pdf Mongodb learning exchange group:

  • Python one click to get mail attachments


    Here, take my corporate QQ email as an example. The code is as follows: # -*- coding: utf-8 -*- Original text:bgods.cn/blog/post/54/ This work adoptsCC agreement, reprint must indicate the author and the link to this article

  • Sending mail by multithreading in Django


    Copyright notice: This article is original by the author. No reprint is allowed without permission. To send mail in Django, you can use Python’s native SMTP lib module or django.core.mail module encapsulated by Django. Using multithreading, sending mail does not block the main thread. Examples are as follows: 1、 Using the SMTP lib module <send_email_thread.py> […]

  • MySQL based on MHA high availability


    function 1. Monitor whether the primary database server is available 2. When the master DB is unavailable, select a new master database server from multiple slave servers 3. It provides master-slave switching and failover functions (which can be combined with semi synchronous replication to ensure data integrity to the greatest extent) Master slave switching process […]

  • Two methods of sending email attachments on the Linux command line


    Sending mail on the Linux command line is very useful for system administrators to attach backup files, log files / system operation reports or any related information and send them to remote computers.demandThis article uses the centos7 operating system. You need a working mail system. This article will not describe how to configure the mail […]

  • Send Gmail and QQ email using springboot


    Send Gmail and QQ email using springboot summary How to use springboot to send Gmail, QQ email, text, attachments and templates. The code is as follows: DemoApplication.java `package com.example.sendmail.demo;import org.springframework.beans.factory.annotation.Value;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.GetMapping;@SpringBootApplicationpublic class DemoApplication {    public static void main(String[] args) {        SpringApplication.run(DemoApplication.class, args);    }    @Controller    class MainController{        @Value(“${spring.mail.username}”)        private String username;        /**         *  Send mail page         * @return         */        @GetMapping(value = {“/”,”/send/form”})        public String form(Model model){            model.addAttribute(“from”,username);            return “send-form”;        }    }}` MailController.java `package com.example.sendmail.demo;import lombok.RequiredArgsConstructor;import lombok.extern.log4j.Log4j2;import org.springframework.web.bind.annotation.*;import org.springframework.web.multipart.MultipartFile;import javax.mail.MessagingException;@[email protected]@[email protected](“/send”)public class MailController {    private final MailService mailService;    /**     *  Send text     * @param mailBody     * @return     */    @PostMapping(“/text”)    public Boolean text(@RequestBody MailBody mailBody){        return mailService.sendText(mailBody);    }    /**     *  Send attachments     * @param mailBody     * @param file     * @return     * @throws MessagingException     */    @PostMapping(“/attach”)    public Boolean attach(@RequestParam(“mailBody”) MailBody mailBody,@RequestParam(“file”) MultipartFile file) throws MessagingException {        mailBody.setFile(file);        log.info(“file name:{}”,file.getOriginalFilename());        log.info(“mailBody:{},”,mailBody.toString());        return mailService.sendAttachment(mailBody);    }    /**     *  Send template     * @param mailBody     * @return     * @throws MessagingException     */    @PostMapping(“/template”)    public boolean template(@RequestBody MailBody mailBody) throws MessagingException {        return mailService.sendTemplate(mailBody);    }}`

  • [logs] log function color command line tool


    Record before optimize When using the command line to view the log, if you want to have color, the simple script is as follows. (Version 1)The following can only match a single line colorize.sh #!/bin/bash #The following errors are matched and case sensitive. The example here is the log of springboot # Example: # 2021-07-14 […]

  • Real time synchronization of mongodb data to elastic search based on nodejs


    1、 Preface Because the company needs to use elasticsearch for full-text retrieval, mongodb is used for persistent storage, but it is hoped that the data in mongodb can be synchronized to elasticsearch in real time when changes occur. At the beginning, elasticsearch v1.7.2 is mainly used, and Mongo River can solve this problem. With the […]

  • Two methods of sending email attachment in Linux command line


    It is very useful for system administrators to attach backup files, log files / system running reports or any related information and send them to remote computers by sending mail from Linux command line.demandThis paper uses centos7 operating system. You need to have a working email system. This article will not describe how to configure […]

  • Wig table November version new online: wavelet practical update, can watch the film online


    Vika Vig table is a new generation of team data collaboration artifact that supports API. It simplifies complex SaaS software to be as simple and easy to use as excel. Enterprises can independently build, real-time API, online collaboration and other functions through DIY,With 1% price of traditional SaaS system, enterprise digitalization can be realized effectively。 […]

  • Java + mybatis get the blob object stored in Oracle


    1. Create entity class to receive blob type 1 @Getter 2 @Setter 3 public class FileEntity implements Serializable { 4 private static final long serialVersionUID = -5544560514334406226L; 5 // attachment type 6 private String fileType; 7 // attachment 8 private byte[] blob; 9 } 2. Configure resultmap in mybaits XML file 1 2 3 4 […]