Getting Started with AWS

Getting Started with AWS
Amazon Web Services, AWS, the Powered by AWS logo are trademarks of Amazon.com, Inc. or its affiliates. See AWS Trademark Guidelines.

The Amazon Web Services world is an entire beast on its own, and I believe some knowledge around it should be useful to all tech related roles, from programmers to DevOps and system administrators. I am recently trying to explore AWS, so I will try to document my process along the way.

In this post I have gathered the steps for signing-up with AWS and the first configurations to make to your account before even starting an instance or a service. It is best to follow the official AWS documentation for each step (as it will be always up to date), but the main actions to do should remain pretty much the same.

Read more →

SNMP Daemon Configure

SNMP Daemon Configure
The SNMP network management figure by Jinchao Xiao’s Lab is licensed under CC-BY-3.0.

In the system administrator world, a large part of the work is to monitor the servers and all systems in infrastructure to make sure of their correct operation and to prevent any kind of malfunction or problems.

One protocol that allows devices to share their status with a monitoring server is SNMP, which is widely used in the networking world, in switches, routers, firewalls, or access points. SNMP’s main benefit is that, if the device supports it, it is very easy to remotely query them for their status and even change their configuration.

Read more →

Pi-hole Docker Install

Pi-hole Docker Install
The Pi-hole logo and Pi-hole® word are registered trademarks.

Pi-hole® is a DNS sinkhole that protects your devices from unwanted content, without installing any client-side software.

We will use Pi-hole as our DNS server in our local network in order to block ads on all devices. It is important for Pi-hole to be run on a device or server that is constantly running, as we will configure our router to point to this device for any DNS query. So without it running we will not be able to access any webpage.

Read more →

SUI Configure

SUI Configure
Screenshot of SUI dashboard by Jeroen Pardon licensed under The Unlicense.

SUI is a startpage for your server and / or new tab page. It offers some similar functionalities as Homer.

We can use this app in order to have a homepage for all our services, apps and links of our server into one place, and edit only some json files for the content.

This guide assumes, that Docker and Docker Compose is already installed in your system.

Run Using Docker

Clone the repository in your system and navigate into it:

Read more →

Grafana Configure

Grafana Configure
Screenshot of a Grafana Dashboard. The Grafana Labs Marks are trademarks of Grafana Labs, and are used with Grafana Labs’ permission. We are not affiliated with, endorsed or sponsored by Grafana Labs or its affiliates.

In this post, we will see how we can install Grafana in our Ubuntu Server. Grafana is an open-source data visualization and monitoring tool that can easily be integrated with other tools.

We will install Grafana in our server as a service and not in a container.

We have more than one way to install Grafana:

  • By downloading the Linux binary
  • By downloading and installing the .deb package
  • By installing from the official repository

We will show the last method, because we don’t have to manually update the package ourselves.

Read more →

InfluxDB Configure

InfluxDB Configure
Screenshot of InfluxDB dashboard. InfluxDB® is a trademark registered by InfluxData, which is not affiliated with, and does not endorse, this site.

In this post, we will see how we can install the latest version of InfluxDB (ver 2.0) in our Ubuntu Server. With the new version there’s only one thing to download and install and we can avoid installing the TICK Stack (Telegraf, InfluxDB, Chronograf, Kapacitor).

The new version is not a simple time-series database anymore, but also a platform for querying, visualization and data manipulation.

We have more than one way to install InfluxDB 2.0:

Read more →

Homer Configure

Homer Configure
Screenshot of Homer dashboard by Bastien Wirtz licensed under Apache-2.0.

Homer is a dead simple static HOMepage for your servER to keep your services on hand, from a simple yaml configuration file.

We can use this app in order to have a homepage for all our services, apps and links of our server into one place, and edit only one yaml file.

In order to run the app we need Docker installed in our system, as it is going to be run as a container. We will also need Docker Compose if we are going to use Compose to start and stop the container.

Read more →

Duck DNS Configure

Duck DNS Configure
Duck DNS logo.

Duck DNS is a free dynamic DNS hosted on AWS, that we can use to get a free domain name. There a lot of free Dynamic DNS services, you can find a good comprehensive of them here as well as No-IP that we already have a guide, but Duck DNS is dead simple and has instructions for how to configure on every possible platform or system.

The only negative for this service is the limited subdomains that we can choose from. Because we can only choose a *.duckdns.org subdomain, if for example hobbit.duckdns.org is not available we will have to choose a different subdomain. This is not true for all dynamic DNS services, as we could keep the hobbit subdomain and change the host name to some other free one.

Read more →

Samba Client Configure

Samba Client Configure
By Unknown author - nicht angegeben, Public Domain, Wikipedia Commons.

After you have already set up a Samba server, we will see in this post how to install and connect a Windows or a Linux machine to that Samba server. There are a lot of ways to do it, and we will use both the terminal and the GUI way for Linux.

Samba Client on Linux

Using terminal and /etc/fstab

For a permanent mount of the network folders after a reboot, we can edit the fstab file in order to mount the drives after a start up.

Read more →

Samba Configure

Samba Configure
By Unknown author - nicht angegeben, Public Domain, Wikipedia Commons.

Install Samba

Install samba:

sudo apt update
sudo apt install samba

Check if the installation successful:

whereis samba

The expected output should be something like this:

samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man7/samba.7.gz /usr/share/man/man8/samba.8.gz

Configure Firewall

