emacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
- Undo -
C-/ - Redo -
C-? - Change case: 1. Camel Case :
M-c2. Upper Case :M-u
- Lower Case :
M-l
| import time | |
| from datetime import datetime, date | |
| # 今天 | |
| datetime.datetime.today().date().isoformat() | |
| # 通过日期对象生成时间戳 | |
| int(time.mktime(datetime.now().timetuple())) | |
| # 通过时间戳生成日期对象,timestamp 的时间戳以秒为单位 |
| package user | |
| import ( | |
| "fmt" | |
| "regexp" | |
| "strconv" | |
| "time" | |
| "dxmall/utils" |
| package main | |
| import ( | |
| "dxmall/models/user" | |
| "dxmall/utils" | |
| "fmt" | |
| "net/http" | |
| "strings" |
| sfdsf |
emacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
C-/C-?M-c
2. Upper Case : M-uM-lDB
ovs-vsctl list interface
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl --format=table --columns=name,mac_in_use find Interface name=br-dpdk1
ovs-vsctl get interface vhub656c3cb-23 name
ovs-vsctl set port vlan1729 tag=1729
ovs-vsctl get port vlan1729 tag
| // getMacAddr gets the MAC hardware | |
| // address of the host machine | |
| func getMacAddr() (addr string) { | |
| interfaces, err := net.Interfaces() | |
| if err == nil { | |
| for _, i := range interfaces { | |
| if i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 { | |
| // Don't use random as we have a real address | |
| addr = i.HardwareAddr.String() | |
| break |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) | |
| func main() { |
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "encoding/base64" | |
| "errors" | |
| "io" | |
| "log" |
| from base64 import urlsafe_b64encode, urlsafe_b64decode | |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| BS = 16 | |
| pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
| unpad = lambda s: s[:-ord(s[len(s) - 1:])] | |
| base64pad = lambda s: s + '=' * (4 - len(s) % 4) |