git-am

git-am https://blog.csdn.net/mliubing2532/article/details/7577905 这篇文章主要介绍一下git-am 和 format-patch 的使用。 因为在git使用当中,会有很多时候别人 (供应商或者其他的开发人员) 发过来一系列的patch,这些patch通常的是类似这样的名字: 0001-JFFS2-community-fix-with-not-use-OOB.patch 0002-Community-patch-for-Fix-mount-error-in.patch 0003-partial-low-interrupt-latency-mode-for-ARM113.patch 0004-for-the-global-I-cache-invalidation-ARM11.patch 0005-1-arm-Add-more-cache-memory-types-macr.patch 0006-2-Port-imx-3.3.0-release-to-2.6.28.patch 0007-3-Add-MX25-support.patch 0008-Move-asm-arch-headers-to-linux-inc-dir.patch 0009-1-regulator-allow-search-by-regulator.patch 里面包含了提交的日志,作者,日期等信息。你想做的是把这些patch引入到你的代码库中,最好是也可以把日志也引入进来, 方便以后维护用。传统的打patch方式是 patch -p1 < 0001-JFFS2-community-fix-with-not-use-OOB.patch 这样来打patch,但是这样会把这些有用的信息丢失。由于这些patch显然是用git format-patch来生成的,所以用git的工具应该就可以很好的做好。git-am 就是作这件事情。 在使用git-am之前, 你要首先git am –abort 一次,来放弃掉以前的am信息,这样才可以进行一次全新的am。 不然会遇到这样的错误。 .git/rebase-apply still exists but mbox given. git-am 可以一次合并一个文件,或者一个目录下所有的patch,或者你的邮箱目录下的patch. 下面举两个例子: 你现在有一个code base: small-src, 你的patch文件放在~/patch/0001-trival-patch.patch cd small-src git-am ~/patch/0001-trival-patch.patch 如果成功patch上去, 你就可以去喝杯茶了。如果失败了, git 会提示错误, 比如: error: patch failed: android/mediascanner.cpp:452 error: android/mediascanner.cpp: patch does not apply 这样你就需要先看看patch, 然后改改错误的这个文件,让这个patch能够patch上去。 你有一堆patch, 名字是上面提到的那一堆patch, 你把他们放在~/patch-set/目录下 (路径随意) ...

2020-03-17 · 2 min · 252 words · -

umask

umask umask 值用于设置用户在创建文件时的默认权限,当我们在系统中创建目录或文件时,目录或文件所具有的默认权限就是由 umask 值决定的。 对于 root用户,系统默认的umask值是0022;对于普通用户,系统默认的umask值是0002。执行umask命令可以查看当前用户的umask值。 umask # > 0022 umask 值一共有4组数字,其中第1组数字用于定义特殊权限,我们一般不予考虑,与一般权限有关的是后3组数字。 https://www.cnblogs.com/wish123/p/7073114.html

2020-03-15 · 1 min · 14 words · -

nexus docker repo

nexus 配置太复杂 用 https://hub.docker.com/_/registry 作为 docker registry wiloon.com/docker/registry docker hosted repo create repository select recipe: docker (hosted) name: docker-repo-0 HTTP: 5001, 仓库单独的访问端口(例如:5001) allow anonymous: yes Docker Registry API Support> Enable Docker V1 API> Allow clients to use the V1 API to interact with this repository: yes Hosted> Deployment policy: Allow redeploy nexus docker proxy Name: dockerhub-proxy Remote storage 配置成 https://registry-1.docker.io Docker Index 选择 Use Docker Hub 保存 创建一个 Docker Group Repository 勾选 : HTTP, Create an HTTP connector at specified port. Normally used if the server is behind a secure proxy 并填写端口 8083 ...

2020-03-14 · 1 min · 139 words · -

nexus go proxy

nexus go proxy nexus: 3.21.1 remote storage: https://goproxy.cn 勾选 Use certificates stored in the Nexus truststore to connect to external system save 401 unauthorized 问题 Administration> Security>Anonymous Access 勾选 Allow anonymous users to access the server

2020-03-14 · 1 min · 36 words · -

chromeos Secure Shell App remove known host

chromeos Secure Shell App remove known host https://medium.com/code-kings/secure-shell-removing-known-host-by-index-when-changing-ip-address-18ed4161763c 打开 Secure Shell App 打开开发者工具 Ctrl+Shift+J 在Console中执行 term_.command.removeKnownHostByIndex(YOUR_INDEX_NUMBER_HERE);

2020-03-14 · 1 min · 16 words · -

开源镜像站, open source mirror

开源镜像站, open source mirror 清华 https://mirrors.tuna.tsinghua.edu.cn/ 华为 https://mirrors.huaweicloud.com/ 中科大 https://mirrors.ustc.edu.cn/help/dockerhub.html aliyun https://developer.aliyun.com/mirror/ 北京外国语大学开源软件镜像站 https://mirrors.bfsu.edu.cn/ http://mirrors.cqu.edu.cn http://mirrors.nju.edu.cn http://ftp.sjtu.edu.cn http://mirrors.bupt.edu.cn http://mirrors.cn99.com http://mirrors.bfsu.edu.cn http://mirrors.njupt.edu.cn

