How to connect to iSCSI disk on Manjaro Linux 17.0

I am currently working and testing my new iSCSI target server built on my FreeNAS 10 machine. I wrote a similar tutorial to connect to remote iSCSI disk/portal from my Fedora 26 server. Now I want to try to adopt it on my Manjaro. But mostly here done with command line. So, if you want to follow this tutorial, make sure you have an access to the remote iSCSI Target server.
My System configuration:
  • Remote iSCSI target server (FreeNAS 10 Corral) IP address: 10.34.0.211
  • iSCSI initiator client : Manjaro 17.0 Linux

Steps to connect to iSCSI target on Manjaro 17.0

Step 1. Install open-iscsi package

First of all, we need to install open-iscsi package on Manjaro. This package is not installed by default, so we need to install it first.
sudo pacman -S open-iscsi
sudo systemctl start open-iscsi

Step 2. Configure iscsid.conf

Now, we need to configure the file /etc/iscis/iscsid.conf. At this point, we will enter the iscsi target server details.
sudo nano /etc/iscsi/iscsid.conf
Now uncomment the following lines:
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password
Make sure you change the username and password with the iSCSI target server user name and password.

Step 3. Target discovery

Execute this command to start discover the iSCSI Target
sudo iscsiadm -m discovery -t sendtargets -p 10.34.0.211
You will see the list of any iqn list on the target server
manjaro iscsi iqn discovery

Step 4. Confirm status of discovery

Now use this command to confirm the status of the Target server discovery
sudo iscsiadm -m node -o show
Output:
manjaro iscsi iqn discovery 2

Step 5. Login to the target

sudo iscsiadm -m node --login
Example:
login to iscsi target server
At this point we are connected to our remote iSCSI Target server and the iscsi disk is mounted locally. Check if it listed using fdisk command.
fdisk -l
You should see new disk is listed there like mine below.
list iscsi disk
OK so, we are successfully connected to the remote iSCSI disk on Manjaro. This tutorial also applicable to other Arch based Linux such as Antergos as well.

Install Atom 1.15 on Manjaro 17.0

Atom is an all in one text editor for most Linux users. It comes with a nice GUI, expandable features and many other interesting features. The new Atom 1.15 is available and here I want to show you how to install Atom on Manjaro 17.0.

atom 1.15 on manjaro

What's new on Atom 1.15

  • Duplicate selections with multiple lines
  • Cursors are always visible by default
  • Fix for hangs on opening minified files

Steps to install Atom 1.15 on Manjaro 17.0

If you like to install it via Terminal, simply use the following command

yaourt -S atom

Make sure you have enabled AUR repository on Manjaro Linux. You can read how to enable AUR on Manjaro if you haven't done yet.

Alternatively, you can also install Atom via Pamac Software Manager

install atom on manjaro

Once completed, you can start using Atom on Manjaro. Please kindly share this article so other users can use it.

Learn Python code in Manjaro Linux

Python is a great programming language used by many developers around the world. Python runs on Linux and other Operating System as well. I just started to learn this Python language on my Manjaro. If you are new to Python, there are many websites that offers great free tutorial to learn Python. You may check the following websites for Python tutorials:

Before we can use Python, we need to install it first. On Manjaro, usually it comes with Python already. But in case you need to install Python on Manjaro, you can use this command below.

sudo pacman -S python

First Python Program

Lets create our first python program. Use your favorite text editor such as nano, vi, or Atom. But here, I use nano to create my first hello world python program.

nano hello.py

Now enter the following text

#!/usr/bin/python
print ("Hello World")

Close and save the file.

python hello world manjaro

Make it executable

Now we need to make the new file (hello.py) executable.

chmod +x hello.py

Run the program

To run the program, simply use the following command:

python hello.py

python hello world manjaro

Thank you

How to display current date using Shell Script

Shell Script Tutorial for Beginner - Hello everyone, today I will continue to give a short example about shell script and hopefully will be useful for anyone who wants to start learning Shell Script. Today, I am going to show you how to display current date via Shell Script.

First, create an empty file called exercise01.sh. To do it, open Terminal and type the following command

nano exercise01.sh

It will create a new file under current directory.

Now write down the following code

clear
echo "Hello $USER"
echo "Today is \c ";date
exit 0

Now close the file using CTRL + X and make it executable

chmod +x exercise01.sh

Now Run it

sh exercise01.sh

Example:

display date script

Please note that the "\c" on the script will show the date as the same line with text "Today is". Without the "\c", the date will be displayed under the "Today is" line.

How to Make Shell Script Executable using command line

How to Make Shell Script Executable using command line

Hello everyone, today I am going to demonstrate some shell script tips and tricks. On my previous post, I have shown a simple shell script "Hello World" that can be read here. After we create a script, we need to make the script executable before we can actually run it.

For example, we already have a .sh file called hello.sh which contains some line of codes. We need to make the hello.sh file executable. Use the following command to make the hello.sh executable.

sudo chmod +x hello.sh

Now we can run the script with this command

sh hello.sh

or

./hello.sh

Its pretty simple but for a beginner, you must know it.