<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[wwqcherry的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/wwqcherry</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; wwqcherry]]></copyright><item><title><![CDATA[ssh & scp]]></title><link>https://blog.csdn.net/wwqcherry/article/details/126100120</link><guid>https://blog.csdn.net/wwqcherry/article/details/126100120</guid><author>wwqcherry</author><pubDate>Mon, 01 Aug 2022 14:07:54 +0800</pubDate><description><![CDATA[linux ssh & scp 命令]]></description><category></category></item><item><title><![CDATA[golang 回调函数 & 闭包]]></title><link>https://blog.csdn.net/wwqcherry/article/details/125856061</link><guid>https://blog.csdn.net/wwqcherry/article/details/125856061</guid><author>wwqcherry</author><pubDate>Mon, 18 Jul 2022 17:24:22 +0800</pubDate><description><![CDATA[golang回调函数和闭包]]></description><category></category></item><item><title><![CDATA[重启所有已停止的docker容器]]></title><link>https://blog.csdn.net/wwqcherry/article/details/122334663</link><guid>https://blog.csdn.net/wwqcherry/article/details/122334663</guid><author>wwqcherry</author><pubDate>Wed, 05 Jan 2022 23:50:37 +0800</pubDate><description><![CDATA[docker ps -a | grep Exited 查看所有已停止的容器

docker ps -a | grep Exited | awk ‘{print $1}’ 获取已停止容器的ID

docker ps -a | grep Exited | awk ‘{print $1}’ |xargs docker start 把获取到的已停止容器的ID传送给容器启动命令

docker ps -a | grep Up | awk ‘{print $1}’ |xargs docker stop 一条命令停止所有]]></description><category></category></item><item><title><![CDATA[docker-compose network名称定义]]></title><link>https://blog.csdn.net/wwqcherry/article/details/122118896</link><guid>https://blog.csdn.net/wwqcherry/article/details/122118896</guid><author>wwqcherry</author><pubDate>Thu, 23 Dec 2021 23:48:08 +0800</pubDate><description><![CDATA[docker-compose启动的网络名称：

1、没有自定义网络名


$ cat docker-compose.yaml 
version: '2'

services:
  zookeeper1:
    image: zookeeper
    container_name: zookeeper1
    environment:
        - ZOO_MY_ID=1
        - ZOO_SERVERS=server.1=zookeeper1:2888:3888

实际使用的网络是：&]]></description><category></category></item><item><title><![CDATA[docker image 本地上传服务器]]></title><link>https://blog.csdn.net/wwqcherry/article/details/122118715</link><guid>https://blog.csdn.net/wwqcherry/article/details/122118715</guid><author>wwqcherry</author><pubDate>Thu, 23 Dec 2021 23:30:37 +0800</pubDate><description><![CDATA[本地有自己的镜像，想上传到服务器（ubuntu）上使用

1、本地打包镜像为压缩文件


docker save -o mypeerimage.tar hyperledger/fabric-peer:latest

想要上传hyperledger/fabric-peer:latest镜像打包到当前目录下，叫mypeerimage.tar

注意：打包的镜像要指定版本，如果不指定版本，会把所有此名称的各版本镜像都打包进来。

2、把mypeerimage.tar上传到服务器

3、解压镜像文件


docke]]></description><category></category></item><item><title><![CDATA[ubuntu环境变量 & GOPATH]]></title><link>https://blog.csdn.net/wwqcherry/article/details/122117817</link><guid>https://blog.csdn.net/wwqcherry/article/details/122117817</guid><author>wwqcherry</author><pubDate>Thu, 23 Dec 2021 23:12:39 +0800</pubDate><description><![CDATA[1、Ubuntu保存环境变量的几个文件



/etc/profile
在用户登录时，操作系统定制用户环境时使用的第一个文件，此文件为系统的每个用户设置环境信息，当用户第一次登录时，该文件被执行。


/etc /environment
在用户登录时，操作系统使用的第二个文件， 系统在读取用户个人的profile前，设置环境文件的环境变量。




~/.profile
在用户登录时，用到的第三个文件 是.profile文件，每个用户都可使用该文件输入专用于自己使用的shell信息，当用户登录时，该文件仅.]]></description><category></category></item><item><title><![CDATA[docker-compose 配置详解]]></title><link>https://blog.csdn.net/wwqcherry/article/details/122117780</link><guid>https://blog.csdn.net/wwqcherry/article/details/122117780</guid><author>wwqcherry</author><pubDate>Thu, 23 Dec 2021 22:18:16 +0800</pubDate><description><![CDATA[Compose 文件是一个YAML文件，用于定义services、netword和volumes。 Compose 文件的默认路径为./docker-compose.yml(后缀为.yml和.yaml都可以)。

