Skip to content

Instantly share code, notes, and snippets.

View wrasdf's full-sized avatar
:octocat:
Working with github

kerry wang wrasdf

:octocat:
Working with github
  • Senior Devops Engineer At Zip
  • Melbourne
  • 11:03 (UTC -12:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am wrasdf on github.
  • I am kerryw (https://keybase.io/kerryw) on keybase.
  • I have a public key ASBrrgPVEFV9BGLNfqe1B0ll-3-fgnsk2-MJBtO2ZVnRago

To claim this, I am signing this object:

@wrasdf
wrasdf / jq-cheetsheet.md
Created November 4, 2020 02:36 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@wrasdf
wrasdf / postgres_queries_and_commands.sql
Created July 9, 2020 08:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@wrasdf
wrasdf / nginx.conf
Created May 24, 2019 05:01 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@wrasdf
wrasdf / defaultdns.md
Created March 2, 2019 08:45 — forked from superseb/defaultdns.md
Change default DNS nameserver used by Kubernetes pods

Change default DNS nameserver used by Kubernetes pods

This can be applied generically but usually applies to Linux nodes that have a local caching nameserver running, which means pointing to an IP in the loopback range (127.0.0.0/8). Ubuntu 18.04 Bionic Beaver does this by default.

Option 1: Change host configuration

sudo systemctl mask systemd-resolved
rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
@wrasdf
wrasdf / 1.rreaddir.js
Created February 13, 2019 10:59 — forked from timoxley/1.rreaddir.js
async/await recursive fs readdir
import { join } from 'path'
import { readdir, stat } from 'fs-promise'
async function rreaddir (dir, allFiles = []) {
const files = (await readdir(dir)).map(f => join(dir, f))
allFiles.push(...files)
await Promise.all(files.map(async f => (
(await stat(f)).isDirectory() && rreaddir(f, allFiles)
)))
return allFiles
@wrasdf
wrasdf / static-site.yaml
Created November 14, 2018 07:08 — forked from stu-smith/static-site.yaml
AWS CloudFormation for HTTPS static website hosting using S3, CloudFront, and ACM
AWSTemplateFormatVersion: 2010-09-09
Parameters:
RootDomainName:
Type: String
Mappings:
RegionMap:
us-east-1:
S3HostedZoneID: Z3AQBSTGFYJSTF
S3WebsiteEndpoint: s3-website-us-east-1.amazonaws.com
us-west-1:
@wrasdf
wrasdf / static-site.yaml
Created November 14, 2018 07:08 — forked from stu-smith/static-site.yaml
AWS CloudFormation for HTTPS static website hosting using S3, CloudFront, and ACM
AWSTemplateFormatVersion: 2010-09-09
Parameters:
RootDomainName:
Type: String
Mappings:
RegionMap:
us-east-1:
S3HostedZoneID: Z3AQBSTGFYJSTF
S3WebsiteEndpoint: s3-website-us-east-1.amazonaws.com
us-west-1:
@wrasdf
wrasdf / curl.md
Created September 28, 2018 14:00 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@wrasdf
wrasdf / dashboard.sh
Created September 10, 2018 03:56
Create a dashboard for Kubernetes
#!/bin/bash
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.8.3/src/deploy/recommended/kubernetes-dashboard.yaml
cat <<EOF | kubectl apply -f -
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubernetes-dashboard
namespace: kube-system