Author: Matej

  • Traxxas TRX-4 Sport Kit Build with upgrades

    Traxxas TRX-4 Sport Kit Build with upgrades

    The adventure begins

    As you may know, I am into the RC hobby. I already own one crawler – the TRX-4 Bronco. It is a nice truck, but I wanted something new and something that I can use in competitions in the future. So, I bought myself a Traxxas TRX-4 Sport kit.

    What’s in the box?

    A mystery box

    If you read the title and the intro, then you already know what’s in the box. Or do you?

    Traxxas TRX Sport Kit box and parts

    Well, it appears to be way more than just the Traxxas TRX-4 Sport kit.

    Let’s go over the content of the box here.

    The Traxxas TRX-4 Sport Kit

    Traxxas TRX Sport Kit box

    Obviously, the kit itself. This is a great platform that everyone likes and that performs like a champ. A good start for an awesome build.

    I bought it in Europe from here.

    Wheels

    Although great, I will not use stock wheels that come with the kit.

    Tires and foam

    Proline Hyrax Predator tires and foam

    I went with the Hyrax Predators by Proline with their stock foam for now. If, however, they don’t perform good enough I might swap out the stock single-staged foam for a dual-staged one.

    I bought this from eBay.

    Rims

    Blue alloy rims

    These are some cheap-ish alloy rims from AliExpress. I like them because of the blue rings. However, the amount of screws scares me…

    Bought from AliExpress.

    Electronics

    Radio system

    FlySky GT5 and FS-BS6

    The transmitter is the FlySky GT5 with its BS-6 receiver. A very good radio system.

    I am not sure where I bought the transmitter from, but the transmitter + receiver combo can be found at HobbyKing.

    ESC

    HobbyWing Quicrun 1080

    Brushed system. Hobbywing Quicrun 1080 is a best-buy ESC that performs really well and it is really customizable. I will use it along with the XT-60 power connector.

    Bought from AliExpress.

    Motor

    Brushed motors 540 and 550

    Two cheap motors. On the left side is the 540 55T motor. On the right side is the 550 35T motor. I think I will go with the 550 can for now.

    Motors are bought from HobbyKing and AliExpress.

    Servo

    Servo

    This is the servo that I like the most. It is around $20, it is fast enough for a crawler, has 25 kg of torque, metal gears, dual ball bearings, comes with a metal horn and it is waterproof. Just perfect.

    Bought from AliExpress.

    Battery

    Battery and connectors

    This is a very big battery that barely fits in the TRX-4 battery tray. 3S, 5000 mAh, 65-130 C. It will be used for long light trails, but for some serious crawling and better performance I will swap this for something smaller (up to 2200 mAh). This battery comes with an XT-90 connector, so these connectors are used to convert it to XT-60. Also, one connector has a JST lead that is perfect for the BEC used with a light kit. And lastly, I have that switch that is typically developed for TRX-4 stock XL-5 ESC. I will see if I will put it to use.

    I bought all this from different places:

    Shocks

    GPM shocks with internal spring

    GPM Racing shocks with internal spring. I have never used or seen one of these. I wonder how well will they perform.

    I bought them here.

    Axon shock oil

    Shock oil. One bottle of 15 wt, one bottle of 20 wt and one bottle of 25 wt. I think I will put 15 wt in the front shocks and 20 wt in the rear.

    I bought them off of eBay:

    Lights

    Traxxas TRX-4 Sport Kit light bars with power supply and some cheap LED systems

    I love the lights. On the left side, there is a light kit with a controller. This will go in the light buckets in the body. Then there is a Traxxas BEC, Traxxas roof light bar, Traxxas front bumper light bar, a remote switch for my Channel #3 on my receiver and some cheap red and white LED lights just in case. I want to be able to drive in lower light conditions. However, I still did not order the rock lights for the fenders. I don’t see the need for them at the moment.

    These are bought from different places:

    Other upgrades and parts

    Screws and pins (body clips)

    Here are some body pins and stainless steel screws.

    Both from AliExpress – screws, and pins.

    Metal motor mount for Traxxas TRX-4 Sport kit

    Metal motor mount. It should take away some heat from the motor.

    Bought here.

    Protectors for diffs

    Some protection for diff pumpkins and other parts in the lower section of the truck.

    Bought here.

    Narrow fenders with front battery mount for Traxxas TRX-4 sport Kit

    Traxxas narrow fenders and front battery tray. This gives the truck a better look and prevents mud from getting all over the truck.

    Bought here.

    Loctite thread locker

    Some thread locker for screws that go into metal parts. I bought this at my local car parts shop.

    Paint

    Paint spray cans, tape and paint remover

    I have some Abisma paint spray cans, and some Tamiya cans. Both for Lexan bodies. Also, some tape is necessary for covering up the details on the body during the paintwork.

    I bought this in different places:

    Why this kit?

    It is proven to be a great kit and a great truck. I really wanted to give it a go. Also, my plan is to build something that looks scale but performs well. My TRX-4 Bronco with its heavy body is not really a competition truck, but I might build one off of this kit.

    Stay tuned to see how the build turned out.

  • How to download Minecraft Java Edition via TLauncher

    How to download Minecraft Java Edition via TLauncher

    Disclaimer

    I am just posting the links I found on the internet. I am not sure how come that TLauncher provides Minecraft for free, but it does and it works.

    If you think this is not legal, or I should not use it, please contact me via form, or send me an email to gaming@bymatej.com.

    I am in no way affiliated with TLauncher and/or Mojang/Minecraft.

    Thanks!

    Register at TLauncher website

    Go to TLauncher website: https://tlauncher.org/en/

    Use the Sign-Up link to create an account. After you create your account, please remember the username you used in the registration form. Your server admin might need it to whitelist you on their server.

    Download and install TLauncher

    As a prerequisite, ensure you have installed Java on your computer.

    Click on the Download TL button on the TLauncher website. Download the software for your OS.

    Windows version comes as an exe installer, while the Mac OS and Linux versions come as zip files. If you are a Windows user just double-click on the installer, follow the instructions and install. If you use Mac or Linux, just extract the zip file.

    Run TLauncher

    Open TLauncher.

    Select the latest Minecraft version from the dropdown. I used 1.14.4. Click the Install button and the TLauncher will download your Minecraft game.

    Check the Accounts checkbox and add your account you created in the first step.

    After the game is installed, and the account is added, you will have the Enter the game button ready and it should look like this:

    If you get stuck or need help, please refer to this help article from TLauncher.

    Playing the game

    You can play in Singleplayer or in Multiplayer.

    If you play in Singleplayer mode, you can create your own world and you can have fun either in Creative mode or in Survival mode.

    You can play with your friends either in LAN (your local network), or Online (if you have a set up a server).

    Crafting guide

    Please, check this crafting guide: https://www.minecraftcraftingguide.net/

    Resources

  • How to display the Git branch name in Linux and OSX terminal

    How to display the Git branch name in Linux and OSX terminal

    Wait… am I on the right branch?

    If you execute Git commands in your terminal, you might have noticed that on most Operating Systems it does not tell you which branch you are on. Although that is not a big issue, as you can retrieve the name of the branch you are currently on, it would be much more convenient if the branch name stays there all the time.

    How to do it?

    Check this Gist of mine.

    Basically, all you have to do is paste this at the end of your .bash_profile or your .bashrc file. Depending on your system, this file should already exist in your home directory. If it does not, simply create it.

    This is what you need to paste

    # You might want to add this to your .bash_profile and/or .bashrc file in your home directory 
    parse_git_branch() {
         git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
    }
    
    export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\\[\033[0;95m\]\$(parse_git_branch)\[\033[0m\]$ "
    export CLICOLOR=1
    export LSCOLORS=ExFxBxDxCxegedabagacad
    alias ls='ls -GFh'

    This works both on your Linux, as well as on Mac OSX. I tested it on my Ubuntu and my OSX 10.15 Catalina.

    After you paste the above code, and after you save the file, close your terminal window or tab, and open a new one for changes to take effect. Or reboot your machine.

    This is how it looks like

    What if I want to get the branch name without modifying any of my files?

    Check out this Stack Overflow answer, then.

    git branch

    The command above shows all the local branches of your repository. The branch name with an asterisk (*) to it’s left is your current branch.

    git branch | grep \* | cut -d ' ' -f2

    This retrieves only the name of your current branch.

    Although this works just fine, I personally think that having the branch name displayed right away is much more convenient. It’s up to you to decide. šŸ™‚

  • How to install and set up Ubuntu Server 18.04 (for domestic usage)

    How to install and set up Ubuntu Server 18.04 (for domestic usage)

    Whos, Whats and Whys

    Why would I need a server in my home?

    You can set it up just to play around, to learn, or even to host a website or an app.

    Who is this tutorial for?

    This tutorial is for people who want to learn, or just play around with their own server, but don’t know where to start. Although this is sort of a step-by-step guide, I expect you to read it carefully, and google things yourself when you get stuck. There are a lot of different hardware combinations and you may encounter different issues than I have encountered.

    What is in this document?

    Here are my own personal instructions on how to do a basic installation and set up of the Ubuntu Server 18.04.

    What do I need to get started?

    You need:

    • An internet connection (obviously)
    • USB flash drive (at least 2GB)
    • A working PC with Windows or Ubuntu OS (this is for making a bootable USB drive – if you have another OS or you want to use another media for installation, such as DVD, please google it yourself)
    • A machine that will be your server and on which you will install the Ubuntu Server 18.04
    • Peripherals: keyboard (for the server machine) and monitor (for the server machine)
    • These instructions and Google
    • And some patience and time

    Keyboard and monitor will only be needed for the initial setup. After SSH is set up, you will be able to connect to your server from another machine (laptop, smartphone, etc.) via SSH. and configure it from the command line.

    For initial setup, I hooked up my server to my TV and plugged in my mini wireless keyboard. Later on, I was connecting to my server over SSH from my smartphone and my laptop computers.

    What are the specs of my server machine?

    My server machine is a Lenovo Q190. It is actually just a mini-sized desktop PC, but I will use it for playing around. Installing Ubuntu Server on a laptop, or a regular desktop PC will work fine if you just want to play around. If you want to host big applications and websites and if you expect 99.99% uptime or more, I suggest paying for a real VPS hosting.Ā 

    Also, ensure that your computer meets the minimum system requirements: https://help.ubuntu.com/lts/serverguide/preparing-to-install.html 

    Installation

    Download and prepare bootable USB

    Download

    Download the Ubuntu 18.04 LTS server.

    Make sure you don’t download the Live image.

    Use this link to download the ā€œstandardā€ install: http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/ 

    Create a bootable USB (on windows)

    Download Rufus: https://rufus.ie/ 

    Select USB drive, select downloaded ISO and create bootable USB.

    More resources

    These are step-by-step instructions form by the Ubuntu team for creating a bootable USB using Rufus or Startup Disk Creator:

    If you use another platform (e.g. Mac) or tool, please google on how to create a bootable Ubuntu USB using that platform and tool.

    Install Ubuntu Server on the machine

    Setup BIOS

    Set up your BIOS so you can boot from USB properly.

    How to boot to BIOS and how to set the boot priorities is different from machine to machine. Google it on how to do it for your server. My server was configured to boot from legacy devices (such as USB drives) first, and then from HDD, so this worked for me out of the box.

    Boot from USB

    Put the USB to an empty USB slot, and boot from it. As said before, learn how to boot from USB on your hardware. Sometimes it involves pressing the F8 key on the keyboard during startup.

    Install

    Install Ubuntu Server following the installation instructions.

    Installation instructions easy to follow. What I selected was:

    • English language
    • US keyboard layout
    • Croatian regionĀ 
    • I did not set up the network (I did it after the installation)
    • I selected OpenSSH, DNS and LAMP from additional software section
    • I used the whole disk to install (with LVM)
    • I installed GRUB

    If you don’t have Ethernet network, you can set up WiFi. If it does not work during the installation (like my WiFi), then you can try doing it after the installation. This will be covered in later sections. If you will be connecting your machine via ethernet (recommended), then you won’t need WiFi and you can set up the network during the installation. I recommend setting up a static IP address. It is easier if you always know the IP of your server, rather than constantly checking which IP DHCP assigned to your server after reboot (of server or reboot of the router).

    During the installation install additional software packages if needed. I recommend installing OpenSSH at least. You will need it if you want to connect to your server remotely.

    I installed DNS, LAMP, and OpenSSH so I can have fun with these at some later point. šŸ™‚

    If you miss installing something, you can always install it after the installation is complete and after you gain internet access.

    More resources

    Check out this great tutorial on how to install Ubuntu Server 18.

    First boot

    Plug out your bootable USB.

    Power on the machine.

    Login using credentials specified during the installation.

    Setup

    Network and connectivity

    Setup WiFi network

    This is optional and you don’t need this if you are using Ethernet. Using Ethernet is recommended, as it is more secure and probably faster than WiFi. If you don’t have an option to connect via ethernet then you can use these instructions. If you are already connected via ethernet, then you can skip this step. You can also skip this step if you successfully connected to WiFi during the installation process.

    Check your WiFi card

    Find out the device name

    Find your device name:

    /sbin/iw dev

    Mine is wlp3s0. Yours might be wlan0, or something else.

    Check the device status (up or down)

    Check status:

    ip link show wlp3s0

    If you see the word ā€œUPā€ in the brackets – the interface is up. If there is no word ā€œUPā€, the device is down.

    Set your wireless interface to ā€œUPā€ state

    If the device is up, you are good and you don’t need this step.

    If it is down, bring it up:

    sudo ip link set wlp3s0 up

    You need root access (sudo) for this. You may also need it for some other commands we later use.

    Now, repeat this to verify your interface is up:

    ip link show wlp3s0

    Scan the networks

    Use this command:

    sudo /sbin/iw wlp3s0 scan

    Find the network you want to connect to (check the SSID for the name). Also, make sure your WiFi is protected by WPA/WPA2 (not WEP). These instructions are for WPA/WPA2. WEP is not secure enough. If you must connect to a WEP protected network (or even an unprotected network) please, google it.

    Connect to your WiFi network

    Let’s assume that your WiFi name (SSID) is MyNetworkName, and your WPA key is MyStrongPassword.

    Create a new YAML file for netplan

    Newer versions of Ubuntu use Netplan. Netplan is a simple way of configuring your network. More about netplan can be found here: https://netplan.io/

    To create a new YAML file, simply copy the example YAML file into the right directory. Copying makes it easier for editing later on, as the copied file is already properly formatted, and indentation in YAML files is very important.

    Copy:

    sudo cp /usr/share/doc/netplan.io/examples/wireless.yaml /etc/netplan/02-netcfg.yaml

    Edit the file. Set your wireless card name and your IP addresses. This is how this file looks like on my machine.

    Open the file:

    sudo nano /etc/netplan/02-netcfg.yaml

    Edit it (these settings fit my network and my WiFi card):

    network:
      version: 2
      renderer: networkd
      wifis:
        wlp3s0:
          dhcp4: no
          dhcp6: no
          addresses:
            - 192.168.0.99/24
          gateway4: 192.168.0.1
          nameservers:
            addresses:
              - 8.8.8.8
              - 8.8.4.4
          access-points:
            ā€œAna+Matejā€:
              password: ā€œAna14.11.2015.Matejā€

    Then press Ctrl+x, ā€˜Y’ and Enter for ā€œyesā€ and then Enter again. This saves and closes the nano editor.

    Yes, I use nano instead of vi and I am a newb.

    Apply the changes and reboot

    You need to apply the changes and then reboot your server.

    Command:

    sudo netplan generate && sudo netplan apply && reboot
    Ping to see if you are connected

    Command:

    ping 8.8.8.8

    If you have the internet connection you should see something like this:

    64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=135 ms

    Interrupt pinging with Ctrl + c

    More resources

    https://ubuntuforums.org/showthread.php?t=2392154

    https://askubuntu.com/questions/1105069/how-to-enable-wireless-on-ubuntu-server-18-04-via-cli

    https://gist.github.com/austinjp/9b968c75c3e54004be7cd7a134881d85

    https://netplan.io/examples

    Troubleshooting

    I encountered a lot of issues while setting up the WiFi. I can only say one thing after it all (after several reinstalls throughout the process) – use netplan only! 

    My WiFi card was not detected during the installation process. Later on, netplan did not work because a lot of packages were not installed (wpasupplicant, iwconfig, network manager, etc.).

    In the end, what I did was – I inserted another USB wifi card into the computer. This other card was detected by the installation, but it still would not connect to my router. I installed the OS without setting up the network. Then I set up the WiFi using netplan using my USB wifi card. And after getting online with it, I just changed the name to my integrated WiFi card in netplan’s YAML file. After applying the config and rebooting everything worked like a charm – I had a static IP address and PC would connect to my WiFi on boot automatically. I really recommend using Ethernet cable if you can. 

    Install SSH

    SSH Installation and setup

    This is only needed if you did not install OpenSSH during the installation.

    Run this command to install:

    sudo apt-get update && sudo apt-get install openssh-server

    After installation, run:

    sudo systemctl status ssh

    The status should tell you if everything is OK (if the service is running properly).

    Now, you can connect to your server from your LAN network using ssh username@<ip-address>

    To check your IP address use this command:

    ip a

    It should be your static IP address configured during the installation (or afterward in Netplan’s YAML file).

    More resources

    https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-18-04/

    Make your server accessible outside of your LAN

    What you need is access to your router and the ability to set up port forwarding.

    Port forwarding

    Let’s say your static IP address of your server’s network card is 192.168.0.99

    Log in to your router and forward the port 22 (for SSH) to the local IP address of your server.

    Use this page to learn how to forward a port on your router: https://portforward.com/ 

    Also, if you have a more advanced router, consult the manual of your router.

    This is how it looked like on my home router:

    Later on, we will change the SSH port on our server from 22 to 222. It might be a good idea to forward the port 222 too in the same fashion (or whatever other port you will use). If you cannot get port forwarding to work on your home router provided by your ISP, then you may want to try to contact your ISP’s support for help.

    Now that you’ve successfully forwarded your port, you can proceed to configure Dynamic DNS.

    Dynamic DNS

    If you are making this server as I do – configuring an old PC at your home – then most probably you don’t have a static public IP address. ISPs usually charge their private customers for a static IP address. And routers usually get a new public IP address from ISP provider every 24 hours or so. That means that your public IP address constantly changes and you cannot know your router’s IP address at all times. So, you won’t make much use of your port forwarding this way.

    That’s where Dynamic DNS, or DDNS, or Dyn DNS comes in.

    This is a service that maps your current public IP address to a domain name and updates it whenever it changes. So, if your DDNS domain is server.blabla.com, you will be able to connect to your router via port 22 using this hostname and you won’t need to specify the IP address. And DDNS takes care of public IP address changes.

    You can register for a free DDNS on the DuckDNS website.

    When you register, you can create a DuckDNS subdomain.

    Create it, and a token will be generated.

    I set up domain as matej-server.duckdns.org.

    Some router support DuckDNS to be entered in the router settings. If that is the case for your router, then you may enter the settings directly to the router. If not, then you may configure the Duck DNS service to run on your Linux server directly. For that, check this guide and click on linux-cron.

    Another free DDNS can be found here.

    Add CNAME (Alias) to your zones if you have your own domain

    Additionally, if you own a domain, you can add an alias to your Zones, so you can access your server with your own domain name. 

    If you own a domain blahblah.com, than you may create an alias server.blahblah.com to point to your DuckDNS hostname.

    I own a domain on Bluehost hosting and this is how it looks like: 

    So now, I can access my server over SSH like this: ssh username@server.blahblah.com

    What happens here is: server.blahblah.com points to matej-server.duckdns.org which points to my (current) public IP address, and when I send a request to port 22, the port forwarding does the forward to the request (with port 22) to the local IP address of my server (192.168.0.99).

    Pretty cool, right?

    Useful setup steps

    Initial system upgrade

    Upgrade

    Run this command:

    sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo do-release-upgrade -d

    Reboot

    Command:

    reboot

    If it does not work, then try:

    sudo reboot now

    Cleanup

    Command:

    sudo apt-get autoclean && sudo apt-get autoremove

    Command:

    reboot

    Reboot again just to make sure everything is fine. If it does not work, reboot with sudo.

    Fix bash history

    If your .bash_history is owned by root and if your .bash_history is not appended across sessions (meaning, the content gets overwritten on the next login), then execute the following commands: 

    cd ~
    sudo rm .bash_history
    touch .bash_history

    Use the following command only to verify that the file is there:

    ls -la
    shopt -s histappend

    You don’t have to do this if your .bash_history file works fine.

    Security

    Disable passwords for SSH and use keys only

    This adds more security to your server. Basically, what needs to be done is: generate key pairs on your client PC (PC that you will use to connect to the server over SSH), then put the key into the server and configure SSH to disable password logins.

    I highly recommend doing this from your local network.

    Generate key pairs on a client computer

    I will write instructions on how to do it on another Linux Ubuntu-based computer. If you need to generate keys on a Mac it should be similar to Linux based computers. If you need to do it on a Windows machine, google for PuTTY (for connecting over SSH) and PuTTYgen (for generating keys).

    Generate keys using this command:

    ssh-keygen

    Leave default path (just hit Enter) and if you want to enter a passphrase – enter it. If not, leave it blank and hit Enter. Passphrase adds more security, but for my server, I did not use a passphrase.

    After that, you will get the location of your private and public key, as well as the fingerprint.

    Now, copy the public key from the client to the server using this command:

    ssh-copy-id username@ip_address

    That is it. Keep note that you should never share your private key with anyone!

    Now, you can connect to your server from trusted computers without specifying the password.

    If you need to add more than one client computer from which you can connect to the server, you can generate as many keys as you want. I generated two more – one from PuTTYgen and one form JuiceSSH app on Android. I did not have the ability to use ssh-copy-id command, so I did the following:Ā 

    I copied the contents of my id_rsa.pub file (that was generated). I connected to the server (from another trusted client). I pasted the contents of id_rsa.pub file into ~/.ssh/authorized_keys. Make sure you separate multiple keys with space(s).

    Configure SSH and disable password logins

    Connect to your server from a trusted computer using a key.

    Open your SSH config file:

    sudo nano /etc/ssh/sshd_config

    Most of the properties described below are already in the file, but they are commented out. They represent the default values for those properties. It is a good idea to leave all the commented-out lines as they are, and add changed values below the original ones. It’s up to you.

    Add the following lines (or change the commented-out ones):

    Root login:

    Original valueChange it toNote
    #PermitRootLogin prohibit-passwordPermitRootLogin noIt may say ā€œ#PermitRootLogin yesā€ before you change it to ā€œnoā€
    /AllowUsers username1 username2This line does not exist. Add it and specify your username (the one that you want to connect with). You can add multiple usernames. I specified my user.
    /AllowGroups groupName1 groupName2This line does not exist. Add it and specify your user group (that should be allowed). You can add multiple user groups. I did not add this to my server.
    /DenyUsers username1 username2This line does not exist. Add it and specify the usernames that should not be able to access your server over SSH.  I did not add this to my server.
    /DenyGroups groupName1 groupName2This line does not exist. Add it and specify the user groups that should not be able to access your server. I did not add this to my server.
    #Port 22Port 222Add a different port number. Default port for SSH is 22. However, if you change it to something else potential hackers would need to guess the port and this makes your server more secure.
    #LoginGraceTime 2mLoginGraceTime 1mIf you don’t log in successfully within a specified amount of time, SSH will disconnect. Lower this from default 2 minutes to 1 minute.
    #ListenAddress 0.0.0.0ListenAddress 192.168.0.99Make SSH listen only to a specific IP address(es). If you need more IPs, just add multiple ListenAddress entries. Add an IP address of your network card (your static IP address).
    #ClientAliveCountMax 3ClientAliveCountMax 0This indicates the total number of checkalive message sent by the ssh server without getting any response from the ssh client. Set it to 0 so no alive messages are sent from the client. 
    #ClientAliveInterval 0ClientAliveInterval 600This indicates the timeout in seconds. After x number of seconds, ssh server will send a message to the client asking for response. Default is 0. I set mine to 10 minutes (600 seconds)
    #PasswordAuthentication yesPasswordAuthentication noDisables password authentication. After this change is applied you will only be able to connect using a key.

    Additional notes:

    • You can use the combination of all the Allow and Deny directives. It is processed in this order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups
    • If you set ClientAliveInterval to 60 and ClientAliveCountMax to 0, that means that after 60 seconds of being ide you will be disconnected. If you leave ClientAliveCountMax to 3, then with ClientAliveInterval of 60 you can be approx. 180 seconds idle before disconnect happens.
    • Be 100% your settings are correct, so you don’t lock yourself out of your server (if you do, you can still log into it physically by connecting peripherals)

    Save the file and exit nano.

    Now you need to restart the SSH service. If you restart it and you are connected to your server over the internet (through DDNS), then you will lose access to your server. That is because you changed your SSH port from 22 to 222, and your port forwarding forwards only to port 22. That is why I recommended doing these changes from your local network.

    Restart SSH service:

    sudo systemctl restart ssh

    From now on, you connect to your server only via key with this command: ssh -p 222 username@ip_address  (assuming you set your port to 222)

    Important: If you have set port forwarding on your router, make sure you change it from 22 to 222.

    Add custom Banner when someone connects via SSH

    Although this does not really increase security, it may scare some novice attackers. Like the ā€œno trespassingā€ sign would ā€œscareā€ somebody people who find themselves in a place they should not be. The banner is usually displayed before the authentication.

    Open the SSH config file:

    sudo nano /etc/ssh/sshd_config

    Find the following line: #Banner none

    Replace it with: Banner /etc/issue

    The /etc/issue is the path of your banner file. 

    Close the config and save.

    Now, open the banner file:

    sudo nano /etc/issue

    You may paste this template.

    Save the file and exit nano.

    Restart SSH service:

    sudo systemctl restart ssh

    More resources

    https://help.ubuntu.com/community/SSH/OpenSSH/Configuring

    https://www.thegeekstuff.com/2011/05/openssh-options/

    https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04

    https://help.ubuntu.com/community/SSH/OpenSSH/Configuring

    Install additional useful software

    First and foremost run this:

    sudo apt-get update

    Then, install these packages below.

    htop

    Htop is a better alternative of top command. It makes monitoring of the system easy. It nicely displays RAM, CPU(s) and processes, and lets you manipulate processes. 

    Install it like this:

    sudo apt-get install htop

    rar and unrar

    Lets you manipulate the rar files. Use rar to create compressed archives and unrar to extract them.

    Install them using these two commands:

    sudo apt-get install rar
    sudo apt-get install unrar

    Start crucial services on startup

    If you need to start some crucial services on startup of your server, you can do so.

    As of now, I cannot think of any services that are not run automatically. The ones I currently have are enabled to do that by default.

    Check the link from “More resources” to learn more.

    More resources

    https://askubuntu.com/questions/9382/how-can-i-configure-a-service-to-run-at-startup

    Conclusion

    There you have it. Now you have your server configured. Doesn’t it feel nice to have a server on your own? šŸ™‚ 

    Dear hackers

    If you hack this server you will hack a small PC that has no sensitive data and no useful information.

    We can make your hacking skills useful to everyone

    If you still want to hack this server, then it would be useful that upon a successful hack you contact me, and we assess the vulnerabilities used while hacking, fix it and add it to this document. This way both of us can contribute to the community. 

    If you still decide to hack and do mean stuff

    Then you are just a mean person working against the community. If you hack me and remove everything from my disk, or copy everything from my server to your PC, you will get no real benefit out of it. You will just do harm to me, and to the community. I will be forced to shut the server down and delete this document, as it would mean that it is not good enough. We can have awesome articles on the internet that help people but hacking just nullifies all of my efforts here.

    Please, don’t be mean. Contribute instead.

    Thank you!

  • Gaming

    Gaming

    My gaming story is not interesting.

    Unreal Tournament 2000 GOTY

    As most of the kids played various video games, so did I. I remember the PlayStation 1 days and old PC games back in the days.

    Now, as a grown-up man, I don’t have enough time to play games to the extent I used to. Also, I don’t track the gaming industry, so I don’t even know what is hot in the gaming world. PS4, Xbox and other consoles are something that I don’t want to waste my money on (I would rather buy another RC car). So, basically, I am out when it comes to games and gaming.

    Still, when I do play games this all boils down to actually two PC games.

    1. Unreal Tournament 2000
    2. Vietcong (1 and 2)
    3. Portal (1 and 2)

    Portal is something that you go through once and that is it. I might go through it again. I completed the Co-Op levels in Portal 2 together with my brother.

    Vietcong 2 is something I play with my family and friends. Pretty much the same guys from the band. I host a server on my tablet (yes, tablet) and then we all connect to it and play. We don’t play Vietcong 1 anymore. I think we should play it sometimes.

    Unreal Tournament 2000 is an oldie and I enjoyed playing it back in the days.

    So, when it comes to gaming (by me) I am still not sure whether I will dedicate a whole blog for just 2-3 games, but my goal would be something like this.

    I want to try to (somehow) host Vietcong 2 on my Linux server and keep it running all the time (so I don’t bother with my tablet). I just want some kind of server where we can play.

    Another thing I want is to revive the Unreal Tournament 2000 Snipermania server. I will try to replicate it as much as I can. Basically, Capture The Flag, only snipers, 15 minutes or 7 captures, map vote after each game, no bots, 16 players max. That is the plan. This game should work just fine on my Linux server. I just need to configure it properly.

    When I have my game server(s) up and running, I will protect them with a password, and I will change the password every now and then. The password will be publically available here on my web pages.

    Basically, that is the plan for gaming… I am either too old for games, or I am – as I like to say – stuck in the early 2000s when it comes to gaming.

  • Music

    Music

    Music was always an important part of my life.

    As a kid, learned how to play keyboards. I started taking lessons from a really cool teacher. I was really good at it, so my parents replaced my small toy-grade synthesizer with 80 keys sized Yamaha PSR 280. However, as puberty kicked in the whole lesson-taking thing felt boring for me (everything was boring in puberty), so I just quit taking the lessons. That was very, very unfortunate, but I guess I was just too young to understand music and the songs my teacher was teaching me (The Beatles, for instance).

    A couple of years later, I started playing my Yamaha keyboard again. My right hand was still flexible and skilled and I could still play with it very well. My left hand, however, was already rusty and it was only good for bass lines. I never fixed this issue with my left hand (I never practiced enough) and I still don’t play the synthesizer/piano properly.

    So I was playing what I could and how I could. But I quickly got bored playing the old stuff. So this time I wanted to play music I also enjoy listening (not that I didn’t enjoy The Beatles). I set my Yamaha to sound #31 (the overdrive guitar sound) and I started playing some rock riffs. So, just like that, without any tabs, chords or notes, I managed to pull off the riff from the song Money For Nothing by Dire Straits. I played it on the wrong scale, but I hit all the tones perfectly. This was a big confidence boost for me, as I proved to myself that I can actually play the instrument and that I do understand music (to some very basic level, at least).

    After that, I started listening to Linkin Park. The Meteora just came out and my brother bought the CD. Awesome album. Since my Yamaha PSR 280 had the ability to record up to 5 tracks, I started recording LP songs on my synthesizer. Guitars, bass, drums, and vocals (using some instrument). This was so cool for me back then. But then, I popped the question – what if I start singing instead of playing the vocals? That’s when I realized two things:

    • I suck at singing
    • Chester Bennington is the best vocalist in the Milky Way Galaxy (well, no it should say was the best – R.I.P. Chester)

    The second point was just a fact. The first one, however, had room for improvement.

    So, I started digging. Forums, YouTube videos, blogs, books… I wanted to learn how to sing. And, actually, this is where I am today. Still learning. Still improving. But I think I sound much better now. I am still not entirely happy with my voice (and I still cannot sing what Chester could). I even had a few songs covers on my YouTube channel, but I think I will make them private, as I am not happy with them either.

    Some time had passed, and somehow (naturally) a group of friends (and family members) and I started… something… like a band. We are more like a group of people who share the same “qualities”:

    • we play some instrument
    • we like music
    • we all love beer
    • we all suck at playing music

    This crazy group of people is my band and I really like playing with them in our rental garage. We are all still improving and our goal is to have some gigs where we would play preferably rock songs. So far we had one gig and it was actually really good. If only more than 3 people came to that bar to listen to us… ?

    This is basically my music story. What I will do in the future is, either another adding some content here on bymatej.com or I will actually make a website for my band. The goal is to have recorded covers of songs and maybe even some videos too. Currently, my band does not have a functional website.

    There is nothing more left to write, except – Stay tuned! ?

  • RC

    RC

    RC cars have always been something that I was interested in. However, as a kid, I never had enough money to purchase a real hobby-grade RC car. Therefore, I was stuck with toys.

    Today I am a grown-up man with kids on my own. Still, a child inside me kept the RC car’s interest. Plus, now I have a (good) job and I could afford a hobby-grade RC car. Still, I did not want to spend unnecessary money on “toys” and I would rather buy something else that my family needs (yes, hobby-grade RC cars are just expensive toys for grown-up kids like me).

    Until my 27th birthday. When my wife decided to buy me a Traxxas TRX-4 Bronco. It is a rock crawler. Best car ever! And yes, I do have the best wife in the world! <3

    But before my Bronco, I had an awesome RC car – WLtoys A979. After I burnt it’s ESC, I decided to build my own metal brushless A979. This was the best experience with RC cars I ever had. Building something from scratch is fun, and just looking at it after it’s done feels awesome!

    As my Bronco and my A979 are not my only cars, I decided to record my adventures with my cars, write about them and post videos on YouTube. That’s the plan, at least…

    My rigs:

    • WLtoys A979 (stock – out of order)
    • WLtoys A979 (custom metal brushless – working)
    • Traxxas TRX-4 Bronco (my favorite)
    • Orlandoo Hunter Ford F150 (tiny crawler for indoor fun)
    • Audi R8 LM by Nikko (modded – my little son’s toy)
    • And many other toys…

    The blog about my RC cars and adventures will be here, and I can’t wait o add more content. A bunch of images and videos have piled up on my smartphone and I can’t wait to share them with everyone!

    Go ahead and check it out. šŸ˜‰

  • Programming

    Programming

    This blog will reside on the Programming category.

    As a Java developer, I will mostly write about Java-related topics. I will explore other languages too, as well as some DevOps stuff.

    Some of the topics that I am interested in are:

    • Java
    • Python
    • Spring Boot
    • Django
    • Design patterns
    • Docker
    • Linux
    • and many more

    This is an ongoing journey but it does not take priority over my family life, so be patient with the upcoming content. šŸ™‚

    I am not sure if I’ll list all of my topics here in the future or will list only my highlights. Either way, this is just an introductory post that shows you my interests when it comes to programming.

    Now, head over to programming.bymatej.com and check it out. šŸ™‚