two hex digits per byte
one byte = 8 bit 4 bit => hex 0000 2*2*2*2 = 16 so one byte = 4bit + 4bit = hex + hex
one byte = 8 bit 4 bit => hex 0000 2*2*2*2 = 16 so one byte = 4bit + 4bit = hex + hex
https://gist.github.com/danharper/74a5102363fbd85f6b67 async () => { console.log('a'); await sleep(1000); console.log('b'); }
1、node & npm apk add nodejs npm nano curl 2、mkdir t put files to t or nano test.js 2.1、nano test.js var supertest = require('supertest'); describe('GET http://go-ethe:8545/', function () { let request = supertest('http://go-ethe:8545') it('respond with json 1', function (done) { request.post('/') .send({"jsonrpc":"2.0","method":"miner_start","params":[1],"id":1}) .expect('Content-Type', /json/) .expect(200, done); }); let gethcmd = {"jsonrpc":"2.0","method":"eth_mining","params":[],"id":1} it('respond with json mining actively start ', function (done) { request.post('/') .send(gethcmd) .expect('Content-Type', /json/) .expect(200) .expect((res)=>{if (!(true == res.body.result) ) throw new Error("mining actively start failed!"); }) .end(done); }); it('respond with json 2', function (done) { request.post('/') .send({"jsonrpc":"2.0","method":"miner_stop","params":[],"id":1}) .expect('Content-Type', /json/) .expect(200, done); }); let gethcmd2 = {"jsonrpc":"2.0","method":"eth_mining","params":[],"id":1} it('respond with json mining actively stop ', function (done) { request.post('/') .send(gethcmd2) .expect('Content-Type', /json/) .expect(200) .expect((res)=>{if (!(false == res.body.result) ) throw new Error("mining actively stop failed!"); }) .end(done); }); }); 3、npm init -y && npm i -S supertest mocha ...
這時外資群若想出脫要怎麼出?宏碁在23時,離淨值這麼遠,華碩都在淨值了,佳世達了不起一年的眼光費,宏碁還要四年的眼光費,目前大力的砍,大力的殺,外資群企圖引出買盤,這樣才有機會再進一步的出脫手上的股票,當有人進來了,再來慢慢的演一場八點檔 有一部經典港劇,鄭少秋和劉青雲主演的,故事說一個空方大鱷在狙擊港股,找了鄭少秋和劉青雲父子檔來股市操盤要對抗大鱷,鄭少秋和劉青雲找來了大型上市櫃公司的老闆來,類似我們的台灣五十成份股,找了張忠謀,郭台銘,林百里…等,股市一開盤,鄭少秋和劉青雲開始放空,大鱷也開始放空,有人會覺得奇怪,不是對抗嗎?怎麼一起放空?兩大主力一起放空,股市當然一直跌,一直跌,這時大老闆很生氣說,叫你們對抗,你們怎麼聯合一起空?劉青雲和大老闆們說,你認為你們公司是垃圾嗎?沒有價值嗎?大老闆們生氣回答,當然不是垃圾,公司每年可以創造很高的營盈,這時劉青雲說,這不就得了,有價值的股票最終一定會引來中實戶及大戶的進駐,只是沒有人知道這些中實戶及大戶心中的價值區在哪,所以我們就測試,此持雙方持續放空,股市跌到到了某一個點後,不論雙方怎麼空,怎麼賣都跌不下去,此時劉青雲放手叫大家別放空,時間過了三分鐘,股市湧入大盤的買盤,來自已散戶,中實戶,大戶,此時劉青雲反手做多開始強力買進,最後空方大鱷就被抬出去了。
………………………………………. ………………………………………. ………………………………………. go-ethereum https://github.com/ethereum/go-ethereum/wiki/Management-APIs#miner geth –rpcapi “db,personal,eth,net,web3” --rpc –rpcaddr “0.0.0.0” –rpccorsdomain “*” –rpcvhosts=* So you want miner, need put “db,personal,miner,eth,net,web3” curl -X POST -H “Content-Type: application/json” –data ‘{“jsonrpc”:“2.0”,“method”:“miner_stop”,“params”:[],“id”:1}’ go-ethe:8545 {“jsonrpc”:“2.0”,“id”:1,“result”:null} Fxxx Document……………………………………….. Import see this url document web3 https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_mining https://github.com/ethereum/web3.js/
filter json { source => “message” } This mean is Try to use json format transfer log, then put some data to message filed. So some filed just be setting, and some data set to message. .Use this to check mach and log https://grokconstructor.appspot.com/do/match https://blog.johnwu.cc/article/elk-logstash-grok-filter.html https://github.com/logstash-plugins/logstash-patterns-core/blob/master/patterns/grok-patterns This is geth log for example A: INFO [11-14|09:58:17.730] Generating DAG in progress epoch=1 percentage=99 elapsed=4m8.643s INFO [11-15|01:41:33.455] Generating DAG in progress epoch=1 percentage=9 elapsed=27.614s B: INFO [11-15|01:19:44.590] Loaded most recent local fast block number=0 hash=656134…58fded td=1 age=49y7mo1h, Loaded most recent local fast block ...
雙11 有Line 回鐀Line point 10%,另外信用卡3.5% ,其他 商店街有折300和1100,1100搶不到,折300也不錯。 放在三層樓中每層樓接近 樓梯和中間,靠樓梯來互通吧,每層前後都收得到,算不錯了! 使用中跨樓層不會中斷,但訊號不見得很強,算是便宜中的精品了。
先建立index-pattern,匯出index-pattern json檔,然後刪除建立index-pattern後,再由rest api匯入。 1、顯示 index-pattern 列表 (先用web建立一個index-pattern) curl http://localhost:5601/api/saved_objects/_find?type=index-pattern 2、匯出saved_objects index-pattern curl http://localhost:5601/api/saved_objects/index-pattern/c0c02200-e6e0-11e8-b183-ebb59b02f871 > export.json c0c02200-e6e0-11e8-b183-ebb59b02f871 是 1找到的id json檔匯出後不可以直接用,必需頭尾補上 header補上: { “objects”: [ end補上: ]} 3、匯入saved_objects index-pattern (記得先砍了kibana-*) curl -v -XPOST localhost:5601/api/kibana/dashboards/import?force=true -H ‘kbn-xsrf:true’ -H ‘Content-type:application/json’ -d @./export.json json放在執行curl 同目錄就可以了 4、強制設定預設值 Kibana -> Managment -> Advanced Settings defaultIndex curl -XPOST http://localhost:5601/api/kibana/settings/defaultIndex -H “kbn-xsrf: true” -H “Content-Type: application/json” -d ‘{“value”: “id”}’ id from export.json inside have id value If already open kibana website, use Fresh (F5) page again. ...
Ray Tracy 一個工具或技術, 能否達到你的期望用途, 關鍵在於: 使用者是否充分了解他, 並且能夠熟練的駕馭他. 世上沒有絕對好用的工具, 也沒有絕對該用甚麼的場景: 我曾經深度挖掘 zfs 的各種參數, 試圖調到最好, 經過半年之後卻發現, 當我的 Workload 特性有細微改變的時候, zfs 會放大這些改變, 導致整個運作偏離我預想的方向….(其實就是參數過度優化: Over-optimized, 但我發現 zfs 的參數很容易讓你走上這條路) 這問題, 導致我必須經常監督 zfs 的表現, 並記錄我的 workload 每一個時間軸的變化趨勢, 好讓我在下周或下個月, 遇到新的問題時, 知道該朝甚麼方向改變甚麼參數, zfs 才能獲得最佳結果. 這對 Hacker 或 Geek 來說, 是件無比美好的事情, 因為他們每周都可以看到新的變化, 接受新的挑戰, 然後從當中挖掘出更多 zfs 新的參數組合與用途, 再來發表給大家聞香敬拜…. 但對機房的 SRE 來說, 這件事情根本就是噩夢, 因為原本可以安穩睡一個星期的覺, 現在變成每天半夜都睡不著, 你不知道他是否會在半夜 3 點突然惡化, 導致線上有 50 萬個會員在交易的電商網站, 反應變慢, 破圖, 甚至無法交易, 最後被客戶從睡夢中挖起來解決問題….. 我也跟您一樣, 試圖解決 Storage 同步的問題, 而引進 Gluster 技術. 剛開始看似一切正常, 資料都正常複寫, 直到有一天, 某一台 node 意外故障而重開, 觸發 Gluster 開始做 healing 的時候, 我才發現: ...
restart docker service iptables be reset Docker Basic rule (New Docker maybe change somethings) *nat :PREROUTING ACCEPT [27:11935] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [598:57368] :POSTROUTING ACCEPT [591:57092] :DOCKER - [0:0] -A PREROUTING -m addrtype –dst-type LOCAL -j DOCKER -A OUTPUT ! -d 127.0.0.0/8 -m addrtype –dst-type LOCAL -j DOCKER -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE COMMIT # Completed on Sun Sep 20 17:35:31 2015 # Generated by iptables-save v1.4.21 on Sun Sep 20 17:35:31 2015 *filter :INPUT ACCEPT [139291:461018923] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [127386:5251162] :DOCKER - [0:0] -A FORWARD -o docker0 -j DOCKER -A FORWARD -o docker0 -m conntrack –ctstate RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i docker0 ! -o docker0 -j ACCEPT -A FORWARD -i docker0 -o docker0 -j ACCEPT COMMIT # Completed on Sun Sep 20 17:35:31 2015 ...
http://blog.pulipuli.info/2011/07/ http://linux.vbird.org/linux_server/0250simple_firewall.php iptables \[-AI 鏈\] \[-io 網路介面\] \[-p tcp,udp\] \\ \> \[-s 來源IP/網域\] \[--sport 埠口範圍\] \\ \> \[-d 目標IP/網域\] \[--dport 埠口範圍\] -j \[ACCEPT|DROP|REJECT\] 選項與參數: \--sport 埠口範圍:限制來源的埠口號碼,埠口號碼可以是連續的,例如 1024:65535 \--dport 埠口範圍:限制目標的埠口號碼。 \[root@www ~\]# iptables -A INPUT \[-m state\] \[--state 狀態\] 選項與參數: \-m :一些 iptables 的外掛模組,主要常見的有: state :狀態模組 mac :網路卡硬體位址 (hardware address) \--state :一些封包的狀態,主要有: INVALID :無效的封包,例如資料破損的封包狀態 ESTABLISHED:已經連線成功的連線狀態; NEW :想要新建立連線的封包狀態; RELATED :這個最常用!表示這個封包是與我們主機發送出去的封包有關 範例:只要已建立或相關封包就予以通過,只要是不合法封包就丟棄 \[root@www ~\]# iptables -A INPUT -m state \\ \> \--state RELATED,ESTABLISHED -j ACCEPT \[root@www ~\]# iptables -A INPUT -m state --state INVALID -j DROP https://www.booleanworld.com/depth-guide-iptables-linux-firewall/ https://www.lammertbies.nl/comm/info/iptables.html ...
https://meta.discourse.org/t/applying-docker-discourse-iptables-rules-when-using-csf-firewall/70531/5 csf v12.08 NOTE: This feature is currently in BETA testing, so may not work correctly This section provides the configuration of iptables rules to allow Docker containers to communicate through the host. If the generated rules do not work with your setup you will have to use a /etc/csf/csfpost.sh file and add your own iptables configuration instead 1 to enable, 0 to disable
https://gist.github.com/javahippie/efee5417c69aaad3baf297dd2cd71fc6 version: '3.3' services: go-ethereum: build: context: go-ethe/ ports: - "8545:8545" - "30303:30303" networks: - elk networks: elk: driver: bridge FROM ubuntu:xenial RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/* WORKDIR "/opt" ARG BINARY="geth-linux-amd64-1.8.17-8bbe7207.tar.gz" RUN wget "https://gethstore.blob.core.windows.net/builds/$BINARY" RUN tar -xzvf $BINARY --strip 1 RUN rm $BINARY ADD ./genesis.json ./genesis.json RUN ./geth init genesis.json CMD nohup ./geth --dev --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine #geth --syncmode "light" --cache=2048 EXPOSE 8545 EXPOSE 30303
1、Get key Key Path c:\user\xxxooo\.docker\machine\machines\%%%%% xxxooo user %%%%% machine name id_rsa This is key 2、Need vm ip、id_rsa Get IP: 1. docker-machine ssh %%%%% 2. ifconfig If need PPK:winscp can auto change id_rsa to ppk 3、last step login VM account:docker =========== https://github.com/boot2docker/boot2docker Docker Machine auto logs in using the generated SSH key, but if you want to SSH into the machine manually (or you’re not using a Docker Machine managed VM), the credentials are: ...
Suggestion is use docker-machine for make docker machine is more easy. VirtualBox windows Use HFS.exe for copy file to docker machine instance. Directory < ethtest > ||=docker-compose.yml ||=< go-ether >       ||=Dockerfile       ||=start.sh       ||=< genesis >         ||=genesis.json 1、docker-compose.yml import: .keystore maybe no use, because run again docker-compose need to delete /go-ether/keystore .entrypoint must have together Dockerfile ENTRYPOINT ` version: '3.3' services: go-ether: build: context: go-ether/ volumes: #- ./go-ether/keystore:/root/.ethereum/devchain/keystore:rw - ./go-ether/genesis/genesis.json:/root/genesis/genesis.json:ro - /etc/localtime:/etc/localtime:ro entrypoint: /root/start.sh ports: - "8545:8545" - "30303:30303" - "30303:30303/udp" networks: - elk networks: elk: driver: bridge ` 2、Dockerfile ...
http://jyhshin.pixnet.net/blog/post/39349999-shell-script-%E8%87%AA%E5%8B%95%E5%AE%9A%E7%BE%A9%E7%9A%84%E8%AE%8A%E6%95%B8 $@ 包含所有輸入的參數,$@ 即代表 $1, $2,….直到所有參數結束。$@ 用將所有參數以空白為間隔,存在 $@ 中。也就是說 $@ 代表了 “$1” “$2” “$3”….。
https://github.com/ethereum/go-ethereum/wiki/Private-network https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8-go-ethereum-1-6-clique-poa-consensus-%E5%BB%BA%E7%AB%8B-private-chain-1-4d359f28feff https://blog.fukuball.com/ethereum-%E9%96%8B%E7%99%BC%E7%AD%86%E8%A8%98-22geth-%E5%9F%BA%E7%A4%8E%E7%94%A8%E6%B3%95%E5%8F%8A%E6%9E%B6%E8%A8%AD-muti-nodes-%E7%A7%81%E6%9C%89%E9%8F%88/ https://medium.com/@javahippie/building-a-local-ethereum-network-with-docker-and-geth-5b9326b85f37 https://mshk.top/2017/11/go-ethereum-1-7-2/ https://www.tiny-calf.com/2018/02/01/GETH%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/ https://neighborhood999.github.io/2018/09/19/running-ethereum-on-docker/ https://github.com/yutianwu/ethereum-docker https://github.com/yutianwu/ethereum-docker
https://github.com/ethereum/go-ethereum/issues/15182 @robert-zaremba You can still use dev with datadir. Dev just uses a 0-period clique chain. That said, –dev was not meant to be used on custom networks / genesis blocks. If you need a custom setup, you can init a chain of your choosing. Dev will try to be smart and configure a lot of stuff for easy testing, but it’s not flexible, it’s easy. 翻譯: --dev不能用在 custom networks 和genesis blocks. ...
docker-compose Dockerfile always run script failed, many document is talking about RUN chmod +x xxxooo.sh But still can’t run, get error every time. Answer: Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF. standard_init_linux.go:190: exec user process caused “no such file or directory” https://stackoverflow.com/questions/51508150/standard-init-linux-go190-exec-user-process-caused-no-such-file-or-directory
https://yeasy.gitbooks.io/docker_practice/image/dockerfile/workdir.html WORKDIR 指定工作目录 格式为 WORKDIR <工作目录路径>。 使用 WORKDIR 指令可以来指定工作目录(或者称为当前目录),以后各层的当前目录就被改为指定的目录,如该目录不存在,WORKDIR会帮你建立目录。 之前提到一些初学者常犯的错误是把 Dockerfile 等同于 Shell 脚本来书写,这种错误的理解还可能会导致出现下面这样的错误:RUN cd /app RUN echo “hello” > world.txt 如果将这个 Dockerfile 进行构建镜像运行后,会发现找不到 /app/world.txt 文件,或者其内容不是 hello。原因其实很简单,在 Shell 中,连续两行是同一个进程执行环境,因此前一个命令修改的内存状态,会直接影响后一个命令;而在 Dockerfile 中,这两行 RUN 命令的执行环境根本不同,是两个完全不同的容器。这就是对 Dockerfile 构建分层存储的概念不了解所导致的错误。 之前说过每一个 RUN 都是启动一个容器、执行命令、然后提交存储层文件变更。第一层 RUN cd /app 的执行仅仅是当前进程的工作目录变更,一个内存上的变化而已,其结果不会造成任何文件变更。而到第二层的时候,启动的是一个全新的容器,跟第一层的容器更完全没关系,自然不可能继承前一层构建过程中的内存变化。 因此如果需要改变以后各层的工作目录的位置,那么应该使用 WORKDIR 指令。