Skip to content

Instantly share code, notes, and snippets.

View tuannvm's full-sized avatar
🇺🇲

Tommy Nguyen tuannvm

🇺🇲
View GitHub Profile
@tuannvm
tuannvm / user_data.yaml
Last active January 7, 2021 12:27
#do #digitalocean #vpn #outline
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
@tuannvm
tuannvm / openbox.xml
Last active March 17, 2020 01:44
#raspberry #desktop
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
@tuannvm
tuannvm / note.md
Created June 20, 2019 03:51
#gitlab #note
  • Need to disable shared runner for new repository
@tuannvm
tuannvm / note.md
Last active June 22, 2019 14:04
#servicemesh #istio

Isitio evaluation

Setting Request Timeouts

One more thing to note about timeouts in Istio is that in addition to overriding them in route rules, as you did in this task, they can also be overridden on a per-request basis if the application adds an x-envoy-upstream-rq-timeout-ms header on outbound requests. In the header, the timeout is specified in milliseconds instead of seconds.

Doesn't work in istio-enabled GKE, as right after we try to modify ingressgateway GKE will try to revert that :(

@tuannvm
tuannvm / summary.md
Created May 24, 2019 00:05
#gcp #cloudrun

Evaluation

Pros

Cons

  • Only support us-central1 atm
  • 3 predefined roles
    • admin
  • invoker
@tuannvm
tuannvm / error.py
Last active June 18, 2019 00:18
#bigquery
[2019-05-21 08:34:07,793] {{logging_mixin.py:95}} WARNING - /usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/bigquery_hook.py:117: FutureWarning: verbose is deprecated and will be removed in a future version. Set logging level in order to vary verbosity
verbose=False)
[2019-05-21 08:34:07,835] {{__init__.py:1580}} ERROR - __init__() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/models/__init__.py", line 1441, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 112, in execute
return_value = self.execute_callable()
File "/usr/local/lib/python3.6/site-packages/airflow/operators/python_operator.py", line 117, in execute_callable
return self.python_callable(*self.op_args, **self.op_kwargs)
@tuannvm
tuannvm / cloudflare.sh
Last active May 16, 2019 08:59
#cloudflare #cache #script
#!/bin/bash
commit_url="https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/purge_cache"
data=$(cat <<EOF
{
"files":["$CF_HOST"]
}
EOF
)
curl -XPOST "$commit_url" -d "$data" \
@tuannvm
tuannvm / gcs.tf
Created January 25, 2019 07:04
#90s #blog #gitlab
resource "google_storage_bucket" "gitlab_runner" {
name = "${local.name}-cache"
}
resource "google_storage_bucket_iam_binding" "gitlab_runner" {
bucket = "${google_storage_bucket.gitlab_runner.name}"
role = "roles/storage.objectAdmin"
members = [
"serviceAccount:${google_service_account.gke.email}",
@tuannvm
tuannvm / gitlab-runner.yaml
Last active August 23, 2020 09:39
#90s #blog #gitlab
gitlabUrl: https://gitlab.com/
runnerRegistrationToken: "<registration token>"
unregisterRunners: true
logLevel: info
runners:
# quite important for speeding up the build
imagePullPolicy: "if-not-present"
cache:
# s3 | gcs
cacheType: "gcs"
@tuannvm
tuannvm / gke.tf
Last active January 25, 2019 06:45
#90s #blog #gitlab
resource "google_container_node_pool" "gitlab_runner" {
autoscaling = {
min_node_count = 1
max_node_count = 6
}
node_config {
machine_type = "n1-standard-8"
preemptible = true
}
}