Skip to content

Instantly share code, notes, and snippets.

View tuannvm's full-sized avatar
🎯
Focusing

Tommy Nguyen tuannvm

🎯
Focusing
View GitHub Profile
@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
}
}
@tuannvm
tuannvm / Storage.md
Last active March 26, 2019 01:58
#gcp #cheatsheet

GCP

VPCs

  • Can share accross projects
  • 5 networks per project
  • 7000 instances per network
  • Mode
    • Auto mode
  • Single subnet per region by default
@tuannvm
tuannvm / convert
Created November 17, 2018 03:07
#blog #backup
It's fairly simple indeed.
Installation:
On Ubuntu:
apt-get install units
On Mac OSX:
brew install gnu-units
Example:
1024 bytes to MB
@tuannvm
tuannvm / Makefile
Last active January 10, 2024 14:38 — forked from isaacs/Makefile
#makefile #cheatsheet
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@tuannvm
tuannvm / fluentd.md
Last active November 2, 2017 05:40
#fluentd #loggly #cheatsheet

Buffer plugin:

All buffered output plugins support the following parameters:

<match pattern>
  # omit the part about @type and other output parameters

  buffer_type memory
  buffer_chunk_limit 256m
 buffer_queue_limit 128