This command should be run on the local machine.
gcloud compute ssh [user@]machineName -- -NL LOCALPORT:localhost:REMOTEPORT| # https://apple.stackexchange.com/questions/80058/lock-screen-command-one-liner | |
| # By itself, this command only causes the display to sleep, resulting in a black screen. | |
| # By configuring your computer to require a password immediately after sleep, | |
| # this one-liner works as a "lock computer" command. | |
| pmset displaysleepnow |
| sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness' | |
| sudo sh -c 'echo 1 > /sys/class/leds/led0/brightness' |
| certbot certonly --manual --preferred-challenges dns -d domain.com |
| brew install --cask google-cloud-sdk | |
| source "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc" | |
| source "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc" |
| echo "url=SOME_URL\nprotocol=https" | git credential reject |
| system_profiler SPBluetoothDataType |
| echo "Creating remote resource" | |
| gcloud compute instances create proxyserver --quiet | |
| echo "Waiting" | |
| sleep 45 | |
| echo "Connecting to the resource" | |
| echo "Press CTRL-C to exit and delete resource" | |
| gcloud compute ssh proxyserver -- -CND 6656 |
| import React, { useState } from "react"; | |
| import firebase from "firebase"; | |
| import "firebase/storage"; | |
| const firebaseConfig = {}; | |
| if (!firebase.apps.length) { | |
| firebase.initializeApp(firebaseConfig); | |
| } |
| # Create a directory | |
| mkdir ~/tmux-install | |
| cd ~/tmux-install | |
| # Get the files | |
| curl -OL https://www.openssl.org/source/openssl-1.0.2l.tar.gz | |
| curl -OL https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz | |
| curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
| # Extract them |
This command should be run on the local machine.
gcloud compute ssh [user@]machineName -- -NL LOCALPORT:localhost:REMOTEPORT