Brew Gcloud



Brew install pyenv pyenv install 3.9.1 pyenv global 3.9.1. Set an env variable letting the gcloud installer know which version of Python to use. Running gcloud/install.sh will add this to the correct rc file automatically. Biniama commented on Oct 16, 2019 Also see brew cask info that tell to source those files in the zshrc.

From https://console.cloud.google.com select your project and type create bucket into the search bar.

Give your bucket a unique name, choose a location which suits your needs and leave the other default values. Click then on Create.

You will get redirected to your new bucket. Under Overview, there is a field called Link to gsutil. That information will be later used to access your bucket from the command line.

Google's speech-to-text API works with .flac audio files. In my case, I had .mov and .ogg files. I used FFmpeg to convert my audio files to .flac.

I used homebrew to install ffmpeg:

This will take a while, so be patient.

Once ffmpeg is installed, you can convert your audio files to .flac via:

The output is quite verbose, so I skipped it here.

Transcribing Short Audio Files (<1 min)

Small audio files with content less than one minute can be transcribed without uploading them to a gcloud bucket. From within the same directory where your .flac file lies, run:

See https://cloud.google.com/speech/docs/languages for a list of the currently supported language codes.

In my case this was an audio file which I recorded myself with the Quicktime Player on my MBP. The transcription had only one mistake: 'wie gut diese ist Google ..' should have been 'wie gut dieses Google ..'. I also had a longer break before the last 'alternatives' sequence, so I guess that's why google split it up.

After converting the .mov file to .flac and running the gcloud ml command, I first got the following error:

I fixed this by converting the .flac from stereo to mono and using the newly resulting file:

For more information have a look at https://trac.ffmpeg.org/wiki/AudioChannelManipulation.

Long audio files will be transcribed via Asynchronous speech recognition. First, convert your audio file to .flac as described above (I had to convert my large file to mono again, as explained under Troubleshooting). In a next step, upload your file to the storage bucket created earlier:

Make sure to replace poehlmann with your bucket name. Once it is done, you can check your bucket in your browser:

You are now ready to transcribe the audio file by running

You can poll the operation until it completes by running

Or use describe instead of wait if you only want to request a status update without polling.

Make sure to replace the operation ID with yours.

Once the operation is done the above describe command will return the transcribed data as .json data like in the above example of short audio files.

My actual goal was to use Google's speech-to-text API for transcribing lectures which I recorded with my MBP. It turned out the quality of those audio files is not good enough for the API and resulted in garbage transcriptions, even though it is mostly easily understandable when listening to the audio as a human. My best guess is one needs audio files recorded with a microphone in order to achieve some nice results.

Transcribing an English audio message from a frend sent over Telegram gave ok-ish results. The message was a bit technical (about computer processors, RAM etc.) and some of the technical words were not understood by the API. However, since that friend of mine is not a native English speaker I'm not sure if the API is just a bit weak with technical words or rather with non-native speakers.

Getagged mit:
gcloud
Please enable JavaScript to view the comments powered by Disqus.blog comments powered by Disqus

Starting can be daunting. Before you take your first step, there’s a lot to consider, but you can prepare your development environment ahead of time to make your first steps in cloud engineering smooth and productive. In this article, we’ll cover how to set up your development environment to work across cloud providers, multiple languages, and different operating systems.

Building your toolbox

You might have heard of the French culinary term “mise-en-place,” which means laying out all the ingredients and cookware before starting to cook. That’s what we’re going to do here; layout all the accounts, authorizations, and software that you need to be a successful cloud engineer. We are going to need the following:

  • A package manager: Every operating system has a package manager for installing software. Unlike binary installers, a package manager lets you manage all software packages, including updates. Package managers can help resolve dependencies, saving you from frustration.
  • Cloud provider accounts: You can choose to set up one or multiple accounts. The important thing is how to configure credentials in your development environment,
  • Programming languages: You can choose one or many, but they all have different versions and dependencies.
  • Code editor: This is personal preference but make sure that it can perform code completion, error checking, and use enums. These features can be the difference between hitting Tab and searching through online documentation for a function.
  • Pulumi: You can install Pulumi with a package manager and configure

Decisions

