Skip to content

Instantly share code, notes, and snippets.

👬

Yong Wen Chua lawliet89

👬
Block or report user

Report or block lawliet89

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lawliet89
lawliet89 / gist:a376473c24bbc7c9f27695c9bc66a289
Last active Sep 15, 2019
Indonesia Reddit Banning via DNS
View gist:a376473c24bbc7c9f27695c9bc66a289
$ dig @8.8.8.8 reddit.com
; <<>> DiG 9.11.5-P1-1ubuntu2.5-Ubuntu <<>> @8.8.8.8 reddit.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25135
;; flags: qr rd; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
@lawliet89
lawliet89 / spec.yaml
Created Sep 6, 2019
Update kube-config affinity
View spec.yaml
spec:
template:
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
@lawliet89
lawliet89 / test.sh
Created Jul 16, 2019
Terraform Provider Tests
View test.sh
make testacc TESTARGS='-run=TestAccAWSCloudWatchDashboard_update'
View serde_expanded.rs
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
use serde::{Deserialize, Serialize};
pub struct Test {
pub foo: String,
pub bar: bool,
View gist:0258872b901513386f10a5b1c8f755a0
2019/01/18 15:24:07 [INFO] Terraform version: 0.11.11 ac4fff416318bf0915a0ab80e062a99ef3724334
2019/01/18 15:24:07 [INFO] Go runtime version: go1.11.1
2019/01/18 15:24:07 [INFO] CLI args: []string{"/home/xxx/apps/terraform", "apply", "-var-file=/home/xxx/work/infrastructure/environments/admin/test/../common.tfvars", "-var-file=/home/xxx/work/infrastructure/environments/admin/test/../../organization.tfvars"}
2019/01/18 15:24:07 [DEBUG] Attempting to open CLI config file: /home/xxx/.terraformrc
2019/01/18 15:24:07 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/01/18 15:24:07 [INFO] CLI command args: []string{"apply", "-var-file=/home/xxx/work/infrastructure/environments/admin/test/../common.tfvars", "-var-file=/home/xxx/work/infrastructure/environments/admin/test/../../organization.tfvars"}
2019/01/18 15:24:07 [INFO] command: backend initialized: *gcs.Backend
2019/01/18 15:24:07 [DEBUG] checking for provider in "."
2019/01/18 15:24:07 [DEBUG] checking for provider in "/home/xxx/apps"
2019/01/1
@lawliet89
lawliet89 / consul.json
Last active Jan 2, 2019
Prometheus Dashboards
View consul.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View gist:46bb64207c420762fb90ffc465edde6a
2018/11/07 15:13:18 [INFO] Packer version: 1.3.2
2018/11/07 15:13:18 Packer Target OS/Arch: linux amd64
2018/11/07 15:13:18 Built with Go Version: go1.11.1
2018/11/07 15:13:18 Detected home directory from env var: /home/yongwen
2018/11/07 15:13:18 Using internal plugin for ncloud
2018/11/07 15:13:18 Using internal plugin for alicloud-ecs
2018/11/07 15:13:18 Using internal plugin for azure-arm
2018/11/07 15:13:18 Using internal plugin for cloudstack
2018/11/07 15:13:18 Using internal plugin for triton
2018/11/07 15:13:18 Using internal plugin for lxd
@lawliet89
lawliet89 / ec2.tf
Created Sep 4, 2018
Terraform Demo Snippet
View ec2.tf
resource "aws_instance" "instance" {
ami = "${data.aws_ami.ubuntu.id}"
instance_type = "${var.instance_type}"
key_name = "${var.ssh_key_name}"
subnet_id = "${var.subnet_id}"
vpc_security_group_ids = ["${aws_security_group.instance.id}"]
tags = "${merge(var.tags, map("Name", "${var.name}"))}"
volume_tags = "${merge(var.tags, map("Name", "${var.name}"))}"
@lawliet89
lawliet89 / ubuntu.tf
Created Sep 4, 2018
Terraform Demo Snippet
View ubuntu.tf
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
@lawliet89
lawliet89 / sg.tf
Created Sep 4, 2018
Terraform Demo Snippets
View sg.tf
resource "aws_security_group" "instance" {
name = "${var.name}"
vpc_id = "${var.vpc_id}"
tags = "${merge(var.tags, map("Name", "${var.name}"))}"
}
resource "aws_security_group_rule" "ssh_inbound" {
type = "ingress"
from_port = 22
You can’t perform that action at this time.