Elvis Ciotti

in case you are getting this error after updating kubectl

error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

Double check the current version

 kubectl version

if you are at Major:1 and Minor: 24, then you probably need to downgrade to 1.23.6

How to do that on Apple Silicon /M1

cd /tmp
sudo rm -f /usr/local/bin/kubectl
curl -LO "https://dl.k8s.io/release/v1.23.6/bin/darwin/arm64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
sudo chown root: /usr/local/bin/kubectl
kubectl version

Full instructions here

--

--

When loaded via webpack, REACT_APP_ variable are not visible from react components.

To make custom variable vibible inside tsx files, define them in webpack via the DefinePlugin.

# webpack.config.js.. here you can read the process.env.variables from nodeconst PROCESS_ENV_NODE_ENV = process.env.NODE_ENV ? process.env.NODE_ENV : 'local';module.exports = {
...
new webpack.DefinePlugin({
...
'process.env.REACT_APP_ENVIRONMENT': JSON.stringify(PROCESS_ENV_NODE_ENV),
}),
...
};
The you can read them in react by accessing`process.env.REACT_APP_ENVIRONMENT`Note 1: In my current version, it didn't work with variable named PROCESS_ENV
Note 2: the prefix process.env is mandatory for the variable

--

--

If you need a lightweight editor to edit some content/notes, but IntelliJ is too slow to start, you can use the free Atom.

Install Atom

Download from here

Command line (Mac OSX)

Paste this into your bash init file (~/.zshrc or ~/.bash_profile)

atom() { open -na "Atom.app" --args "$@" }

or place the following into `/usr/local/bin/atom`

#/bin/sh
open -na "Atom.app" --args "$@"

To use, just type atom ~/your-dir or atom ~/path/to/your-file

Set Webstorm/IntelliJ shortcuts

Follow the instructions here

  • open the Atom menu, and select Install Shell Commands
  • apm install intellij-idea-keymap

--

--