ASD Mac OS

broken image


For much more information about SSHFS, please read the ASD SSHFS guide. (This is a Mac OS X-oriented document but the command structure is the same for Linux.) Some common port numbers you might find useful. Port Description; foo22: standard SSH port (also covers scp and sftp) 80. Apple Diagnostics, formerly known as Apple Hardware Test, can check your Mac for hardware issues. If you think your Mac might have a hardware issue, you can use Apple Diagnostics to help determine which hardware component might be at fault. Apple Diagnostics also suggests solutions and helps you contact Apple Support for assistance.

  1. Asd Mac Os Catalina
  2. Asd Mac Os Update

I am setting up my new laptop (a MacBook Pro wind macOS High Sierra 10.13.4) and one of the tools I need for my day-to-day work is a Ruby installed. macOS High Sierra comes with ruby version 2.3.3. But, as I am writing this post, the latest ruby version is 2.5.1 which was released on March 28, 2018.

  • Apple Service Diagnostic (ASD) is Apple's bootable hardware testing console that lets you run extensive technical test routines on your Mac. Alternatively, Apple Hardware Test (AHT) is a simpler version of ASD that is already on most Mac OS X restore DVD's that shipped with your Mac.
  • Note: ASD is tested with a custom Mac OS that is supplied in the image. As a test requirement the OS is set up as a root user. DO NOT copy ASD to another OS or some tests will fail. Also running ASD on another OS removes some of the Finder menu items and sets preferences specifically for ASD requirements. It will damage your OS so use the one.

I could use homebrew to install the latest version of ruby with one single command. The problem is, sometimes I work with projects using old Ruby versions and sometimes I like to give a try to beta/alpha versions in order to be aware of what is coming. That said, I need a way to install two or more different versions of Ruby and the same happens with other tools or languages.

On my previous setup (macOS and Ubuntu) I was using RVM and then I pass to rbenv. Both allows you as a developer to install and switch multiple Ruby development environments. As with rbenv or RVM for Ruby, you have NVM for Node.js, virtualenv for Python, etc.

But today, for the new machine, I decided to switch to ASDF. ASDF is an extendable version manager that allows developers to install multiple Ruby versions. Moreover, with ASDF you can install and manage almost all languages you might want, even databases like Postgres, MongoDB or Redis. You can install and manage different versions of Ruby, Node.js, Elixir, dotnet-core, Python, and so on. The complete list of supported languages can be found here: https://github.com/asdf-vm/asdf-plugins.

On this post, I will show you how to install asdf and use it to install different versions of Ruby, Elixir and other tools I've been using.

First, we need to install the base development tools using homebrew (a macOS package manager like apt-get for Ubuntu):

$ brew install coreutils openssl libyaml libffi automake autoconf readline libxslt wxmac gpg

In fact, you don't need to install all packages above. For example, I am installing 'wxmac' because I will need it as a dependency for Erlang, which on the other hand, is also a dependency for Elixir since Elixir runs on top of Erlang's virtual machine.

Now we can install ASDF itself. Remember, you need to have git installed. macOS 10.13.x already comes with git 2.14 installed. If you want to install the latest version, you can use brew (homebrew) for that:

$ brew install git

The command above will install the latest version of git and set it as the default one. Run on terminal 'git –version' to confirm. If still getting the old version, restart your session (Terminal).

$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf –branch v0.4.3

When you specify the branch, you are specifying the version to install. In this case, we are installing the latest version (0.4.3). You can check others and new versions here: https://github.com/asdf-vm/asdf/releases .

Now we need to add environment configuration for PATH and auto-completion. Depending on your OS and SHELL, the file to edit can differ. In my case, I am using macOS and oh-my-zsh framework, so I need to edit '~/.zshrc' file. On Terminal (ITerm2, my case), you can run:

$ echo -e ‘n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e ‘n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc

And that's all! We are ready to start using asdf.

Installing Ruby using asdf

Now that we have asdf installed and ready for use, we can start installing our tools. The first one I choose is Ruby. To install Ruby I need a plugin for it. Plugins are how asdf understands how to handle different packages. We can find a list of all supported plugins here: https://github.com/asdf-vm/asdf-plugins and we can create our own plugins using these guidelines: https://github.com/asdf-vm/asdf/blob/master/docs/creating-plugins.md

Let's check the installed plugins running the following command:

$ asdf plugin-list

This command should give us a list of installed plugins. But at this point, it will return a warning saying 'Oohe nooes ~! No plugins installed'. The message is clear, we did not install any plugin yet. So, let's install our first plugin. The Ruby plugin:

$ asdf plugin-add ruby