Before proceeding, you need to answer three questions:

  • Which operating system to use for building cloud resources: macOS, Windows, or Linux?
  • Which cloud provider are you using? This guide covers AWS, Azure, and Google Cloud.
  • Which programming language will you use? Pulumi supports Node.js (JavaScript and Typescript), Python 3.6 or higher, Golang, and .NET (C#, F#, and VB).

Once you’ve made these choices, you can follow this guide in a choose-your-own-adventure style.

Package manager

Let’s start with the package manager. We’ll use it to install and manage all the software we need, including cloud provider CLIs, programming languages, editors, and Pulumi. Choose your operating system below.

Homebrew is the most popular package manager for macOS. The Command Line Tools (CLT) for XCode is required to install and build Homebrew. Install the XCode Tools first, then install Homebrew from the command line.

Brew Gcloud Recipe

If you are uncomfortable with downloading and running an online shell script (with good reason), Homebrew provides an alternate installation method.

Chocolatey is a popular package manager for Windows. It should be installed using an administrative shell.

Make sure that Get-ExecutionPolicy is not restricted.

If the command returns Restricted, we can use Bypass to install Chocolatey with the following command:

To check if it’s installed type:

Linux distributions include a package manager, apt for Debian based distributions or yum for Red Hat-based Linux systems. However, they are primarily used for application and system management.

Homebrew is a popular package manager for utilities, Software Development Kits, and programming tools. Install Homebrew from the command line.

To add Homebrew to your PATH and your bash shell profile script (~/.profile on Debian or ~/.bash_profile on Red Hat), follow the Next steps instructions to install and configure brew. To check if it’s installed, install a package;

Setting up a cloud account

The first task is signing up for an account. Once you have that out of the way, the next steps are installing the CLI and configuring your credentials.

macOS

We’ll use brew to install AWS CLI version 2 and verify if it’s installed by checking the version.

The next step is to create and download your AWS access keys and configure your environment to make them available to both the AWS CLI. To create your access keys, follow these directions for programmatic access.

Pulumi uses the AWS SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

To configure the AWS CLI with your credentials, use aws configure:

This creates a ~/.aws/credentials file used by the AWS CLI to authenticate requests.

Brew Gcloud

We’ll use brew to install Azure CLI and check if it’s installed.

The Azure client is authenticated and ready to use.

Pulumi uses the Azure SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

We’ll use brew to install the Google Cloud SDK and CLI.

Add the gcloud SDK to $PATH in you ~/.bash_profile

Open a new shell or source ~/.profile for Debian or ~/.bash_profile for Red Hat and check to see if it’s installed and pathed.

Authenticate using the gcloud CLI.

Pulumi uses the Google Cloud SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

Windows

We’ll use chocolatey to install AWS CLI version 2 and check if it’s installed. Open a cmd Command Prompt as Administrator:

The install adds the AWS CLI client to the $PATH, so either open a new cmd window or use the refreshenv command to update the window’s environment variables and use the AWS CLI.

The next step is to create and download your AWS access keys and configure your environment to make them available to both the AWS CLI. To create your access keys, follow these directions for programmatic access.

Pulumi uses the AWS SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

To configure the AWS CLI with your credentials, use aws configure:

This will create the ~/.aws/credentials file used by the AWS CLI to authenticate requests.

We’ll use chocolatey to install Azure CLI and check if it’s installed. Open a cmd Command Prompt as Administrator:

The Azure CLI client was added to the path, so either open a new cmd window or use the refreshenv command to update the window’s environment variables. To log into Azure, run the login command, which opens a browser to log into Azure.

The Azure client will open a browser window and prompt you to sign-in to your account. Once signed-in, the Azure CLI is authenticated and ready to use.

Pulumi uses the Azure SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

We’ll use chocolatey to install the Google Cloud SDK and CLI.

The gcloud CLI was added to the path, so either open a new cmd window or use the refreshenv command to update the window’s environment variables. Check to see if gcloud CLI is installed and pathed correctly.

Install Gcloud Cli

Authenticate using the gcloud CLI

A browser window will open to authenticate your client.

Pulumi uses the Google Cloud SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

Linux

We’ll use brew to install AWS CLI version 2 and check if it’s installed.

The next step is to create and download your AWS access keys and configure your environment to make them available to both the AWS CLI. To create your access keys, follow these directions for programmatic access.

Pulumi uses the AWS SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

To configure the AWS CLI with your credentials, use aws configure:

This will create the ~/.aws/credentials file used by the AWS CLI to authenticate requests.

We’ll use brew to install Azure CLI and check if it’s installed.

The Azure client is authenticated and ready to use.

Pulumi uses the Azure SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

We’ll use brew to install the Google Cloud SDK and CLI.

Add the gcloud SDK to $PATH to your ~/.bash_profile or ~/.profile.

Open a new shell or source ~/.profile for Debian or ~/.bash_profile for Red Hat and check to see if it’s installed and pathed.

People, animals. Authenticate using the gcloud CLI

Pulumi uses the Google Cloud SDK to authenticate requests. Your AWS access keys are never sent to pulumi.com.

Choose a Programming Language

Pulumi supports Node.js (JavaScript and Typescript), Python 3, Golang, and .NET Core (C#, VB, and F#) languages.

Node.js

Use brew to install Node.js for JavaScript and Typescript.

Use chocolatey to install Node.js for JavaScript and Typescript.

Use brew to install Node.js for JavaScript and Typescript.

Python

MacOS includes Python; however, versions shipped before December 2019 have Python 2.7 installed, which is deprecated. Pulumi requires Python 3.6 or higher. Use brew to install Python, which installs it at /usr/bin/local/python3.

In macOS versions with Python 2 installed, calling python uses the 2.7 binary. To ensure that you will always use Python 3, you can add an alias to your .bash_profile.

It is a best practice to create a virtual environment and activate it for a Python project. Pulumi creates a new venv environment when you start a new Project with pulumi new.

You can install Python in several ways, including typing ‘python` in the command prompt, which brings up the Microsoft Store application. In this article, we’ll continue using chocolatey to install Python 3.

It is a best practice to create a virtual environment and activate it for a Python project. Pulumi creates a new venv environment when you start a new Project with pulumi new.

Use brew to install Python3.

Use python3 to call Python, but you can add an alias to your .bash_profile or .profile to use just python to run scripts.

It is a best practice to create a virtual environment and activate it for a Python project. Pulumi creates a new venv environment when you start a new Project with pulumi new.

Install Gcp Sdk

Golang

Use brew to install golang.

It is a best practice to create a local programming environment and set GOPATH as an environment variable, although it is not required for golang versions after 1.8. Pulumi creates a new local environment and go.mod to work with modules each time you start a new Project with pulumi new.

Use chocolatey to install golang.

It is a best practice to create a local programming environment and set GOPATH as an environment variable, although it is not required for golang versions after 1.16. Pulumi creates a new local environment and go.mod to work with modules each time you start a new Project with pulumi new.

Use brew to install golang.

It is a best practice to create a local programming environment and set GOPATH as an environment variable, although it is not required for golang versions after 1.8. Pulumi creates a new local environment and go.mod to work with modules each time you start a new Project with pulumi new.

.NET

Install .NET with brew, Pulumi requires .NET Core 3.1 or higher.

Install .NET with chocolatey. Pulumi requires .NET Core 3.1 or higher.

Install .NET with brew, Pulumi requires .NET Core 3.1 or higher.

Get a code editor

While knowing how to use vim or similar text editors is a worthwhile skill, you should use a modern code editor. Here’s a non-exhaustive list why you should use a code editor.

  • Quickly navigating to a type
  • Autocompletion when you can’t remember the names of all members by heart
  • Automatic code generation
  • Refactoring
  • Organise imports
  • Warnings as you type.
  • Hovering over something to see the docs
  • Keeping a view of files, errors/warnings/console/unit-tests and source code on the screen
  • Running unit tests from the same window
  • Integrated debugging
  • Integrated source control
  • Navigating to where a compile-time error or run-time exception occurred directly from the error details.

You can use an IDE (Integrated Development Environment) such as Microsoft Visual Studio, Xcode, or any one of JetBrains' language-specific IDEs. Alternatively, you can use a lightweight solution with many of the features of an IDE. Popular code editors include Visual Studio Code, Sublime Text, and Atom.

You can install some editors with brew.

Install Pulumi

macOS Sierra (10.12) or later is required.

Install Gcloud Sdk

Homebrew

You can install Pulumi through the Homebrew package manager:

This will install the pulumi CLI to the usual place (often /usr/local/bin/pulumi) and add it to your path.

Subsequent updates can be installed in the usual way:

Installation Script

To install, run our installation script:

This will install the pulumi CLI to ~/.pulumi/bin and add it to your path. When it can’t automatically add pulumi to your path, you will be prompted to add it manually.See How to permanently set $PATH on Unix for guidance.

Windows 8 and 10 are supported.

Chocolatey

You can install Pulumi using elevated permissions through the Chocolatey package manager:

This will install the pulumi CLI to the usual place (often $($env:ChocolateyInstall)libpulumi) and generate the shims (usually $($env:ChocolateyInstall)bin) to add Pulumi your path.

Subsequent updates can be installed in the usual way:

Verifying your Installation

After installing Pulumi, verify everything is in working order by running the pulumi CLI:

Brew Install Gcloud Command Not Found

Next steps

Congratulations! You have a fully configured environment, and you’re ready to jump into cloud engineering. You can maintain your development environment using the package manager to add or update your toolset. Your code editor provides a modern development platform that takes advantage of all the advances in software engineering. Your coding experience will be more productive and less frustrating.

What are the next steps? Begin with Pulumi’s Getting Started. You can skip the configuration sections and jump straight into your first project. Once you’re done with your first project, try out example projects on Github. You can start with simple projects using the pulumi CLI, such as deploying a web server on AWS with python.

Brew Gcloud Free

This command will download the project from Github, create a virtual environment and activate it, and download all the python package dependencies. You’re ready to go and deploy with pulumi up. Want more? How about deploying Kubernetes on Azure with python?

Brew Gcloud

You can use the examples as a starting point for building your cloud infrastructure and add resources documented on Pulumi’s API reference and Guides.