Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Sometimes to know your IP address, you have to open a web browser and open a site that gives you the ip address of your system. But what if you are a sysadmin and you don't have access to a browser on Linux server? What if you don't wanna leave your terminal?

Get your IP address from command line using curl:
$ curl ifconfig.co
80.171.524.14

#linux #sysadmin #curl #ifconfig #ip #ip_address #ipv4
How to get IP address of a docker container?

First you need to issue the following command to get the container id (first column):
docker ps

Use the container ID to run:
docker inspect <container ID>

At the bottom,under NetworkSettings, you can find IPAddress.

#docker #ip_address #container #ps #ip #inspect
With mysqldump you can export databases. with --port parameter you can specify which port it should connects. If you provide localhost for --host parameter, mySQL will use sockets and port will be ignored.

So be careful with it!

#mysql #mysqldump #port #port_ignorance #3306 #backup #database_backup #sockets #ip_address #localhost
How to get default gateway IP address?

ip route | grep default


The output would be something like below:

default via 192.168.1.1 dev eth0 onlink


NOTE: it can be different on your system

#linux #sysadmin #ip #route #default_gateway