Vishal Chandra (@obi-wan-kenobi-84) | Code Tips

obi-wan-kenobi-84's cover image
Powered by FIFO
obi-wan-kenobi-84's image

Vishal Chandra

Building solutions for innovators

Followers57
Following34
Spaces10

Handy terminal commands

1. To give approval to open an app on MacOS that Apple is not allowing you to.

Here is the error you will see: "App name" is damaged and cannot be opened. You should move it to the bin.

Command to allow the app to be opened:

xattr -d com.apple.quarantine /path/to/app.app

IMP: Do this only for trusted apps.

8

A Kubernetes deployment typically uses self-issued certificates, but those can get mismatched etc.

Then when connecting with nodes we start getting the “x509: certificate signed by unknown authority” error message.

One way to fix this is by resetting the certificates.

sudo dpkg-reconfigure ca-certificates

5

What's an easy quick way to do DNS lookup?

# dig google.com ANY +noall +answer

Try it out and share what you get for your domain?

8

How to generate a random token on your local machine?

# Best option for a token:

export TOKEN=$(openssl rand -base64 64)

# Fallback for no openssl, on a Linux host:

export TOKEN=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 64)

# Failing that, then try:

export TOKEN=$(head -c 64 /dev/urandom|shasum| cut -d - -f 1)

Then view your token by echo $TOKEN

6

Sometimes you just need to run a web server on your local system Maybe to try out some front-end code. What's the easiest way to do that?