2020-03-13 · 1 min · 21 words · -

django

django python manage.py startapp hello pytest-django runserver python manage.py runserver 0.0.0.0:1234 这个命令会启动两个进程 user0 542872 542712 2 16:47 pts/0 00:00:00 python manage.py runserver 0.0.0.0:1234 user0 543984 542872 8 16:47 pts/0 00:00:01 /path/to/venv-36/bin/python manage.py runserver 0.0.0.0:8888 本地修改代码之后第一个进程不变, 第二个进程会重启并应用新的代码

2020-03-11 · 1 min · 36 words · -

linux ping 时间戳

linux ping 时间戳 ping 192.168.2.1 -c 10 | awk '{ print $0"\t" strftime("%H:%M:%S",systime()) } '

2020-03-10 · 1 min · 15 words · -

java 模块系统, Jigsaw

java 模块系统, Jigsaw Java9 之前的版本 .class 文件是 JVM 看到的最小可执行文件,而一个大型程序需要编写很多 Class,并生成一堆 .class 文件,不便于管理,所以,jar 文件就是 class 文件的容器。 在 Java9 之前,一个大型 Java 程序会生成自己的 jar 文件,同时引用依赖的第三方 jar 文件,而 JVM 自带的 Java 标准库,实际上也是以 jar 文件形式存放的,这个文件叫 rt.jar,一共有 60 多 M。 如果是自己开发的程序,除了一个自己的 app.jar 以外,还需要一堆第三方的 jar 包,运行一个 Java 程序,一般来说,命令行写这样: java -cp app.jar:a.jar:b.jar:c.jar com.liaoxuefeng.sample.Main jar 只是用于存放 class 的容器,它并不关心 class 之间的依赖。 从 Java9 开始,原有的 Java 标准库已经由一个单一巨大的 rt.jar 分拆成了几十个模块,这些模块以 .jmod 扩展名标识,可以在 $JAVA_HOME/jmods 目录下找到它们: java.base.jmod java.compiler.jmod java.datatransfer.jmod java.desktop.jmod ... 这些.jmod文件每一个都是一个模块,模块名就是文件名 如果把 Java 8 比作单体应用,那么引入模块系统之后,从 Java 9 开始,Java 就华丽的转身为微服务。模块系统,项目代号 Jigsaw,最早于 2008 年 8 月提出(比 Martin Fowler 提出微服务还早 6 年),2014 年跟随 Java 9 正式进入开发阶段,最终跟随 Java 9 发布于 2017 年 9 月。 ...

2020-03-08 · 4 min · 756 words · -

java commands

java commands java -cp -class-path classpath, -classpath classpath, or -cp classpath https://blog.csdn.net/shixiaoguo90/article/details/50607716

2020-03-08 · 1 min · 12 words · -

golang 排序

golang 排序 Go 的排序思路和 C 和 C++ 有些差别。 C 默认是对数组进行排序, C++ 是对一个序列进行排序, Go 则更宽泛一些,待排序的可以是任何对象, 虽然很多情况下是一个 slice (分片, 类似于数组),或是包含 slice 的一个对象。 排序(接口)的三个要素: 待排序元素个数 n ; 第 i 和第 j 个元素的比较函数 cmp ; 第 i 和 第 j 个元素的交换 swap ; 乍一看条件 3 是多余的, c 和 c++ 都不提供 swap 。 c 的 qsort 的用法: qsort(data, n, sizeof(int), cmp_int); data 是起始地址, n 是元素个数, sizeof(int) 是每个元素的大小, cmp_int 是一个比较两个 int 的函数。 c++ 的 sort 的用法: sort(data, data+n, cmp_int); data 是第一个元素的位置, data+n 是最后一个元素的下一个位置, cmp_int 是比较函数。 ...

2020-03-04 · 1 min · 159 words · -

golang read docx

golang read docx https://github.com/unidoc/unioffice

2020-03-03 · 1 min · 4 words · -

Maven Dependency Version 依赖版本自动升级

Maven Dependency Version 依赖版本自动升级 [1.15.0,2.0.0) x>=1.15.0 && x<2.0.0 依赖调节是为了解决版本不一致的问题(multiple versions),并采取就近原则(nearest definition)。 举例来说,A项目通过依赖传递依赖了两个版本的D: A -> B -> C -> ( D 2.0 ) , A -> E -> ( D 1.0 ) 复制代码那么最终A依赖的D的version将会是1.0,因为1.0对应的层级更少,也就是更近。 除了我们常用的1.1.0,在声明依赖版本的时候,可以通过表达式灵活地配置版本号。 例如配置jar包x的标签支持如下几种语法: 1.0: 推荐依赖版本,此版本号可能会被覆盖。 复制代码还可以控制依赖的版本范围: (,1.0]: x <= 1.0 [1.2,1.3]: 1.2 <= x <= 1.3 [1.0,2.0): 1.0 <= x < 2.0 [1.5,): x >= 1.5 复制代码同时声明多个版本范围也是可以的,只要用逗号分隔即可: (,1.0],[1.2,): x <= 1.0 或者 x >= 1.2 ...

