Find all live hosts on your network

nmap can be used to get list of all devices on your network.

To scan IP range 192.168.1.1 to 192.168.1.255, run

You can also use CIDR notation like

nmap

You can also use

To idenify the host OS and check if ports 80 and 8080 open, run

Logging Modem logs to remote rsyslog server

My FTTH ONU have remote logging option, this allowes me to log to a remote server running rsyslog.

On model, i set IP of my remote server and a UDP port. Default port was 514, i changed it to 511.

Configuring Remote Server

On the server, create file

Add

Here “103.35.199.82” is IP address for my router/modem.

Now restart rsyslog

You will be able to see logs at /var/log/remote.log

Install AnyDesk on Ubuntu using flatpak

AnyDesk ubuntu flatpak

AnyDesk is a remote desktop sharing application like TeamViewer and Google Remote Desktop. I normally use Google Chrome Remote desk as it is completely free. TeamViewer is popuplar alternative, but if they found out you are using it more often, they will limit your session to 5 minutes, some times even less to force you pay for paid version.

AnyDesk available for Ubuntu in deb file. I don’t like installing .deb package as it run a background process on port 7070 or somthing like that. So i decided to go with flatpak version.

First install flatpak with command

Add remote

Now you can install AnyDesk with command

flatpak install anydesk

To run AnyDesk, run

Nginx Config for Laravel Application

Here is Nginx configuration for a laravel application

Nginx Config for Laravel Application in sub folder

Partitioning hard disk for backup

It is better to have a 2nd hard disk on servers for taking backup. Here we will partition a fresh disk and mount it as /backup.

Replace /dev/sdX with actual device name of your backup disk.

Now you need to find UUID for this new drive with command

Create a folder to mount the disk, in this case, we use /backup

Edit /etc/fstab

Add

Replace “1c7b33ed-ea6d-4694-9925-edfd0e8a2837” with actual UUID for your new disk, that you found using blkid command.

Now run

This will mount all disks specified in /etc/fstab, verify /backup is mounted with command

Partitioning New HDD

Here we partition device /dev/sdb and mount it as /backup.

First, we check free space on the server with

Lets make make the partition table of type GPT

Now you will see we have 1000 GB free space.

Lets create partition of type ext4 using 100% of the disk.

Formatting the Disk

Mounting Disk

First find the UUID of the disk with command blkid

UUID for the disk /dev/sdb1 is

To mount this disk as /backup, first create a folder

Now edit /etc/fstab

Add following line

Run

This will mount all disks specified in /etc/fstab

Verify your new drive is mounted with command df -h

Debian 8 jessie repo error

On a Debian 8 server, when running apt update, got following error

To fix it, run

Add following content to the file

Create

Add