Skip to content

Instantly share code, notes, and snippets.

View cage1016's full-sized avatar

Kai-Chu Chung cage1016

View GitHub Profile
@cage1016
cage1016 / crc-on-google-cloud.md
Created March 6, 2022 04:43 — forked from pottava/crc-on-google-cloud.md
CodeReady Containers (crc)

Setup a CRC instance on Google Cloud

1. Create a VM

vm_name=
gcloud compute instances create \
    "${vm_name}" --zone asia-northeast1-c \
    --image-project=ubuntu-os-cloud --image-family=ubuntu-2004-lts \
    --machine-type "n1-custom-14-36864" --boot-disk-size 300G --boot-disk-type pd-standard \
@cage1016
cage1016 / workflow-install.py
Created December 1, 2021 01:53 — forked from goncharov/workflow-install.py
Script to install/symlink Alfred workflows. Useful for workflow developers.
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2013 <deanishe@deanishe.net>.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@cage1016
cage1016 / sh
Created May 28, 2020 05:41
f1-micro run code-server
gcloud compute firewall-rules create rule-allow-tcp-8080 --source-ranges 0.0.0.0/0 --target-tags allow-tcp-8080 --allow tcp:8080
gcloud compute instances create-with-container vscode \
--zone us-east1-b \
--container-stdin \
--container-tty \
--container-mount-host-path=mount-path=/home/coder/project,host-path=/mnt/disks/data,mode=rw \
--container-image=codercom/code-server:latest \
--machine-type=f1-micro \
--metadata=^:^startup-script='#! /bin/bash
@cage1016
cage1016 / sh
Created May 28, 2020 05:40
gsutil notification by GCS subfolder
gsutil notification create \
-t pubsup-topic-h8Iqlb8Ixc4IltuOoY5QC-IKYw9Yu7l88fmXLfA5Qsr -f json \
-e OBJECT_FINALIZE \
-p h8Iqlb8Ixc4IltuOoY5QC/IKYw9Yu7l88fmXLfA5Qsr/ gs://mongodb_daily_backup
@cage1016
cage1016 / a.md
Created May 14, 2020 09:40
How to Stop and Remove Multiple Docker Containers

Stopping All Containers

$ docker stop $(docker ps -a -q)

Removing All Containers

$ docker rm $(docker ps -a -q)
@cage1016
cage1016 / crontab
Last active February 27, 2020 07:04
mask-9999
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system