System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| Windows批处理(cmd/bat)常用命令小结 | |
| 前言 | |
| 批处理文件(batch file)包含一系列 DOS命令,通常用于自动执行重复性任务。用户只需双击批处理文件便可执行任务,而无需重复输入相同指令。 | |
| 编写批处理文件非常简单,但难点在于确保一切按顺序执行。编写严谨的批处理文件可以极大程度地节省时间,在应对重复性工作时尤其有效。 | |
| 在Windows中善用批处理可以简化很多重复工作 | |
| 阅读原文 - https://wsgzao.github.io/post/windows-batch/ |
| #!/bin/bash | |
| echo "Removing old ovs configuration." | |
| sudo /etc/init.d/openvswitch-switch stop | |
| sudo kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid` | |
| sudo rm -rf /usr/local/var/run/openvswitch | |
| sudo mkdir -p /usr/local/var/run/openvswitch | |
| sudo rm -rf /usr/local/etc/openvswitch | |
| sudo mkdir -p /usr/local/etc/openvswitch | |
| sudo rm -rf /var/run/openvswitch |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.
With that out the way, let's begin.
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
| import ( | |
| "crypto/md5" | |
| "encoding/hex" | |
| ) | |
| func GetMD5Hash(text string) string { | |
| hasher := md5.New() | |
| hasher.Write([]byte(text)) | |
| return hex.EncodeToString(hasher.Sum(nil)) | |
| } |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs