Download CMake from: https://cmake.org/download/
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar zxvf cmake-3.*
| # Make sure you grab the latest version | |
| curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip | |
| # Unzip | |
| unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 | |
| # Move protoc to /usr/local/bin/ | |
| sudo mv protoc3/bin/* /usr/local/bin/ | |
| # Move protoc3/include to /usr/local/include/ |
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar zxvf cmake-3.*
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "reflect" | |
| "github.com/olivere/elastic" | |
| ) |
(NB: adapted from this Ask Ubuntu thread -- tested to work on Ubuntu 16.04 LTS through Ubuntu 22.04 LTS (Jammy).
Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.
Install open-vm-tools and run:
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
| package main | |
| import ( | |
| "database/sql" | |
| "log" | |
| ) | |
| func main() { | |
| db, err := sql.Open("VENDOR_HERE", "YOUR_DSN_HERE") | |
| handleError(err) |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
When setting these options consider the following:
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.logWe Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" |
| There are plenty of one line terminal commands that can prove to be exorbitantly dangerous. | |
| 1. The Delete Everything Command | |
| rm -rf / | |
| This command deletes everything it possibly can, including files on your hard drive and files on connected removable media devices. This command can be explained as follows: | |
| rm – Remove the following files. | |
| -rf – Run rm recursively. |