Skip to content

Instantly share code, notes, and snippets.

@cooka
cooka / aws-mfa-access.sh
Created March 18, 2024 14:33 — forked from geekgunda/aws-mfa-access.sh
aws-cli MFA access via assume role
#!/bin/bash
# Assumption:
# 1. Your original AWS Creds should be stored at ~/.aws/credentials
# 2. You've corrected ARN for MFA device (search for FIXME)
# 3. You've given correct MFA Code as cli argument
# 4. You have jq installed. Ref: https://stedolan.github.io/jq/
if [ "$1" == "" ]; then
echo "Usage: `basename "$0"` <MFA-TOKEN>"
exit

jq Cheatsheet

This is as much as I needed to know for the Certified Kubernetes Administrator (CKA) exam, no more, no less.

Sections

  • A. Skill List
  • B. Example Query
  • C. Output/Result
  • D. Appendix: data.json

A. Skill List

@phuslu
phuslu / bench_test.go
Last active January 23, 2024 10:24
fast parse DeletionTimestamp from pod
package bench
import (
"testing"
)
func BenchmarkParseDeletionTimestamp(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
_, _ = ParseDeletionTimestamp(data)
@mondaychen
mondaychen / 对 React 团队工作经历的思考.md
Last active April 30, 2024 05:12
对 React 团队工作经历的思考

对 React 团队工作经历的思考

今天在写2023的年终总结,再额外聊两句在 React Core team 的经历和反思吧,也算是正式画上句号了。

我在2022 年加入了 React,算是某种程度上实现了自己的梦想:加入这个在前端领域最有影响力的团队,真的很令人骄傲。可惜加入没多久,公司就开始 hire freeze,我在的 Dev Tooling 组原先说好5个 headcount 变成了两个,工作量却一点也没少。开会讨论我们组要做什么的时候,来了二三十个人,提了五六十个想法,个个都说要做行业标杆。而现实是作为 DevTools 最主要载体的 Chrome 扩展 API 和几个 moible 工具都在不断更新,光跟进维护和解决 bug 都够忙的了。我觍着脸开口问谁能贡献一部分时间来帮我们做一个项目,人人都面露难色。 大家也能感受到,工程师们都很希望自己使用的工具能变好,但是这个东西在 Meta 这家公司里是真的排不上优先级。其实不只 React DevTools,整个 React 组都是如此。只有跟公司重视的 VR 有关系的项目才能得到资源。团队里一些想重点发展 web 方向的核心成员,即使是 Seb 和 Andrew 这种级别,也只能另谋出路,跳槽去了 Vercel。

为什么 React 在 Meta 得不到资源

我和不少同样做前端的朋友都有这样的困惑:React 在 Meta 到处都用,在业界也为 Meta 带来了巨大的名望,这么重要的项目,为什么不能多投入一点资源呢?

@thimslugga
thimslugga / setup-docker-al2023.md
Last active July 18, 2024 18:12
Setup Docker on Amazon Linux 2023
@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@milesrichardson
milesrichardson / inherit_environment_variables_from_pid_1.md
Created January 21, 2023 07:35
inherit environment variables from PID 1

You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings in /proc/1/environ, parsing the first characters up to the first = as the variable name, setting the remaining value as that variable, and exporting it.

The Code Snippet

This works with multiline environment variables, and environment variables with arbitrary values, like strings, including = or JSON blobs.

Paste this in your current terminal session to inherit the environment variables from PID 1:

@jinjier
jinjier / 250.csv
Last active July 22, 2024 02:30
JavDB Top 250 movies code list. [Updated at 2024/02]
1 LAFBD-41
2 SSNI-497
3 ABP-984
4 IPX-580
5 IPX-811
6 IPX-177
7 STARS-804
8 SMBD-115
9 ABP-968
10 ABF-017
@zmagg
zmagg / interview_prep.md
Last active August 17, 2023 22:14
How much prep did you do for the technical interviews?

How much prep did you do for the technical interviews?

I get asked this a lot so I thought I'd write it up to share. For context, I was interviewing for staff+ individual contributor roles at tech companies.

Technical Interviews

I was preparing to do some amount of live coding interviews, and some amount of pairing interviews.

Tech setup check-in

My friend Tom offered to do a pairing interview with me, which I also used to check my Zoom / screenshare setup. I screen shared from my 2019 XPS 13 for the pairing, but also had Zoom on an ipad for video/audio. I used Airpods for audio. This setup actually worked great, but it was nice to dial in some of the specifics--mic feedback from dialing in from two places, and just practice my schpiel about explaining what I was doing to the other person. Probably not useful for you unless you too, have Linux problems.

@gmorse81
gmorse81 / lk8s
Created April 23, 2022 14:40
Local kubernetes startup
#!/bin/sh
set -o errexit
up()
{
if ! docker ps > /dev/null 2>&1;
then
echo You need to install docker before running this tool
exit 1
fi