Skip to content

Instantly share code, notes, and snippets.

View kamarton's full-sized avatar
👀

Márton Somogyi kamarton

👀
View GitHub Profile
@kamarton
kamarton / bigquery-example.sh
Created March 16, 2025 09:06
Bigquery cli example json output (GCP)
#!/usr/bin/env bash
bq query \
--nouse_legacy_sql \
--format=prettyjson \
'SELECT city, count(*) as g_count FROM `bigquery-public-data.fda_drug.drug_enforcement` WHERE status="Terminated" GROUP BY status, city HAVING g_count > 100 ORDER BY g_count DESC'
@kamarton
kamarton / rdp-connect.sh
Last active March 16, 2025 08:46
RDP connection with multiple monitors - xfreerdp linux cli
#!/usr/bin/env bash
USERNAME=<username>
HOST=<host>
xfreerdp \
/monitors:0,1 \ # miltiple monitors with order
/multimon \ # multiple monitors
/u:$USERNAME \ # RDP username
/v:$HOST # RDP host
@kamarton
kamarton / stop.sh
Created March 15, 2025 15:57
Stop compute engine, detach disk, (delete snapshot id exists), create snapshot, delete disk (GCP, CLI, GCLOUD)
#!/usr/bin/env bash
PROJECT=<project>
ZONE=<zone>
INSTANCE=<compute-engine-instance>
DISK=<disk-name>
SNAPSHOT=<snapshot-name>
REGION=<region>
echo stop vm - - - - - - - - - - - - - - - - - - - - - -
@kamarton
kamarton / start.sh
Last active March 15, 2025 15:54
Create disk from snapshot attach to compute engine and start it (GCP, CLI, GCLOUD)
#!/usr/bin/env bash
PROJECT=<project>
ZONE=<zone>
INSTANCE=<compute-engine-instance>
DISK=<disk-name>
SNAPSHOT=<snapshot-name>
REGION=<region>
echo create disk from snapshot - - - - - - - - - - - - - - -
@kamarton
kamarton / gpc-cloud-run-build-and-deploy.sh
Created March 15, 2025 15:24
Google Cloud - Cloud run build and deploy command (CLI)
#!/usr/bin/env bash
gcloud run deploy \
<name> \
--project=<project-name> \
--region=<region> \
--source .
@kamarton
kamarton / gcloud-ce.sh
Created October 12, 2024 07:40
gcloud compute engine commands example
#!/bin/bash
# SSH connect to instance
gcloud compute ssh --zone <ZONE> <INSTANCE>
# SCP copy to instance
gcloud compute scp --zone <ZONE> <LOCAL-PATH> <INSTANCE>:<PATH-TO-REMOTE-DESTINATION>