forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.codespaces_alias
90 lines (75 loc) · 3.67 KB
/
.codespaces_alias
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
#!/bin/bash
# Some codespace shortcut I use
alias killports="fuser -k 59228/tcp && fuser -k 53760/tcp && fuser -k 59330/tcp"
alias build_service="dotnet build $VSCLK_ROOT"
alias clean_service="dotnet clean $VSCLK_ROOT"
alias build_agent="dotnet build $CASCADE_ROOT/dirs.proj"
alias clean_agent="dotnet clean $CASCADE_ROOT/dirs.proj"
alias cdnginx="cd /workspaces/codespaces-service/nginx"
alias cdreporoot="cd $CODESPACE_ROOT"
alias cdshared="cd /workspaces/.codespaces/shared"
alias cdpersistedshared="cd /workspaces/.codespaces/.persistedshare"
alias fixdevstamp="devtool setupDevStamp -p 1 -ar 0"
alias mydevstampurl='echo "https://codespaces.servicebus.windows.net/kumarad"'
alias runts="/workspaces/codespaces-service/bin/service/debug/TokenService/Microsoft.VsSaaS.Services.TokenService"
# Rename codespace
function rename_cs() {
gh api -X PATCH user/codespaces/$CODESPACE_NAME -f display_name="${1}"
}
# Some PFS helper notes I use
alias pfs_help='echo "./setup.sh --pfs-tag kumarad-debug --pfa-tag kumarad-debug
./install-tf.sh
ls -la
./setup.sh
./build-debug-pfs.sh
./setup.sh --pfs-tag kumarad-debug --pfa-tag kumarad-debug
pwd
ls -la
./start.sh
./build/port-forwarding/watch-pfs.sh
stern web-port-forwarding-web-api --tail=0 -o=json
az aks get-credentials -n kumarad-cluster -g kumarad-pfs --sub 86642df6-843e-4610-a956-fdd497102261
stern web-port-forwarding-web-api --tail=0 -o=json
./build/port-forwarding/watch-pfs.sh
az login
docker ps
docker logs 460
docker logs 46d
======
Outputs:
cluster_external_ip = "20.99.191.65"
custer_context_command = "az aks get-credentials -n kumarad-cluster -g kumarad-pfs --sub 86642df6-843e-4610-a956-fdd497102261"
serviceBusNamespaceName = "kumaradsb"
serviceBusResourceGroupName = "kumarad-pfs"
update_portal_chart = "helm upgrade portal ../../src/services/containers/VsClk.Portal.WebSite/Charts/vsclk-portal-website -f ../../src/services/deploy/charts/common/vsclk-online-dev-alias.yaml -f ../../src/services/deploy/charts/common/values.dev-generated.yaml"
update_web_chart = "helm upgrade web ../../bin/debug/Deploy/web -f ../../bin/debug/Deploy/web/values.dev-alias.yaml -f ../../bin/debug/Deploy/web/values.dev-generated.yaml"
"'
# Some gh/gh helper notes I use
alias gh_help='echo "1. script/server or script/server --debug or script/server --codespaces —-debug
2. bin/toggle-feature-flag enable codespaces_developer monalisa
3. bin/toggle-feature-flag enable codespaces_prebuild_settings monalisa
4. binding.pry
5. bin/rails routes -c Codespaces
6. rails test test/integration/api/internal/codespaces_test.rb:509
7. bin/programmatic-access update or bin/safe-ruby script/programmatic-access update
"'
# How to log body of requests
alias http_help='echo "app.Use(async (context, next) =>
{
string requestId = "unknown";
if (context.Request.Headers.TryGetValue("X-Request-ID", out var requestIdValues) && requestIdValues.FirstOrDefault() is string singleRequestId && !string.IsNullOrEmpty(singleRequestId))
{
requestId = singleRequestId;
}
context.GetLogger()?.AddBaseValue("GitHubRequestId", requestId);
context.GetLogger()?.AddBaseValue("ContextRequestBody1", context.Request.Body.ToString());
var initialBody = context.Request.Body;
using (var bodyReader = new StreamReader(context.Request.Body))
{
string body = await bodyReader.ReadToEndAsync();
Console.WriteLine(body);
context.GetLogger()?.AddBaseValue("ContextRequestBody2", body);
await next.Invoke();
}
});
"'