Standard escape codes are prefixed with Escape:
- Ctrl-Key: ^[
- Octal: \033
- Unicode: \u001b
- Hexadecimal: \x1B
- Decimal: 27
| // This sample is a Work in Progress for JSI , and specific functions may change. | |
| #pragma once | |
| #include <string> | |
| #include <unordered_map> | |
| #include <jsi/jsi.h> | |
| // This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS. | 
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "syscall" | |
| ) | |
| func main() { | 
| extern crate actix_web; | |
| use actix_web::{fs, server, App}; | |
| fn main() { | |
| server::new(|| { | |
| App::new() | |
| .handler( | |
| "/", | |
| fs::StaticFiles::new("./public") | |
| .unwrap() | 
| use std::io::prelude::*; | |
| use std::net::TcpListener; | |
| use std::net::TcpStream; | |
| mod app; | |
| fn main() { | |
| let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); | |
| for stream in listener.incoming() { | |
| let stream = stream.unwrap(); | |
| handle_connection(stream); | 
| //CommandTimeoutWithContext command timeout with background context | |
| func CommandTimeoutWithContext(command string, timeout time.Duration) (string, error) { | |
| ctx, cancel := context.WithTimeout(context.Background(), timeout) | |
| defer cancel() | |
| cmd := exec.CommandContext(ctx, "/bin/bash", "-c", command) | |
| out, err := cmd.CombinedOutput() | |
| if ctx.Err() == context.DeadlineExceeded { | |
| fmt.Println("Command timed out") | 
| // ROLLUP CONFIG from @makio64 | |
| //-------------------------------------------------------------------------- PLUGINS | |
| import includePaths from 'rollup-plugin-includepaths' | |
| import rootImport from 'rollup-plugin-root-import' | |
| import resolve from 'rollup-plugin-node-resolve' | |
| import builtins from 'rollup-plugin-node-builtins' | |
| import babel from 'rollup-plugin-babel' | |
| import commonjs from 'rollup-plugin-commonjs' | 
This can be applied generically but usually applies to Linux nodes that have a local caching nameserver running, which means pointing to an IP in the loopback range (127.0.0.0/8). Ubuntu 18.04 Bionic Beaver does this by default.
sudo systemctl mask systemd-resolved
rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
After download and move to your interested folder, add this line to ~/.bashrc and ~/.profile
export GOPATH=$HOME/gowork
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin