在 /etc/rc.local 这里面加入的命令,就会在系统开机的时候自动被执行。
sudo passwd root
[Seat:*]
autologin-guest=false
autologin-user=root
autologin-uesr-timeout=0
greeter-session=lightdm-gtk-greeter
将
mesg n || true
改为
tty -s && mesg n || true
重启电脑
/etc/apt/apt.conf
Acquire::socks::proxy “socks5://127.0.0.1:1080”;
// f1 is the same with f2
var f1 = v => v;
var f2 = function(v) {
return v
};
console.log(f1(2));
// f3 is the same with f4
var f3 = () => 5;
var f4 = function() {
return 5;
};
console.log(f3());
// sum1 is the same with sum2
var sum1 = (num1, num2) => num1 + num2;
var sum2 = function(num1, num2) {
return num1 + num2;
};
console.log(sum1(1, 2));
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
)
func main() {
run3()
}
func run1() {
c1 := exec.Command("ps", "-A")
c2 := exec.Command("grep", "vim")
c2.Stdin, _ = c1.StdoutPipe()
//c2.Stdout = os.Stdout
outPipe, err := c2.StdoutPipe()
if err != nil {
fmt.Println(err)
return
}
c2.Start()
c1.Run()
content, err := ioutil.ReadAll(outPipe)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(content))
c2.Wait()
}
func run2() {
cmd := exec.Command("/bin/sh", "-c", `ps -A | grep vim`)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Start()
cmd.Run()
cmd.Wait()
}
func run3() {
cmd := exec.Command("/bin/sh", "-c", `ps -A | grep vim`)
output, _ := cmd.Output()
fmt.Println(string(output))
}
git config [–global] http.proxy http://proxy.example.com:port
https://github.com/golang/go/wiki/GoGetProxyConfig