Now it's time to install one or more Ruby versions. But first, let's see what versions are available:

$ asdf list-all ruby

As you can see, a list of all available versions was returned, even the latest preview (2.6.0-preview1). I want to install the version 2.5.1, the latest stable one, so I run:

$ asdf install ruby 2.5.1

It will download and compile the version 2.5.1 of Ruby. It can take some time. When finished, I can start using my new Ruby. We can check if ruby was installed successfully by checking the version. If it still giving you the old (system) version, try to restart your session (Terminal):

$ ruby -v

Should return something like:

=> ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

The necklace of blood part ii mac os. At this point I am ready to start using Ruby, installing gems with commands like: 'gem install rails' and so on.

We need to set a specific version as the global (default) version running the following command (it will create or change a file ~/.tool-versions):

$ asdf global ruby 2.5.1

And if I want to use a different version for a specific project, I need to go to that project root folder and run (it will create or update a file PROJECT_FOLDER/.tool-versions):

$ asdf local ruby 2.5.1

Asd Mac Os Catalina

The format of the content of .tool-versions file is always: [PLUGIN NAME] [VERSION]. For example, for Ruby, it will be: 'ruby 2.5.1'.

Installing Other tools/languages

Adding plugins

Now it's time to install other languages. As we did previously, we need first to add the corresponding plugin. To not be repetitive, we will add all plugins we need now. In my case, I need plugins for Ruby (already added), dotnet-core, java, kotlin, erlang, elixir, nodejs and python. Your needs can be different from mine.

$ asdf plugin-add dotnet-core
$ asdf plugin-add java
$ asdf plugin-add erlang
$ asdf plugin-add elixir
$ asdf plugin-add kotlin
$ asdf plugin-add nodejs
$ asdf plugin-add php
$ asdf plugin-add python

Note that nodejs on macOS require 'coreutils' and 'gpg'. And we needed to import the Node.js release team's OpenPGP keys to the main keyring, running following command:

$ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

Installing a tool version.

To install a version of a tool like Elixir, we need first to confirm the available versions. Note that for all languages the process is the same, all we need to do is change the plugin name. Some lists can be long and can take time to show up.

$ asdf list-all elixir

The same we can do with other languages as I said. All we have to do is change the plugin name.

Now I will install all versions of different tools I need:

$ asdf install java 10
$ asdf install nodejs 9.10.1
$ asdf install erlang 20.3.2
$ asdf install elixir 1.6.4
$ asdf install python 3.6.5
$ asdf install dotnet-core 2.1.103
$ asdf install kotlin 1.2.31

After install each language, you need to set a global version. To do it, run (for Elixir for example):

$ asdf global elixir 1.6.4

macOS comes with python 2.7.10 even after set the global version it stil using the old (system) version. The same can happen with other languages/tools. To fix you need to restyart your session (close and open your Terminal).

Kotlin (asdf-kotlin) requires Java 6+ to be installed. And as Elixir depends on Erlang, Erlang needs to be installed first.

Managing plugins and versions

We saw how to add plugins and install versions. There are others commands we can use on asdf to perform some tasks.

To list all installed plugins we run:

$ asdf plugin-list

And to remove a plugin we run:

$ asdf plugin-remove

Example:

$ asdf plugin-remove nodejs

We can update the plugins one by one or all of them at the same time. To update all installed plugins we pass a '–all' flag; and to update a single plugin we pass the name of the plugin.

$ asdf plugin-update –all
$ asdf plugin-update elixir

If we want to see the current versions of all installed plugins, we run:

$ asdf current

and we can restrict to one plugin. Let's say, we want to see the current version for Ruby:

$ asdf current ruby

We can unistall a version using the following command:

$ asdf uninstall

Note that we need to specify the name of plugin and the version we want to uninstall. Example:

$ asdf uninstall ruby 2.4.1

We can set the current version locally or globally as we saw when we installed Ruby above:

$ asdf global
$ asdf local

Example:

$ asdf global elixir 1.6.4

That's it! We did it.

Note that this is my first post written in English (more coming). So it's easy to make mistakes. If you find an error, something I said wrong, please let me know and sorry for that.

Now join me for the PIZZA o/

If you wish to be able to view web pages that are not normally visibleoutside ASD, you can still do this using the 'port forwarding'capability of Secure Shell (SSH), also known as SSH tunneling.

Complete details are available from the 'ssh' manual page but here is aquick method of doing this from a UNIX/Linux/Mac OS X machine.

Asd Mac Os Update

In order to be able to do this from offsite, you will need an RSASecurID token or PIV badge and an account on the Code 600 gs600-bastion1 (or -bastion2) servers.

