Tag: Tutorial

  • Linux Tutorial Series – 167 – The traceroute command

    Here is the video version, if you prefer it:

    The traceroute command is used to see the route of a packet sent from your computer to the destination computer. (Shotts, 2019)⁠ Remember, packets are just small chunks of data sent over the computer network.

    An example of its usage:

    mislav@mislavovo-racunalo:~$ traceroute www.google.com

    traceroute to www.google.com (172.217.16.100), 30 hops max, 60 byte packets

    1 speedport.ip (192.168.1.1) 4.490 ms 5.863 ms 7.275 ms

    2 172.27.99.1 (172.27.99.1) 12.774 ms 15.713 ms 18.709 ms

    3 172.28.238.67 (172.28.238.67) 21.826 ms 25.468 ms 26.822 ms

    4 hdr11-gut21.ip.t-com.hr (195.29.224.145) 30.081 ms 33.572 ms hdr11-gut21-2.ip.t-com.hr (195.29.225.121) 35.273 ms

    5 gtr11-hdr11.ip.t-com.hr (195.29.3.46) 37.511 ms 40.042 ms 42.717 ms

    6 72.14.204.128 (72.14.204.128) 51.135 ms 13.224 ms 13.562 ms

    7 74.125.242.241 (74.125.242.241) 17.242 ms 74.125.242.225 (74.125.242.225) 19.994 ms 22.164 ms

    8 72.14.239.195 (72.14.239.195) 23.811 ms 27.805 ms 72.14.239.201 (72.14.239.201) 32.334 ms

    9 bud02s25-in-f4.1e100.net (172.217.16.100) 32.541 ms 33.624 ms 35.218 ms

    We can see all of the points that my packets visited until it finally reached www.google.com. If you were to see asterisks (*) instead of concrete information in any of the steps, that means that the router (the part of the networking hardware that routes the packets) is configured not to give away identifying information. Here this is not the case.

    Thank you for reading!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 227-228

  • Linux Tutorial Series – 166 – The ping command

    Here is the video version, if you prefer it:

    The ping command is used to check if your Internet connection is working properly.

    Here is its syntax: (Shotts, 2019)⁠

    ping internetAddress

    An example:

    mislav@mislavovo-racunalo:~$ ping www.google.com

    PING www.google.com (172.217.16.100) 56(84) bytes of data.

    64 bytes from bud02s25-in-f4.1e100.net (172.217.16.100): icmp_seq=1 ttl=55 time=14.2 ms

    64 bytes from bud02s25-in-f4.1e100.net (172.217.16.100): icmp_seq=2 ttl=55 time=16.9 ms

    ^C

    --- www.google.com ping statistics ---

    2 packets transmitted, 2 received, 0% packet loss, time 3ms

    rtt min/avg/max/mdev = 14.244/15.552/16.861/1.314 ms

    Focus on the 0% packet loss here. If it was 100% packet loss, then I would know something is wrong with my network.

    Thank you for reading!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 226-227

  • Linux Tutorial Series – 165 – The ip command

    Here is the video version, if you prefer it:

    The ip command is used to display information about network interfaces (among other things). (Shotts, 2019)⁠ Your network interface is the hardware within your computer which allows it to communicate via a computer network.

    Here is an example of the ip command:

    mislav@mislavovo-racunalo:~$ ip a

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

    valid_lft forever preferred_lft forever

    2: enp2s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

    link/ether 98:28:a6:1b:c0:18 brd ff:ff:ff:ff:ff:ff

    3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 42:00:d9:4a:1e:45 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp3s0

    valid_lft 81396sec preferred_lft 81396sec

    inet6 fe80::5ce3:3fee:50bf:4d6f/64 scope link noprefixroute

    valid_lft forever preferred_lft forever

    First note that I have 3 network interfaces – each start with numbers 1 to 3. Also note that, in their first line, they have the keyword state following the word UNKNOWN, UP or DOWN. UP means that the interface is currently enabled. If you want to know your IP address, look up the inet field of the interface (before the forward slash). My IP address is 192.168.1.3. This is my local IP address, not my global IP address. You can Google “how to find out my global IP address” if you ever need to find your global IP address.

    A side note: The ifconfig command was used for the purpose of finding out your local IP address before, but now it has been depracated. I couldn’t have used it on my Debian 10.

    Thank you for reading!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 228-229

  • Linux Tutorial Series – 164 – Computer networks – the very basics

    Here is the video version, if you prefer it:

    Today let’s talk about the very basics of computer networks.

    First of all, let me say that the field of computer networks is very vast. I had 2 college courses dealing with computer networks and I feel like we barely scratched the surface of the topic. So what I will do is try to introduce you to all of the concepts in computer networks we will need to understand the commands that will follow and no more. I will also be relatively broad in my descriptions and will not nitpick the details; again, just enough knowledge to cover the later commands. Computer networks could warrant a post series in it of itself and I would have to do it after extensively reviewing the subject matter.

    A computer network is consisted of layers. Each time you are sending some data over a network, your data has to pass through these layers in your computer, and, at the destination computer, it also has to pass through the same layers, but in reverse order.

    Each layer has a different function and addresses different concerns. There is a layer we are particularly interested in, called the network (or the internet) layer. On this layer, each device connected to a network has its own unique IP (Internet Protocol) address. This enables network devices to communicate with each other – they address each other using IP addresses. When sending data over a computer network, that data is most likely chunked into little pieces. Each one of these pieces traveling on the computer network is called a packet. Packets travel through the nodes of the computer network until they reach its destination. Packets are forwarded by routers, a piece of network hardware that routes packets to where they should go in order to reach their destination.

    There is a difference between IP addresses – there is your local IP address, which is what computers within your local network use and there is your global IP address, unique to you globally. Think of it like this – if someone in your house wants to talk to your computer via a computer network, it uses the local IP address. If, on the other hand, someone wants to talk to your computer outside of your house, they have to globally address you. The same way when a family member calls your name – you know they are calling you. However, if you are to receive a letter from the police station and someone uses your name, they will use your full name, or even some identification number unique to you, so you can be sure that they are addressing you.

    I think we have all it takes to look at some of the most basic network commands. Let’s take a look at them in the following posts.

    Thank you for reading!

  • Linux Tutorial Series – 163 – Time

    Here is the video version, if you prefer it:

    A quick word on time in Linux – incorrect time can cause web browser issues. (“How to troubleshoot time related errors on secure websites,” n.d.)⁠ Many distributions support using the NTP (Network Time Protocol) daemon to maintain the time using the remote server. (Ward, 2014)⁠ You can also mangle with timezones, but I never needed this. My advice: Don’t mangle with time unless you really need to (such as when you find the error above). I never had to.

    Thank you for reading!

    References

    How to troubleshoot time related errors on secure websites. (n.d.). Retrieved February 13, 2020, from https://support.mozilla.org/hr/kb/troubleshoot-time-errors-secure-websites

    Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 157-159

  • Linux Tutorial Series – 162 – cron and at

    Here is the video version, if you prefer it:

    Today let’s talk about scheduling tasks (to run periodically). cron is used for this, as well as at. at is for one time jobs, while cron is for jobs that should re-occur in the future consistently. I never used any of these, as I never needed to schedule something. This is just for you to know where to look if you ever need to schedule something.

    There are efforts underway to replace cron with parts of init which are responsible for scheduling tasks, so look into that as well when pondering scheduling tasks. (Ward, 2014)⁠

    Thank you for reading!

    References

    Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 159-161

  • Linux Tutorial Series – 161.1 – A note on configuration files

    I wanted to make a quick note to say that whenever you encounter an issue or want to configure something, use Google to find what file in particular you are editing. I mentioned some files I deem are sort of foundational to know (such as /etc/passwd), but I think that in 2020. it is reasonable to assume that you have access to the World Wide Web and that you can use Google to answer queries such as “How can I modify systemd startup services” or similar.

    In the language of optimization, no need to over-optimize for the goal of knowing about Linux. Know just enough to be confident that you have the major pieces of the puzzle and know how they work, but if a particular detail pops up use Google to solve it.

    Talk soon!

  • Linux Tutorial Series – 161 – Printing – how I do it

    Here is the video version, if you prefer it:

    There is an entire chapter in (Shotts, 2019)⁠ dedicated to printing, but let me tell you how I print the things I want to print. I just use the GUI of the app that I am viewing the file in. I advise you to do the same. Now, could there potentially be a situation where you are accessing a Linux machine remotely and you need to print something out and you can’t use a GUI? Sure. But, I’ve never encountered it so far and I think that using Google in that particular situation would help you.

    Hope you learned something useful!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 361-373

  • Linux Tutorial Series – 160 – Checkpoint

    Here is the video version, if you prefer it:

    In the upcoming posts, we will talk about a whole bunch of things – printing, scheduling tasks, computer networking and building a program from source.

    We won’t cover any of those (except building a program from source) in much detail. The reason is because I either haven’t used it as much and thus feel that the topic is not as relevant to everyday use or the topic is very broad and I narrowed it down to the very basics.

    An interesting mix coming up. Focus on the computer networking chapter most, followed by building a program from source. Feel free to quickly read the other things.

    Talk soon!

  • Linux Tutorial Series – 158 – Shutting down your system via the command line

    Here is the video version, if you prefer it:

    If you ever want to shut your system down via the command line, here is how it is done: (Ward, 2014)⁠

    shutdown -h now

    If you want to restart your machine, execute this:

    shutdown -r now

    In order to delay the shutdown or the restart, write this (this is the shutdown case):

    shutdown -h +numberofMinutes

    I usually shut down my computer via the GUI, but there may be some situations where you might have to shut down the computer via the command line (such as when accessing a computer remotely, for example).

    Hope you learned something new!

    References

    Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 144-145