[Unit]
Description={description}
[Service]
ExecStart=/home/{user}/.nvm/nvm-exec npm start
Restart=always
User=nobody
Group=nogroup
Environment=NODE_VERSION={node-version}
# Show free and used disk space | |
# -a: Include all non-standard file systems | |
# -h: Human readable sizes | |
df -ah | |
# Show disk usage of a file or directory (recursive) | |
# -h: Human readable sizes | |
# -s: Summarize results | |
du -hs /path/to/directory |
WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".
Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:
#Requires -Version 7 | |
$configuration = "Release" | |
$output_directory_name = "publish" | |
$target_projects = "Project1","Project2","Project3" | |
$dotnet_version_directory = "netcoreapp3.1" | |
# Publish a clean build for every project in the solution | |
dotnet clean --configuration "$configuration" | |
If ($LastExitCode -ne 0) |
Connecting to a Google Cloud VM Behind IAP From a Windows Machine Using a *nix/WSL Development Machine
Establishing an SSH connection transparently is useful for connecting to a Google Cloud VM using the ms-vscode-remote.remote-ssh
(Remote - SSH) extension in VSCode, for example, allowing us to avoid manual port-forwarding or setting up a dedicated tunnel.
- An SSH agent must be running on the on the client machine. On Windows, enable and start the OpenSSH Authentication Agent service.
#!/bin/sh | |
set -e | |
if test -z "$GOOGLE_CLOUD_STORAGE_BUCKET_URI"; then >&2 echo "GOOGLE_CLOUD_STORAGE_BUCKET_URI not specified, exiting"; exit 1; fi | |
# In some environments, such as a local development container, it might be necessary to provide the Application Default | |
# Credentials via the GOOGLE_APPLICATION_CREDENTIALS environment variable. | |
# The gcloud CLI won't authorize requests using the GOOGLE_APPLICATION_CREDENTIALS environment variable, however it can | |
# use them to generate an access token. The access token can authorize the gcloud CLI through the |
echo "Removing images from daemon..." | |
docker image ls | grep "$IMAGE_NAME" | awk '{print $1":"$2}' | xargs -I {} docker image rm {} | |
echo "Removed images from daemon." | |
echo "Pruning images from daemon..." | |
docker image prune --force | |
echo "Pruned images from daemon." | |
echo "Removing images from registry..." | |
if curl --silent "$DOCKER_REGISTRY_BASE_URL/v2/_catalog" | jq --raw-output '.repositories[]' | grep -q "$IMAGE_NAME"; then |
import { uuidv7, UUID } from "uuidv7"; | |
const uuid = uuidv7(); | |
const timestampBytes = new Uint8Array(8); | |
timestampBytes.set(new Uint8Array(UUID.parse(uuid).bytes.buffer.slice(0, 6)), 2); | |
const timestampMs = new DataView(timestampBytes.buffer).getBigUint64(); | |
console.log(new Date(Number(timestampMs))); |