一个service配置将会应用到容器的启动中，很像将命令行参数传递给docker run。 同样，network和volume定义类似于docker network create和docker volume create。 与Docker运行一样，默认情况下尊重Dockerfile中指定的选项（例]]></description><category></category></item><item><title><![CDATA[golang interface{}转int string slice]]></title><link>https://blog.csdn.net/wwqcherry/article/details/121879509</link><guid>https://blog.csdn.net/wwqcherry/article/details/121879509</guid><author>wwqcherry</author><pubDate>Sat, 11 Dec 2021 21:14:27 +0800</pubDate><description><![CDATA[interface{}转普通类型如int、string可以直接类型转换：


func interface2IntString(in interface{}){
    in.(int)
    in.(string)
}

interface{}转slice不能如上直接转换， 这样是可以的，很方便。


func interface2slice(in interface{}){
    slice := make([]string, 0)
    slice, ok := in.([]string)
}
]]></description><category></category></item><item><title><![CDATA[docker删除none镜像]]></title><link>https://blog.csdn.net/wwqcherry/article/details/121865301</link><guid>https://blog.csdn.net/wwqcherry/article/details/121865301</guid><author>wwqcherry</author><pubDate>Fri, 10 Dec 2021 21:29:04 +0800</pubDate><description><![CDATA[1、使用git bash进入到docker文件夹

2、查询所有的none镜像


docker images  | grep none

3、查询所有的none镜像的id


docker images  | grep none | awk '{print $3}'

4、删除所有的none镜像


docker images  | grep none | awk '{print $3}' | xargs docker rmi

docker none镜像

有效的 none 镜像
Docker文件系统的]]></description><category></category></item><item><title><![CDATA[golang time.Tick比较time.Sleep]]></title><link>https://blog.csdn.net/wwqcherry/article/details/121622546</link><guid>https://blog.csdn.net/wwqcherry/article/details/121622546</guid><author>wwqcherry</author><pubDate>Mon, 29 Nov 2021 23:42:19 +0800</pubDate><description><![CDATA[1.sleep进行定时任务 任务执行的时间对其实际定时间隔没有影响 睡眠紧跟在任务结束后
2.sleep的定时间隔时间 = 上一个end 到 下一个begin 的时间
3.而tick的实现 使用了一个协程来进行定时 任务执行的时间会对其实际间隔时间产生影响
4.tick的(上一个begin到下一个begin时间) = max (定时间隔时间, 任务执行时间)
...]]></description><category></category></item><item><title><![CDATA[ubuntu-linux adduser&useradd]]></title><link>https://blog.csdn.net/wwqcherry/article/details/121345852</link><guid>https://blog.csdn.net/wwqcherry/article/details/121345852</guid><author>wwqcherry</author><pubDate>Mon, 15 Nov 2021 23:10:05 +0800</pubDate><description><![CDATA[Linux下创建用户命令改：useradd和adduser这两个命令


adduser name
useradd name

CentOS下

这两个命令无区别，都是没有区别的都是在创建用户，在home下自动创建目录，没有设置密码，需要使用passwd命令修改密码

Linux下

adduser：会在/home下自动创建与用户名同名的用户目录，系统shell版本，会在创建时会提示输入密码。

