-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcommands.txt
101 lines (75 loc) · 3.02 KB
/
commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* create and run all containers */
docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml up -d
/* stop and remove all running containers */
docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml down
/* build and run all running containers */
docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml up --build
/* display the list of all running containers */
docker ps
/* display the list of all images */
docker images
/* display the list of all volumes */
docker volume ls
/* stop container */
docker stop << First 4 Characters of Container ID >>
/* remove container */
docker rm << First 4 Characters of Container ID >>
/* remove image */
docker rmi << First 4 Characters of Image ID >>
/* remove volume */
docker volume rm << Volume Name >>
/* stop all containers */
docker stop $(docker ps -a -q)
/* remove all containers */
docker rm -f $(docker ps -a -q)
/* remove all images */
docker rmi -f $(docker images -a -q)
/* remove all volumes */
docker volume rm $(docker volume ls -q)
/* remove all unused containers and images */
docker system prune
/* remove all unused volumnes */
docker volume prune
********************************************************************************************
/* update out dated packages */
Update-Package -ProjectName << Project Name >>
/* installing quick start for identityserver4 */
dotnet new -i identityserver4.templates
dotnet new is4ui
/* installing migration tool */
dotnet tool install --global dotnet-ef
/* create migration for identityserver4 */
dotnet ef migrations add InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/PersistedGrantDb
dotnet ef migrations add InitialIdentityServerConfigurationDbMigration -c ConfigurationDbContext -o Data/Migrations/ConfigurationDb
/* remove migrations for identityserver4 */
dotnet ef migrations remove
/* setup the migration */
Add-Migration InitialCreate -context ConfigurationDbContext
********************************************************************************************
/* mongo bash commands */
docker exec -it shopping-mongo /bin/bash
ls
mongo
show dbs
use CatalogDb
db.createCollection('Products')
db.Products.insertMany([{ 'Name':'Asus Laptop','Category':'Computers', 'Summary':'Summary', 'Description':'Description', 'ImageFile':'ImageFile', 'Price':54.93 }, { 'Name':'HP Laptop','Category':'Computers', 'Summary':'Summary', 'Description':'Description', 'ImageFile':'ImageFile', 'Price':88.93 } ])
db.Products.find({}).pretty()
db.Products.remove({})
show databases
show collections
/* redis bash commands */
docker exec -it aspnetrun-redis /bin/bash
redis-cli
ping
set key value
get key
/* database scripts */
CREATE TABLE Coupon(
ID SERIAL PRIMARY KEY NOT NULL,
ProductName VARCHAR(24) NOT NULL,
Description TEXT,
Amount INT
);
INSERT INTO Coupon (ProductName, Description, Amount) VALUES ('IPhone X', 'IPhone Discount', 150);
INSERT INTO Coupon (ProductName, Description, Amount) VALUES ('Samsung 10', 'Samsung Discount', 100);