How to connect a CentOS computer to Internet using USB Wifi Adapter ?

I have an old desktop computer with CentOS 7 operating system installed without GUI. I wanted to connect to internet using a USB wifi adapter. My internet router was located in a different room and LAN cable was not available with me. So I used netgear USB wifi adapter for establishing the internet connection. This post is about troubleshooting and fixing the connectivity issue.

The model that I have used is Netgear WNA3100M Wireless-N300 USB Mini Adapter. The picture is shown below.

wifi_network_adapter

Netgear WNA3100M

I checked the network interfaces and ip address using ifconfig command. It listed an interface named wlp18s0b1. But no ip address was assigned.

I tried ifup command. But it gave me an error as follows.

ifup wlp18s0b1

/sbin/ifup: configuration for wlp18s0b1 not found.
Usage: ifup 

Then I tried listing the USB interfaces using lsusb command and it listed the network adapter usb device. This means that the device is getting detected.

The next steps that I tried are using the nmcli command.

The following command will list all the available Wifi connection profiles.

nmcli connection show

To connect to a wifi network, use the below command. You have to pass your wifi ssid and password as shown below as arguments.

nmcli dev wifi connect your-wifi-ssid password wifi-password

My desktop got connected to the internet after triggering the above command. After this, every time I start my computer, if the desktop is not automatically connected to the internet, I issue the following commands.

nmcli connection show

nmcli connection up your-wifi-connection

This solution helped me. Hope this will help someone else also :).

Gunicorn Connection in Use: (‘0.0.0.0’, 8000)

I develop web services using python flask. One of the common error that I see while deploying the application is “Gunicorn Connection in Use: (‘0.0.0.0’, 8000)”.

This means that the port 8000 is busy with some other running process. But when I check the status of the port with the following command, I get empty response. That means there are no active application using the port. Some stale process is making the port busy.

netstat -tulpn | grep 8000

I even tried with the ps command to see any active process, but that also did not help.

ps -aux

If the ps command list the process, we can kill the process directly using the kill command

kill -9 {PID}

In my case I do not have the PID. So the only option to kill these kind of zombie application by using the below command.

sudo fuser -k {PORT}/tcp

In my case, the port number is 8000, so the command will be.

sudo fuser -k 8000/tcp

This trick helped me several times, hope this helps someone else also.