useradd：不会在/home下自动创建与用户名同名的用户目录，而且不会自动选择shell版本，也没有设置密码]]></description><category></category></item><item><title><![CDATA[finallshell linux版安装教程]]></title><link>https://blog.csdn.net/wwqcherry/article/details/121323253</link><guid>https://blog.csdn.net/wwqcherry/article/details/121323253</guid><author>wwqcherry</author><pubDate>Sun, 14 Nov 2021 20:53:35 +0800</pubDate><description><![CDATA[该版本功能和windows版基本一样,但是主机检测和远程桌面功能由于兼容性问题暂时无法使用,以后会支持.
			(注意,FinalShell已经不再支持32位系统)
			一键安装脚本
			rm -f finalshell_install_linux.sh ;wget www.hostbuf.com/downloads/finalshell_install_linux.sh;chmod +x finalshell_install_linux.sh;./finalshell_install_...]]></description><category></category></item><item><title><![CDATA[从中序后序遍历构造二叉树]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114588208</link><guid>https://blog.csdn.net/wwqcherry/article/details/114588208</guid><author>wwqcherry</author><pubDate>Tue, 09 Mar 2021 16:39:32 +0800</pubDate><description><![CDATA[中序遍历+前序/后序遍历，可以唯一确定一个二叉树

本题后序遍历从右向左是树中从右向左的节点

通过后序遍历确定节点的值，在中序遍历中该节点位置可以确定左右子树节点值

通过中序遍历中确定的节点位置，知道左右子树节点个数，因为中序遍历数组个数和后序遍历数组个数相同，从而确定后序遍历数组


/**
 * Definition for a binary tree node.
 * type TreeNode struct {
 *     Val int
 *     Left *TreeNode
 * ..]]></description><category></category></item><item><title><![CDATA[对称二叉树 递归]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114461486</link><guid>https://blog.csdn.net/wwqcherry/article/details/114461486</guid><author>wwqcherry</author><pubDate>Sat, 06 Mar 2021 22:50:22 +0800</pubDate><description><![CDATA[/**
 * Definition for a binary tree node.
 * type TreeNode struct {
 *     Val int
 *     Left *TreeNode
 *     Right *TreeNode
 * }
 */
func isSymmetric(root *TreeNode) bool {
//左子树的左孩子和右子树的右孩子对称
    if root==nil{
        return true
    }
    return i...]]></description><category></category></item><item><title><![CDATA[二叉树最大深度 递归]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114459213</link><guid>https://blog.csdn.net/wwqcherry/article/details/114459213</guid><author>wwqcherry</author><pubDate>Sat, 06 Mar 2021 21:58:24 +0800</pubDate><description><![CDATA[/**
 * Definition for a binary tree node.
 * type TreeNode struct {
 *     Val int
 *     Left *TreeNode
 *     Right *TreeNode
 * }
 */
func maxDepth(root *TreeNode) int {
    if root==nil{
        return 0
    }
    ldepth := maxDepth(root.Left)
    r...]]></description><category></category></item><item><title><![CDATA[单链表翻转]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114435873</link><guid>https://blog.csdn.net/wwqcherry/article/details/114435873</guid><author>wwqcherry</author><pubDate>Sat, 06 Mar 2021 11:22:27 +0800</pubDate><description><![CDATA[递归代码如下


/**
 * Definition for singly-linked list.
 * type ListNode struct {
 *     Val int
 *     Next *ListNode
 * }
 */
func reverseList(head *ListNode) *ListNode {
    if head == nil{
        return head
    }
    if head.Next == nil{
        return ..]]></description><category></category></item><item><title><![CDATA[二进制链表转整数]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114435839</link><guid>https://blog.csdn.net/wwqcherry/article/details/114435839</guid><author>wwqcherry</author><pubDate>Sat, 06 Mar 2021 11:20:18 +0800</pubDate><description><![CDATA[位运算很快



func getDecimalValue(head *ListNode) int {
/*
    numlist := make([]int,0) //注意这里参数为0，即空的数组。否则为n个0
    
    count := 1
    p := head
    for p.Next!=nil{
        numlist = append(numlist, p.Val) //低index是数字的高位
        count++
        p = p.Next
..]]></description><category></category></item><item><title><![CDATA[双指针，找第一个公共节点]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114419817</link><guid>https://blog.csdn.net/wwqcherry/article/details/114419817</guid><author>wwqcherry</author><pubDate>Fri, 05 Mar 2021 23:34:54 +0800</pubDate><description><![CDATA[一个双指针问题

两个链表，找出它们的第一个公共节点。

我们使用两个指针 node1，node2 分别指向两个链表 headA，headB 的头结点，然后同时分别逐结点遍历，当 node1 到达链表 headA 的末尾时，重新定位到链表 headB 的头结点；当 node2 到达链表 headB 的末尾时，重新定位到链表 headA 的头结点。

这样，当它们相遇时，所指向的结点就是第一个公共结点。





好理解的解释：两个链表长度分别为L1+C、L2+C， C为公共部分的长度，按照楼主的做法： 第.]]></description><category></category></item><item><title><![CDATA[Golang protobuf]]></title><link>https://blog.csdn.net/wwqcherry/article/details/114098464</link><guid>https://blog.csdn.net/wwqcherry/article/details/114098464</guid><author>wwqcherry</author><pubDate>Thu, 25 Feb 2021 18:30:28 +0800</pubDate><description><![CDATA[什么是protobuf

protobuf也叫protocol buffer是google 的一种数据交换的格式，它独立于语言，独立于平台。google 提供了多种语言的实现：java、c#、c++、go 和 python，每一种实现都包含了相应语言的编译器以及库文件。

由于它是一种二进制的格式，比使用 xml 、json进行数据交换快许多。可以把它用于分布式应用之间的数据通信或者异构环境下的数据交换。作为一种效率和兼容性都很优秀的二进制数据传输格式，可以用于诸如网络传输、配置文件、数据存储等诸多领域。
]]></description><category></category></item><item><title><![CDATA[fabric simulate过程并行or串行]]></title><link>https://blog.csdn.net/wwqcherry/article/details/112140907</link><guid>https://blog.csdn.net/wwqcherry/article/details/112140907</guid><author>wwqcherry</author><pubDate>Sun, 03 Jan 2021 17:20:57 +0800</pubDate><description><![CDATA[声明：链码开发语言是golang，源码分析是基于fabric 1.4.0版本
链码开发的时候，总是有一个疑问，链码的调用到底是并行还是串行？如果是并行，就需要我们对一些线程不安全的对象进行保护，反之则不需要。这是个很重要的问题，而社区两种声音都有！真相到底是什么~

本文只是用户链码，下次再说使用go-plugin扩展的系统链码。

用户链码与peer的关系

用户链码是一个独立的进程，使用docker封装（非dev模式下）。链码容器由peer创建，在启动容器时指定了peer的地址，所以链码容器启动后能够找]]></description><category></category></item></channel></rss>