If you have a firewall running on your Ubuntu system you’ll need to allow incoming UDP connections on ports 137 and 138 and TCP connections on ports 139 and 445. Assuming you are using UFW to manage your firewall, you can open the ports by enabling the samba profile:

Read more →

Install Hard Drive

Install Hard Drive
Screenshot of fdisk usage.

In this guide, we will see how we can install a new hard drive into a linux system. This operation requires partitioning, formatting and mounting the drive. Lastly, we will see how to edit the /etc/fstab in order for the drive to be automatically mounted at a system reboot.

This guide applies to all linux systems, though its been only tested in an Ubuntu Server machine.

Find the logical name of the drive

The logical name of the drive will be like /dev/sd*, where *=b,c,d,...

Read more →

Hamachi Configure

Hamachi Configure
The Hamachi and LogMeIn logo are the trademarks and service marks of LogMeIn, Inc., and may be registered in the U.S. Patent and Trademark Office and in other countries.

Hamachi is a virtual private network application that lets us securely extend LAN-like networks to distributed PCs from different public networks. This way we can play LAN games with our friends without having to be in the same local network (aka the same house).

It is a useful tool for a Minecraft Server, that we can use in order to allow people in our Hamachi network to connect to our LAN server via a Hamachi connection. This saves us the trouble of port-forwarding in our router and giving our public IP.

Read more →

Screen

Screen
By Neo139 - Own work, CC0, Wikipedia Commons.

Screen Commands

Start a session with name

screen -S "session_name"

Close session

Press Ctrl-D in the session.

Detach from session

Hold down Ctrl and hit A and D in the session.

List all sessions of a user

Lists all sessions with their PID:

screen -ls

Resume a session

Re-attach to a running session using its PID:

Read more →

No-IP Install and Service Commands

No-IP Install and Service Commands
The No-IP logo belongs to No-IP.com.

No-IP is a Free Dynamic DNS and Managed DNS Provider, that we can use to get a free domain name. There a lot of free Dynamic DNS services, you can find a good comprehensive of them here that we can choose from, but this was the first service that I personally tried.

The good with this service is that we have a big selection of free domain names that we can choose, so we can easily find a domain that is available for the hostname we want to have.

Read more →

Fail2ban Configure

Fail2ban Configure
By fail2ban, GFDL, Wikipedia Commons.

Install Fail2ban

sudo apt update
sudo apt install fail2ban

Check Installation

Once the installation is completed, the Fail2ban service will start automatically. You can verify it by checking the status of the service:

sudo systemctl status fail2ban

Configure Fail2ban

Create local configuration file

The configuration file are in /etc/fail2ban/jail.conf, /etc/fail2ban/jail.d/defaults-debian.conf. Its best to not modify these, as they can be overwritten with an update.

Read more →

Node.js App Service Commands

Node.js App Service Commands
Node.js is a trademark of Joyent, Inc. and the systemd logo is trademarked By systemd.io, CC BY-SA 4.0, Wikipedia Commons.

In this post, we will see how can make a node app a systemd service.

Suppose you have built a Node.js application and you have been running it all the time with npm start or by using another application like nodemon, so that you don’t need to restart the server. That is acceptable for development, but once you want to deploy that application somewhere this becomes infeasible.

By deployment, we don’t always mean something big and serious like AWS, Heroku, Containers. We can also mean your laptop or PC, that you want to run your app seamlessly, without needing to explicitly commanding it.

Read more →

SFTP Server Configure

SFTP Server Configure
Icon made by Alexiuz AS from icon-icons.

In this post, we will see how we can use SFTP (Secure File Transfer Protocol) on our Ubuntu Server as a more secure protocol for FTP, in order to transfer files between the server and other clients.

SFTP uses SSH in order to transfer files, so it means the connection is encrypted and as safe as an SSH connection. In order to use it the only thing we need is an OpenSSH server installed and running. If you are using SSH to access your server, this is probably already done.

Read more →

FTP Server Configure

FTP Server Configure
Icon made by Freepik from flaticon.com.

In this post, we will see how we can install an FTP server on our Ubuntu Server in order to transfer files between the server and other clients.

We will use the vsftpd service, to create the FTP server and we will access it either as a new ftpuser authenticated user or Anonymously without authentication.

If you are going to use the FTP service remotely on the public internet, it is best to not use Anonymous FTP, as anyone will be able to download from the server. Also, another and safer option is to use SFTP for remote transferring file that uses SSH, but for local network transfers a normal FTP service will be fine.

Read more →

SSH Server & SSH Keys & UFW Configure

SSH Server & SSH Keys & UFW Configure
By Source, Fair use, Wikipedia Commons.

In this post, we will see how we can install an SSH server on our Ubuntu Server in order to access it remotely, either from the Local Network or via the internet. We will also see the setting required to make the SSH service more secure for accessing through the public internet.

The following guide assumes that we have a server running in our home, on our local network, but the same can apply to a remote server running on a VPS service (like Digital Ocean, AWS, Linode, …). The only major change, is that if you a have a public server, you do not need to set any port forwarding as this applies only to home users.

Read more →

Static IP Server Configure

Static IP Server Configure
Screenshot of netplan network configuration YAML file.

In this post, we will see how we can set a static IP address on our Linux server, specifically an Ubuntu Server (Version > 17.10).

Ubuntu now uses Netplan as the default network management tool to replace the old configuration file /etc/network/interfaces that we can still find in other Linux Distributions.

Network Interface

First we need to find the network interface name that we are connected, we can do that with ifconfig:

Read more →