docker alpine

docker & docker-compose 一堆坑 FROM alpine RUN apk –no-cache upgrade RUN apk update &&\ apk add bash

繼續閱讀

Use chown 1000 xxxoo xxxooo file name logtest: build: context: logtest/ volumes: - ./logtest/logs:./logs:rw networks: - elk command: | /bin/sh -c '/bin/sh -s << EOF echo "Start filebeat...." filebeat run -c ./filebeat.yml -v & sleep 2 while [ ! -f ./logs/filebeat ] do sleep 2 done chown 1000 ./logs/filebeat tail -f /dev/null EOF'

繼續閱讀

sleep async await

https://gist.github.com/danharper/74a5102363fbd85f6b67 async () => { console.log('a'); await sleep(1000); console.log('b'); }

繼續閱讀

mocha supertest geth mine

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.

繼續閱讀

作者的圖片

Sue boy

Sueboy Can support You

CIO

Taiwan