cluster-linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cluster-linux [2024/05/26 11:11] – gabriele | cluster-linux [2024/05/26 11:17] (current) – gabriele | ||
---|---|---|---|
Line 7: | Line 7: | ||
- Common Commands | - Common Commands | ||
- Text editing in command line | - Text editing in command line | ||
+ | - Displaying images in command line | ||
+ | - Displaying images from command line (using X11 forwarding) | ||
+ | - Displaying NIFTI images in command line | ||
+ | - X11 Forwarding | ||
Line 143: | Line 147: | ||
For macOS, you could use [[https:// | For macOS, you could use [[https:// | ||
- | ssh gbellucci@psychp01.rhul.ac.uk | + | |
Now, suppose that you have a NIFTI image named '' | Now, suppose that you have a NIFTI image named '' | ||
- | niicat -lb / | + | |
The '' | The '' | ||
- | ===== 5. Displaying images from command line ===== | + | ===== 5. Displaying images from command line (using X11 forwarding) |
Another option to open an image saved on a remote server is to establish an X11 forwarding connection to the server and use an image viewer. For that, you need to: | Another option to open an image saved on a remote server is to establish an X11 forwarding connection to the server and use an image viewer. For that, you need to: | ||
- Ensure you have X11 installed on your local machine (XQuartz on macOS, typically installed X server on Linux). | - Ensure you have X11 installed on your local machine (XQuartz on macOS, typically installed X server on Linux). | ||
Line 159: | Line 163: | ||
For example, first make sure XQuartz is currently running on your machine. Before connecting to the remote server, you can start XQuartz on your local machine by typing the following in a terminal window: | For example, first make sure XQuartz is currently running on your machine. Before connecting to the remote server, you can start XQuartz on your local machine by typing the following in a terminal window: | ||
- | open -a XQuartz | + | |
You then would need to establish a X11 forwarding connection like that (see [[cluster-access|Cluster access]] for more information): | You then would need to establish a X11 forwarding connection like that (see [[cluster-access|Cluster access]] for more information): | ||
- | ssh -X username@remote_server | + | |
For example, suppose your username is '' | For example, suppose your username is '' | ||
- | ssh -X gbellucci@psychp01.rhul.ac.uk | + | |
You will be prompted to enter a password. Afterwards, suppose that you have a beautiful image named '' | You will be prompted to enter a password. Afterwards, suppose that you have a beautiful image named '' | ||
- | fim / | + | |
- | You can also open your image by using '' | + | You can also open your image by using '' |
- | eog / | + | |
- | ===== 5. Displaying NIFTI images in command line ===== | + | ===== 6. Displaying NIFTI images in command line ===== |
To quickly preview neuroimaging images in NIFTI format on the terminal, you can use '' | To quickly preview neuroimaging images in NIFTI format on the terminal, you can use '' | ||
For macOS, you could use [[https:// | For macOS, you could use [[https:// | ||
- | ssh gbellucci@psychp01.rhul.ac.uk | + | |
Now, suppose that you have a NIFTI image named '' | Now, suppose that you have a NIFTI image named '' | ||
- | niicat -lb / | + | |
The '' | The '' | ||
- | ===== 5. X11 Forwarding ===== | + | ===== 7. X11 Forwarding ===== |
X11 forwarding is a feature that allows you to run graphical applications installed on a remote server and display them on your local machine as if they were running locally. The “X11” part refers to the X Window System (version 11), which is a protocol and system for managing graphical displays on UNIX and UNIX-like operating systems. | X11 forwarding is a feature that allows you to run graphical applications installed on a remote server and display them on your local machine as if they were running locally. The “X11” part refers to the X Window System (version 11), which is a protocol and system for managing graphical displays on UNIX and UNIX-like operating systems. | ||
Line 209: | Line 213: | ||
macOS uses XQuartz, an implementation of the X server for macOS. You need to install and run XQuartz to use X11 forwarding. You can easily install XQuartz via the Terminal using [[https:// | macOS uses XQuartz, an implementation of the X server for macOS. You need to install and run XQuartz to use X11 forwarding. You can easily install XQuartz via the Terminal using [[https:// | ||
- | brew install --cask xquartz | + | |
=== Setup === | === Setup === | ||
Line 219: | Line 223: | ||
First make sure an X server is currently running on your machine. For instance, if you are working on macOS and use XQuartz, before connecting to the remote server, you can start XQuartz on your local machine by typing the following in a terminal window: | First make sure an X server is currently running on your machine. For instance, if you are working on macOS and use XQuartz, before connecting to the remote server, you can start XQuartz on your local machine by typing the following in a terminal window: | ||
- | open -a XQuartz | + | |
You then would need to establish a X11 forwarding connection like that (see [[cluster-access|Cluster access]] for more information): | You then would need to establish a X11 forwarding connection like that (see [[cluster-access|Cluster access]] for more information): | ||
- | ssh -X username@remote_server | + | |
For example, suppose your username is '' | For example, suppose your username is '' | ||
- | ssh -X gbellucci@psychp01.rhul.ac.uk | + | |
For trusted X11 forwarding, you can use the -Y option like that: | For trusted X11 forwarding, you can use the -Y option like that: | ||
- | ssh -Y gbellucci@psychp01.rhul.ac.uk | + | |
Both -X and -Y options allow you to run graphical applications from a remote server and display them on your local machine, but there are important differences in terms of security and functionality. The -X option or untrusted X11 Forwarding is the more secure option because it restricts the level of access that the remote application has to your local X server. Specifically, | Both -X and -Y options allow you to run graphical applications from a remote server and display them on your local machine, but there are important differences in terms of security and functionality. The -X option or untrusted X11 Forwarding is the more secure option because it restricts the level of access that the remote application has to your local X server. Specifically, |
cluster-linux.1716721904.txt.gz · Last modified: 2024/05/26 11:11 by gabriele