View gist:06fe6a91c77b9d222d9b392bb386dd9c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Install jq | |
- To see docker container networks run: | |
docker inspect [container_id] | jq .[] | jq .NetworkSettings.Networks[] | |
This will give network ids. | |
- To see available networks with ids and names run docker network ls |
View generate.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python3 -c 'import numpy as np;randnums = list(np.random.randint(1,101,5000));print(randnums)' | xsel |
View maven commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create project via command line: | |
mvn archetype:generate "-DgroupId=com.roman.tasks" | |
"-DartifactId=RateLimiter" "-DarchetypeArtifactId=maven-archetype-quickstart" | |
View run_volume_container.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -v /tmp/cache:/cache --entrypoint true --name cache todobackend-dev | |
docker run --rm --volumes-from cache todobackend-dev |
View demo_reader___init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('hi') |
View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.idea |
View start_cocroach_db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker network create -d overlay --attachable cockroach | |
docker service create --name cockroach-init --network cockroach --mount type=volume,source=cockroach-init,target=/cockroach/cockroach-data --publish 8085:8080 cockroachdb/cockroach:v2.1.3 start --logtostderr --insecure --advertise-addr=cockroach-init | |
docker service create --replicas 4 --network cockroach --name cockroach --mount "type=volume,source={{.Service.Name}}-{{.Task.Slot}},target=/cockroach/cockroach-data" cockroachdb/cockroach:v2.1.3 start --logtostderr --insecure --join=cockroach-init | |
docker service create --replicas 2 --network cockroach --name api --env "ConnectionStrings:StoreContext=Host=cockroach;Port=26257;Database=store;Username=root" --publish '8095:80' psodstorage/store-api | |
docker service create --replicas 6 --network cockroach --name web --env "ConnectionStrings:StoreContext=Host=cockroach;Port=26257;Database=store;Username=root" --publish '8097:80' psodstorage/store-web |
View readable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Readable} = require('stream') | |
const inStream = new Readable( { | |
read(size) { | |
setTimeout(() => { | |
this.push(String.fromCharCode(this.currentCharCode++)) | |
if (this.currentCharCode > 90) { | |
this.push(null) | |
} | |
}, 100) |
View readable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Readable} = require('stream') | |
const inStream = new Readable( { | |
read(size) { | |
this.push(String.fromCharCode(this.currentCharCode++)) | |
if (this.currentCharCode > 90) { | |
this.push(null) | |
} | |
} | |
}); |
View writable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const { Writable } = require('stream') | |
// const outStream = new Writable({ | |
// write(chunk, encoding, callback) { | |
// console.log(chunk.toString()); | |
// callback(); | |
// } | |
// }) | |
// process.stdin.pipe(outStream) |
NewerOlder