2020-03-03 · 1 min · 83 words · -

各种胎压,气压 – 小米充气宝

各种胎压,气压 – 小米充气宝 小米平衡车 plus 轮胎标注 35 psi = 2.413bar 官网建议 45~50 Psi 小宝的皮球 19 psi 有点硬下次试试 15 psi 高尔夫 2.5 bar = 36.26psi

2020-03-01 · 1 min · 24 words · -

firewall 防火墙

firewall 防火墙 device 物理设备 context 物理设备上的虚拟防火墙, 类似于虚拟机的概念 每个 context 可以被看作是一个独立的防火墙实例。每个 context 拥有自己的配置文件、策略和规则集,使得单个物理设备能够同时作为多个独立的防火墙进行操作。 VRF VRF(Virtual Routing and Forwarding) VRF 和 Context 是独立的概念 VRF 是一种在同一物理设备上创建多个虚拟路由表的方法,使得不同的网络流量可以在相同的物理接口上保持逻辑隔离。VRF 主要用于以下场景: 多租户环境:在服务提供商或大型企业网络中,VRF 允许不同的客户或部门共享相同的物理网络设备而保持独立的路由表。 安全隔离:VRF 可以将不同的业务流量在逻辑上隔离开,确保不同业务之间的安全性和隐私性。 灵活性和可扩展性:通过使用 VRF,可以在不增加额外硬件的情况下,灵活地管理和扩展网络。

2020-03-01 · 1 min · 30 words · -

java 开发环境

java 开发环境 jdk wiloon.com/jdk 安装 maven https://maven.apache.org/download.cgi apache-maven-3.6.3-bin.zip 安装 idea https://www.jetbrains.com/idea/download/#section=windows https://download.jetbrains.8686c.com/idea/ideaIC-2019.3.3.exe 安装 eclipse https://www.eclipse.org/downloads/packages/ Eclipse IDE for Java Developers, Windows 64-bit subclipse https://github.com/subclipse/subclipse/wiki Help>Install New Software>Add latest: https://dl.bintray.com/subclipse/releases/subclipse/latest/

2020-02-28 · 1 min · 29 words · -

JAVA 奇偶数

JAVA 奇偶数 int val=//一个数字 if(val%2==0) System.out.println("偶数"); else System.out.println("奇数"); https://blog.csdn.net/x369201170/article/details/8611485

2020-02-26 · 1 min · 9 words · -

番茄工作法, 番茄钟, Pomodoro

‘番茄工作法, 番茄钟, Pomodoro’ 简单来说,就是把工作时间划分为多个番茄时间。一个番茄时间包含两个部分: 25分钟的工作学习和5分钟的休息。

2020-02-24 · 1 min · 5 words · -

Golang,Signal

Golang,Signal https://colobu.com/2015/10/09/Linux-Signals/ 信号(Signal)是Linux, 类Unix和其它POSIX兼容的操作系统中用来进程间通讯的一种方式。一个信号就是一个异步的通知,发送给某个进程,或者同进程的某个线程,告诉它们某个事件发生了。 当信号发送到某个进程中时,操作系统会中断该进程的正常流程,并进入相应的信号处理函数执行操作,完成后再回到中断的地方继续执行。 如果目标进程先前注册了某个信号的处理程序(signal handler),则此处理程序会被调用,否则缺省的处理程序被调用。 signals := make(chan os.Signal) signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGTERM) // ... for s := range signals { if s == os.Interrupt || s == os.Kill || s == syscall.SIGTERM { break } } signal.Stop(signals) Go中的Signal发送和处理 有时候我们想在Go程序中处理Signal信号,比如收到SIGTERM信号后优雅的关闭程序(参看下一节的应用)。 Go信号通知机制可以通过往一个channel中发送os.Signal实现。 首先我们创建一个os.Signal channel,然后使用signal.Notify注册要接收的信号。 package main import “fmt” import “os” import “os/signal” import “syscall” func main() { // Go signal notification works by sending os.Signal // values on a channel. We’ll create a channel to // receive these notifications (we’ll also make one to // notify us when the program can exit). sigs := make(chan os.Signal, 1) done := make(chan bool, 1) // signal.Notify registers the given channel to // receive notifications of the specified signals. signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) // This goroutine executes a blocking receive for // signals. When it gets one it’ll print it out // and then notify the program that it can finish. go func() { sig := <-sigs fmt.Println() fmt.Println(sig) done <- true }() // The program will wait here until it gets the // expected signal (as indicated by the goroutine // above sending a value on done) and then exit. fmt.Println(“awaiting signal”) <-done fmt.Println(“exiting”) } go run main.go执行这个程序,敲入ctrl-C会发送SIGINT信号。 此程序接收到这个信号后会打印退出。 ...

2020-02-24 · 2 min · 368 words · -

Go SOCKS5 proxy, http proxy

golang SOCKS5 proxy, http proxy https://segmentfault.com/a/1190000038247560 https://github.com/wiloon/pingd-proxy https://golangnote.com/topic/258.html

2020-02-23 · 1 min · 8 words · -