Skip to content

Commit fb81037

Browse files
committed
...
1 parent 9dd1710 commit fb81037

File tree

4 files changed

+89
-127
lines changed

4 files changed

+89
-127
lines changed

misc/content/2022/05/tips-on-gcp/tips-on-gcp.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Status: published
22
Date: 2022-05-09 23:39:30
3-
Modified: 2024-02-27 22:38:17
3+
Modified: 2025-05-08 15:20:14
44
Author: Benjamin Du
55
Slug: tips-on-gcp
66
Title: Tips on GCP
@@ -31,6 +31,10 @@ https://cloud.google.com/compute/docs/compute-optimized-machines#c2d-high-cpu
3131

3232
https://cloud.google.com/compute/docs/compute-optimized-machines#c2d-high-mem
3333

34+
## Google Cloud Shell
35+
36+
- [Using Google Cloud Shell](https://cloud.google.com/shell/docs/using-cloud-shell)
37+
3438
## Install Google Cloud CLI
3539

3640
Please refer to
@@ -40,6 +44,22 @@ for instructions.
4044
gcloud init
4145
gcloud auth application-default login
4246

47+
## GitHub Actions & GCP
48+
49+
- [actions-runner-controller](https://github.com/actions/actions-runner-controller)
50+
51+
- [Optimizing Costs with GitHub Actions: Dynamically Starting and Stopping Self-Hosted Runner VMs](https://nakamasato.medium.com/optimizing-costs-with-github-actions-self-hosted-runner-dynamically-starting-and-stopping-gcp-vms-c04acb69bdee)
52+
53+
1. You must allow http and https traffic for it to work.
54+
For more instructions,
55+
pelase refer to
56+
[Setup GitHub Actions self-hosted runners on Google Compute Engine Instance](https://www.youtube.com/watch?v=yfMzNVtQsVw)
57+
.
58+
4359
## References
4460

61+
- [GCP Compute Engine VM Instances]( https://www.legendu.net/misc/blog/gcp-compute-engine-vm-instances )
62+
63+
- [Tips on BigQuery]( https://www.legendu.net/misc/blog/tips-on-bigquery )
64+
4565
- [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc)

misc/content/2022/10/recommendation-of-credit-card-usage/recommendation-of-credit-card-usage.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Status: published
22
Date: 2022-10-09 16:34:06
3-
Modified: 2025-05-05 07:54:21
3+
Modified: 2025-05-08 14:36:38
44
Author: Benjamin Du
55
Slug: recommendation-of-credit-card-usage
66
Title: Recommendation of Credit Card Usage
@@ -449,7 +449,6 @@ Tags: Life, shopping, discount, credit card, coupon, money, finance
449449
</tbody>
450450
</table>
451451

452-
- [1]: For flights booked directly with airlines or on amextravel.com.
453452
- [2]: On eligible travel purchases only
454453
- [3]: Amazon Prime membership is required to enjoy the discount.
455454
- [4]: Robinhood Gold Card gives you 5% cash back
@@ -468,8 +467,6 @@ Tags: Life, shopping, discount, credit card, coupon, money, finance
468467

469468
- [Citi-Costco Credit Card Offers](https://online.citi.com/US/ag/citioffersforyou)
470469

471-
- [Amex Auto Purchasing Program](https://global.americanexpress.com/card-benefits/detail/auto-purchase-program/gold?account_key=F9F70B1ECFC6CC21CC84700CE77CAD92)
472-
473470
## Credit Cards Without Foreign Transaction Fees
474471

475472
- Robinhood Gold Card

misc/content/2023/07/gcp-compute-engine-vm-instances/gcp-compute-engine-vm-instances.ipynb

Lines changed: 0 additions & 122 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Author: Benjamin Du
2+
Date: 2023-07-01 17:57:54
3+
Modified: 2025-05-08 12:15:01
4+
Title: GCP Compute Engine VM Instances
5+
Slug: gcp-compute-engine-vm-instances
6+
Category: Computer Science
7+
Tags: Computer Science, programming, cloud, GCP, VM, compute engine, spot, Google
8+
9+
**Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!**
10+
11+
## GCP
12+
13+
GCP c2 and c3 VMs are good choices according to performance per price.
14+
It's even cheaper than customized VM types with reduced memories!
15+
GCP c2 VMs are compute optimized and are ideal for CPU intensive workloads.
16+
Note that GCP c2 spot VMs are even cheaper than AWS t2.nano VMs
17+
if you can stand your VM being preempted.
18+
19+
![gcp-c2-price](https://user-images.githubusercontent.com/824507/250313656-891cd99a-c9a0-4004-9158-fd87503c39a6.png)
20+
21+
![gcp-c3-price](https://user-images.githubusercontent.com/824507/250313771-b776b124-5503-4aa9-a457-a55452bfdf67.png)
22+
23+
## Create GCP VMs Using Command Line
24+
25+
```
26+
gcloud compute instances create instance-20240304-20240304-064337 \
27+
--project=crested-studio-416206 \
28+
--zone=northamerica-northeast1-c \
29+
--machine-type=e2-medium \
30+
--network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default \
31+
--maintenance-policy=MIGRATE \
32+
--provisioning-model=STANDARD \
33+
--service-account=170261695503-compute@developer.gserviceaccount.com \
34+
--scopes=https://www.googleapis.com/auth/cloud-platform \
35+
--tags=https-server,lb-health-check \
36+
--create-disk=auto-delete=yes,boot=yes,device-name=instance-20240304-062735,image=projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20240228,mode=rw,size=10,type=projects/crested-studio-416206/zones/northamerica-northeast1-c/diskTypes/pd-balanced \
37+
--no-shielded-secure-boot \
38+
--shielded-vtpm \
39+
--shielded-integrity-monitoring \
40+
--labels=goog-ec-src=vm_add-gcloud \
41+
--reservation-affinity=any
42+
```
43+
## Query GCP VMs
44+
45+
```
46+
gcloud compute instances list --format='table(name,status,lastStartTimestamp,lastStopTimestamp.list())'
47+
```
48+
49+
## Google Cloud Logging
50+
51+
https://console.cloud.google.com/logging
52+
53+
## References
54+
55+
- [Comparison of Popular Cloud Platforms]( https://www.legendu.net/misc/blog/comparison-of-popular-cloud-platforms )
56+
57+
- [GCP - Create a VM with a custom machine type](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type)
58+
59+
- [GCP - Free cloud features and trial offer](https://cloud.google.com/free/docs/free-cloud-features#compute)
60+
61+
- [GCP - Choosing the right virtual machine type](https://cloud.google.com/compute#section-6)
62+
63+
- [GCP Product Calculator](https://cloud.google.com/products/calculator)
64+
65+
- [GCP - Compute Engine Pricing](https://cloud.google.com/compute/all-pricing)
66+
67+

0 commit comments

Comments
 (0)