/var/net/sys/admin/blog

Some sample websites that you can use with curl to display your external public IP. As you know, especially if you are connected to a router, it will provide you private IP via the DHCP and it is NAT’ed. So using ‘ifconfig’, ‘ip addr show’, ‘hostname -I’ or via the GUI won’t show the public IP.

curl ifconfig.co  
curl icanhazip.com
curl ifconfig.me
curl ipecho.net/plain ; echo
curl ident.me ; echo
curl checkip.amazonaws.com
curl bot.whatismyipaddress.com ;echo
curl myexternalip.com/raw
curl whatismyip.akamai.com ; echo
curl myip.dnsomatic.com;echo
curl -s ipinfo.io | jq .ip
#need to install jq

Share

Scenario: Multiple network interfaces in your server and each connected to different network and getting the IP via DHCP
Objective: Make all IP pingable and accessible remotely e.g. SSH
Solution: Configure Gateway Routing or setting up multiple default routes for each interfaces

Initially when you connect different links/network (regardless it’s in the same subnet or not) for each of the interfaces, it will end up only one interface is reachable. Why? Because by default, it can only have one default route or gateway on a system.

Example: 5 NIC in 1 Linux Server
Noted: Tested in Redhat based Linux (CentOS,Fedora). Assuming the IP dynamically assigned by the DHCP server:

Share

After installing GNS3 or Graphical Network Simulator 3 in Ubuntu Linux, you can run it via the command “gns3” but it does not come with a default launcher or shortcut. To have a nice shortcut to place under your launcher bar or dock, here are the steps:

1. Go to /usr/share/applications folder

tux@freelinux:~$ cd /usr/share/applications

2. Create a filename with extension “desktop” , e.g. gns3.desktop . Configure the following desktop entries as per below. The contents are quite self-explanatory. Save and exit

tux@freelinux:/usr/share/applications$ sudo vi gns3.desktop

[Desktop Entry]
Name=GNS3
Comment=GNS3 Network Simulator
Exec=/usr/bin/gns3
Icon=/home/tux/GNS3/gns3-icon.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Application;

Share

Spotify is considered the king of digital music streaming service that offers millions of songs.  There are 4 steps to install Spotify client in Debian-based Linux.

Tested in Ubuntu 16.04 LTS. Enjoy!

1.Add Spotify’s repository signing key to verify downloaded packages
sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886

2. Add Spotify repository
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list

3. Check and update latest version
sudo apt-get update

4. Install the Spotify client
sudo apt-get install spotify-client

Run “spotify” in the command-line or find from the Applications

Share

Sublime Text is one of the best text or code editor that you can have in Linux as it supports different programming languages and markup languages. There’s a list of features that you can check from the Sublime Text official website, one of my favorites is the python-based plugin API and “Goto Anything” feature.
The only downfall I find is Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use.

Installing Sublime Text ver.3 in Ubuntu 16.04 LTS can be done in just 3 steps. As it is not available in Ubuntu Software Center, need to add first the repository before installing it.

Share

Installing a graphical network simulator GNS3 is quite easy for Ubuntu based distribution for 64-bit systems. Tested using Ubuntu 16.04.

sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
sudo apt-get install gns3-gui

few packages will be installed aside from the gns3-gui , gns3-server

qemu
wireshark
dynamips
cpu-checker

Type “gns3” in command line to launch the application. Enjoy!

tux@freelinux:~$ sudo add-apt-repository ppa:gns3/ppa

Share

For Ubuntu 16.04 LTS or greater, it would be simple as only required two steps to install Fingerprint Scanner. Tested using Lenovo Thinkpad X240

  1. sudo apt install libpam-fprintd
  2. fprintd-enroll

That’s it. You can now login or even use for sudo access using finger print

Alternative: Fingerprint GUI

tux@freelinux:~$ sudo apt install libpam-fprintd
Reading package lists… Done.
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libpam-fprintd
0 upgraded, 1 newly installed, 0 to remove and 282 not upgraded.
Need to get 0 B/9,336 B of archives.
After this operation, 68.6 kB of additional disk space will be used.
Selecting previously unselected package libpam-fprintd:amd64.
(Reading database … 173955 files and directories currently installed.)
Preparing to unpack …/libpam-fprintd_0.6.0-1_amd64.deb …
Unpacking libpam-fprintd:amd64 (0.6.0-1) …
Setting up libpam-fprintd:amd64 (0.6.0-1) …

Share

Objective: to copy/send or tee packets coming from enp3s4f1 and send to a destination IP via the enp3s4f0 management/data port
ServerA = enp3s4f1 (connected to a switch1 span port) (no IP address)
enp3s4f0  (connected to switch2 as management/data port)
(IP is 192.168.100.99)
ServerB destination IP = 192.168.100.100  (same IP range)

This is based on commer’s post in LQ below:

http://www.linuxquestions.org/questions/linux-networking-3/how-to-route-forward-packets-in-promiscuous-mode-832698/

  1. Configure  the bridge interface and bind enp3s4f1  into it. Disable Spanning Tree Protocol (STP) if necessary. Bring up the bridge interface

#brctl addbr br0
#brctl stp br0 off
# brctl addif br0 enp3s4f1
#ifconfig br0 up

Share
  1. Check the current timezone[root@linuxserver ~]# ls -lt /etc/localtime
    lrwxrwxrwx. 1 root root 38 Aug 25 14:15 /etc/localtime -> ../usr/share/zoneinfo/America/New_York

As you can see the current timezone is NY timezone, if we want to change it to for example Singapore, then use the command “timedatectl” to change.

2. List the current timezones available for reference:

[root@dhcpteeserver ~]# timedatectl list-timezones | grep Singapore
Asia/Singapore

3. Change the timezone to Asia/Singapore

[root@linuxserver ~]# timedatectl set-timezone Asia/Singapore
[root@linuxserver ~]# ls -lt /etc/localtime
lrwxrwxrwx 1 root root 36 Sep 1 11:09 /etc/localtime -> ../usr/share/zoneinfo/Asia/Singapore

Enjoy!

Share

My friend had this Raspberry Pi B+ and wants to use it as a media centre to play his video collection from his NAS storage.  I gave him an option to install Raspbian then install on top those open source media player application. Ended up he wanted the easier way so recommended the OpenELEC. But there’s another thing, he only have Macbook Pro as a laptop.

OpenELEC or short for Open Embedded Linux Entertainment Center, is a free and open source operating system that provides functionality as a complete media center as it is built around Kodi(previously XBMC).

Installation procedure:

Share
 

About FLT

This site is dedicated to everyone who likes to learn and explore the beautiful world of Linux. If you have comments and suggestions, please feel free to email at freelinuxtutorials@gmail.com. I am happy to serve and share things esp. that is free and enjoyable as Linux.