Linux servers ICT4TN021 – H6

In this post I’m reporting Tero Karvinen’s “Linux Palvelimet” assignment 6.[1] Report was started 02.10.2018 @ 12:54 and written from my desktop.

What am I working with?

  • Operating system: Xubuntu-18.04.1 64b[2] (Bootable USB)
  • CPU: Intel I5-6600k @ 3.5GHz
  • GPU: Geforce GTX 1070, 8Gb VRAM
  • RAM: 2x 8Gb DDR4 @ 2667MHz
  • MoBo: Asus Maximus VIII Ranger (boot menu F8)


I started by booting my computer using a bootable USB, plugged it in to an open USB slot and pressed F8 during startup. Once the boot menu had opened I selected the the USB-stick that I’m using (in this case Toshiba transmemory 32Gb) and pressed enter. This led me to xubuntu’s GRUB, where i chose “Xubuntu toram noprompt” -option that I had created earlier in the course.

Once my computer had loaded I tested it by opening the web browser, which seemed to work normally. After testing that web browser worked normally; I switched the timezone to Europe/Helsinki and had some display settings done. After getting all the personal preference settings done I switched my keyboard layout to scandinavian and updated the repository packages with:

setxkbmap fi
sudo apt-get update

The computer was now ready to be used and all it took was around 5 minutes in total. It was time to move to the given assignments.

Assignment A)

Write and run a “Hey world” script in three different languages (coding languages like python or php) and download the required working environments.[1]

Assignment started at 13:21.


I started by opening xubuntu terminal with ctrl + alt + del and creating a python file called I did all this by typing:


to create the python script I am using.

I wrote the following inside the script called

print("Hello world")


And i ran the script by giving the following command in terminal:


Which printed:


I also created a directory called scripts and moved the script there. By giving the following commands in terminal:

mkdir scripts
mv scripts/



I decided that the 2nd language I would use was going to be bash. I started with creating a .sh script by typing:


I wrote a simple Hello world script that the would have to run:

echo Hello world


I ran the script by typing:


to the terminal and it obviously printed “Hello world”



I decided to use Ruby as the last language, since I’m interested in learning it and have no prior knowledge of it.

(I only used Tero’s guide[3] for this ruby part, since I had some prior knowledge for the other scripts.)

I started by downloading ruby with the following command:

sudo apt-get -y install ruby

Then i followed Tero’s guide[3] and created a ruby file called hello.rb:

nano hello.rb

And wrote the following inside it:

print ("Hello World\n")


Then I ran the script with ruby by typing the following in to terminal:

ruby hello.rb

And it printed “Hello world” so it seemed to be working fine.


This assingment took around ~15 minutes of actual working time. This report itself took a bit longer since I had to run some personal errands in between. First assignment and its reporting was done @ clk. 15:15.

Assignment B)

(Optional) Write a simple (input-processing-output) program using the same languages.[1]


I started by creating a simple input/output script using python3. I only have a little experience using python and I’m going (or atleast trying) to create this script from memory/scratch.

I used the .py file that I had created earlier and edited it a bit:


And wrote the following inside it:

print("Hello world")

answer = input("What's 9+10")

I started by testing out the actual input part of the script, which I did by giving the following command:



The input worked correctly, but I didn’t use it.

This is the final script that I ended up making:

name = input("What's your name? ")

print("Well hello there, "+name)

answer = input("What's 9+10? ")

if answer == '19':

        print ("You smart boi, you very mathematician")


        print ("you stupid, learn to mathematics")

(The English that I used in the script is purposefully incorrect as this is a joke)

This is me running the script in terminal and testing that it actually works:


I was done with the script @ clk. 15:27


This is my first time writing an “input-output” script using bash. I used Ryan’s tutorial[4] to make this script and I thought that it would suffice since this is an optional assignment.

echo What are your top5 memes?

This prints “What are your top5 memes?” in to terminal for the user to read.

read mem1 mem2 mem3 mem4 mem5

Read allows user input for the script itself and “mem1 to mem5” are the references that the script is going to print out later.

echo Your top1 meme is: $mem1
echo Your top2 meme is: $mem2
echo Your top3 meme is: $mem3
echo Your top4 meme is: $mem4
echo Your top5 meme is: $mem5


Echo prints out “your top5 meme is:” and prints out what the user wrote earlier. Like so:


This part didn’t take so long, since the script itself was pretty self explanatory and didn’t require too complicated strings.


I used[5] to find this simple tutorial for ruby.

I wrote a super simple input output script using ruby, the script printed out “Hello dude” in terminal and required user’s input using “gets”. The script then called for gets at the end and printed out “Hello + (user input) + How are you?”

print ("Hello dude\n")

puts "Hwat are is yuo'r name? "
name = gets

puts "Hello " + name + "How are you?"

I ran the script by typing:

ruby name.rb


I have to admit that I used the most simple input/output scripts I could find, but since this was an optional assignment it didn’t really matter. I find that the most important part was for me to learn more than just the basic “Hello world”. But then again I didn’t dig that much deeper in to the language which probably was the idea of this assignment.

All in all I was done @ clk 01:35, since i took some breaks and met a few friends in between working with this report and various scripts.



[1] Assignment:

[2] Operating system:

[3] Tero’s guide:

[4] Bash simple script tutorial:

[5] Ruby tutorial:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s