ASD

What you will do is to specify that some port (which you choose) on yourlocal machine will map into a specific port on a specific remote machine(machine 'A') and that this forwarding will take place via some other machine ('B', probably gs600-bastion1 or gs600-bastion2) to which you can log in.

That is, you will need to set up the mapping of localhost:localport toremotehost:remoteport on the ssh command line. Since the localhost partis assumed (by ssh), it is dropped, and one simply has to specify the remainingthree parts. You already know the last two of them and get to make up the firstone (localport) !

Thus, the syntax is:or, if your username is the same on both computers, you can do simply:

The tunnel you create isn't useful until you reference it. Howyou reference it depends on the protocol and what you are trying to do.Let's look at some examples.

Example 1: web tunnel

Setup (example 1)

In a shell window (xterm or Terminal, etc), type:where

  • 4567 is some made-up number for local access (Choose at least a 4-digit number, greater than 1024)
  • 'astrophysics' is a web server you wish to access.
  • 80 is the standard port for a web server (HTTP).
  • 'gs600-bastion1' is a machine to which you can log in via ssh.

If you have a different username on the remote machine, you will need to specifythat, e.g.,

Usage (example 1)

Asd microsoft tool

What you will do is to specify that some port (which you choose) on yourlocal machine will map into a specific port on a specific remote machine(machine 'A') and that this forwarding will take place via some other machine ('B', probably gs600-bastion1 or gs600-bastion2) to which you can log in.

That is, you will need to set up the mapping of localhost:localport toremotehost:remoteport on the ssh command line. Since the localhost partis assumed (by ssh), it is dropped, and one simply has to specify the remainingthree parts. You already know the last two of them and get to make up the firstone (localport) !

Thus, the syntax is:or, if your username is the same on both computers, you can do simply:

The tunnel you create isn't useful until you reference it. Howyou reference it depends on the protocol and what you are trying to do.Let's look at some examples.

Example 1: web tunnel

Setup (example 1)

In a shell window (xterm or Terminal, etc), type:where

  • 4567 is some made-up number for local access (Choose at least a 4-digit number, greater than 1024)
  • 'astrophysics' is a web server you wish to access.
  • 80 is the standard port for a web server (HTTP).
  • 'gs600-bastion1' is a machine to which you can log in via ssh.

If you have a different username on the remote machine, you will need to specifythat, e.g.,

Usage (example 1)

Then, in a browser on your local computer, type in the URL window:ore.g.,http://localhost:4567/asd_photos

You literally type the word 'localhost'; that's not areference to something else.

For some strange reason, sometimes one has to type this URL two times.(I have seen it fail the first time.)

Example 2: SSH tunnel

Setup (example 2)

In a shell window (xterm or Terminal, etc), type:

Usage (example 2)

  • To use Secure Copy, the syntax is as follows, as typed on your local computer:
    scp -P @localhost:/remote/path/to/file /local/path/to/file
    A specific example might be:
    Copy the file mystuff.txt from my home directory on asdwebdev to the current directory on my local computer:
    scp -P 3333 marida@localhost:~/mystuff.txt .
  • To set up a Secure FTP session, the syntax is:
    sftp -oPort= @localhost
    or one can specify a directory to start in:
    sftp -oPort= @localhost:/remote/path/to/dir
    A specific example might be:
    sftp -oPort=3333 dfriedla@localhost
  • To set up an SSHFS session, the syntax is:
    sshfs -p @localhost:/remote/path/to/dir /local/path/to/mount/point
    A specific example might be:
    sshfs -p 3333 dfriedla@localhost:/software /tmp/software
    For much more information about SSHFS, please read the ASD SSHFS guide. (This is a Mac OS X-oriented document but the command structure is the same for Linux.)

Some common port numbers you might find useful

PortDescription
foo22standard SSH port (also covers scp and sftp)
80standard HTTP (web) port
443standard encrypted HTTP (web) port

Multiple entries

It is also possible to stack up multiple tunnels on a single ssh commandline, simply by using multiple '-L localport:remotehost:remoteport'entries (space separated, of course).

Example: multiple entries

Here is a complicated example used by Mike Arida, setting up tunnels ofdifferent types to different machines:

Can you do this on MS Windows?

It is also possible to do this with the freeware Windows PuTTY SSH client (available here).You will have to do the same thing of defining local & remote ports andthe remote host. The PuTTY web site has its own documentation onport forwarding and theTunnels panel.

David Friedlander
4 April 2005, updated & expanded 17 March 2011 (D. Friedlander/M. Arida)
22 Feb 2019 (minor updates)



broken image