Skip to content

Instantly share code, notes, and snippets.

View adityasatrio's full-sized avatar
👻
I may be slow to respond.

Aditya satrio nugroho adityasatrio

👻
I may be slow to respond.
View GitHub Profile
private void validateCheckSum(DocumentUploadRequest documentUploadRequest) {
long checksumValue = Utilities.checksum(documentUploadRequest.getDocument().getBytes());
long checksumReq = Long.parseLong(documentUploadRequest.getDocumentChecksum());
Logger.info("Checksum Document request " + checksumReq);
Logger.info("Checksum Document calculate " + checksumValue);
if (checksumReq != checksumValue) {
Logger.info("Checksum Document calculate " + checksumValue);
throw new ConstraintValidationException("Checksum vallidation failed");
}
}
@adityasatrio
adityasatrio / gcp cheat sheet compute engine
Last active April 5, 2023 02:11
GCP cheat sheet instance compute engine type - sorted from lowest resource/cost
- f1-micro: This is a shared-core instance type that provides 0.2 vCPU and 0.6 GB of memory, and is designed for small workloads and development environments.
- g1-small: This is a first-generation instance type that provides a single shared vCPU and 1.7 GB of memory, and is slightly more powerful than f1-micro.
- e2-micro: This is a second-generation shared-core instance type that provides 0.25 vCPU and 1 GB of memory, and is a bit more powerful than g1-small.
- e2-small: This is a second-generation instance type that provides 2 vCPUs and 2 GB of memory, and is optimized for small workloads that require a balance of compute and memory resources.
- e2-medium: This is a second-generation instance type that provides 2 vCPUs and 4 GB of memory, and is a good option for workloads that require more memory than e2-small.
@adityasatrio
adityasatrio / git-switch
Last active April 22, 2025 07:43
Git multiple account script
follow this tutorial until step 4 https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/
bash script that implements the functionality you've requested. Save this as a file named git-switch and make sure to give it executable permissions (you can do this with chmod +x git-switch).
Please replace [PATH_TO_BROWSER] with your actual browser executable path, and replace https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/ with the link you want to open when 'help' is invoked.
```
#!/bin/bash
function usage() {
echo "Possible commands:"