]> Zhao Yanbai Git Server - acecode.git/commitdiff
...
authorAceVest <zhaoyanbai@126.com>
Tue, 19 Jan 2021 05:25:00 +0000 (13:25 +0800)
committerAceVest <zhaoyanbai@126.com>
Tue, 19 Jan 2021 05:25:00 +0000 (13:25 +0800)
learn/doc/vimrc
learn/doc/zshrc
tools/comm/Makefile
tools/comm/bitpic.go
tools/comm/int2ip [new file with mode: 0755]

index 1758d376d973ffd410cea02ddd5e8baaea476ce3..47c7b7618fef3c1c63fc2b4739c2d4855974b3af 100644 (file)
@@ -115,13 +115,13 @@ imap jj <Esc>
 
 filetype off
 set rtp+=~/.vim/bundle/Vundle.vim
-"call vundle#begin()
+call vundle#begin()
 "Plugin 'VundleVim/Vundle.vim'
-"Plugin 'fatih/vim-go'
+Plugin 'fatih/vim-go'
 "Plugin 'Valloric/YouCompleteMe'
 "Plugin 'Lokaltog/vim-powerline'
 "Plugin 'scrooloose/nerdtree'
-"call vundle#end()
+call vundle#end()
 filetype plugin indent on
 
 " youcompleteme插件相关配置
index ee3c8fc34fedac560e1d9f3acdbe90279f95b417..ab11d1c94c75aa0862d9376c018962bfc4f23623 100644 (file)
@@ -1,5 +1,6 @@
 # If you come from bash you might have to change your $PATH.
 # export PATH=$HOME/bin:/usr/local/bin:$PATH
+export PATH=$HOME/go/bin:$PATH
 
 # Path to your oh-my-zsh installation.
 export ZSH="/Users/ace/.oh-my-zsh"
@@ -78,7 +79,6 @@ ZSH_THEME="zhaoyanbai"
 plugins=(
  git
  zsh-autosuggestions
-# incr
 )
 
 source $ZSH/oh-my-zsh.sh
@@ -133,3 +133,4 @@ export PATH=$PATH:$HOME/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-a
 export PATH=$PATH:/usr/local/opt/go/libexec/bin
 export PATH=$PATH:/Users/ace/sys/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/bin
 export RTOS_PATH=$HOME/workspace/acecode/rtos/
+
index 140f39da9eab0da938efbced7a109b58ab4b67d0..a550417a6d5251fdaccefdcdba6861456e8572fa 100644 (file)
@@ -1,7 +1,7 @@
 CC     = gcc
 CPP    = g++
 BINS   = countc htc
-SCRIPTS = cls cs
+SCRIPTS = cls cs int2ip
 DST    = $(HOME)/.local/bin/ 
 
 %.o : %.c
index 11bf45c398dfafdab9abcd4f97950eba10ad2c48..25ec43576935287e73d132157c3bf3fa7f9e73d6 100644 (file)
@@ -13,7 +13,8 @@ import (
        "fmt"
        "image"
        "image/color"
-       "image/jpeg"
+       "image/png"
+       //"image/jpeg"
        "log"
        "os"
 )
@@ -100,5 +101,6 @@ func main() {
        f, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE, 0600)
        defer f.Close()
 
-       jpeg.Encode(f, img, nil)
+       //jpeg.Encode(f, img, nil)
+       png.Encode(f, img)
 }
diff --git a/tools/comm/int2ip b/tools/comm/int2ip
new file mode 100755 (executable)
index 0000000..cea1a94
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# ------------------------------------------------------------------------
+#   File Name: int2ip
+#      Author: Zhao Yanbai
+#              2021-01-19 13:14:17 Tuesday CST
+# Description: none
+# ------------------------------------------------------------------------
+
+
+import socket
+import struct
+import sys
+
+if len(sys.argv) == 1 :
+    print("{0} <intip1> <intip2> ...".format(sys.argv[0]))
+
+for ipint in sys.argv[1:] :
+    try :
+        ipint = int(ipint)
+    except :
+        print("{0}: is not digital".format(ipint))
+        continue
+
+    ip1 = socket.inet_ntoa(struct.pack('I',ipint))
+    ip2 = socket.inet_ntoa(struct.pack('I',socket.htonl(ipint)))
+
+    print("{0}: {1}      {2}".format(ipint, ip1, ip2))