Backup and Restore Mysql database table

MySQL Cluster

Dump and restore from .sql Dump mysqldump db_name table_name > table_name.sql Restore mysql -u <user_name> -p db_name mysql> source <full_path>/table_name.sql or in one line mysql -u username -p db_name < /path/to/table_name.sql Dump and restore from a compressed (.sql.gz) format Dump mysqldump db_name table_name | gzip > table_name.sql.gz Restore gunzip < table_name.sql.gz | mysql -u username … Read more

No route to host (113)

In host machine iptables is running and is blocking the port 5901. Kill all the vncserver desktop in the host machine and run the following command in the terminal. Type the password for the user when prompted. sudo iptables -I INPUT 1 -p tcp –dport 5901 -j ACCEPT The above command will add the port 5901 … Read more

httpd: unrecognized service

I’ve installed the Apache web server on Kali Linux and I’m able to start/stop it with: /usr/usr/local/apache2/bin/apachectl restart[start/stop] But if I try to launch it with service command service httpd restart[start/stop] it says httpd: unrecognized service I would use the second way to launch Apache because it’s shorter and I can keep it in mind. … Read more

linux memoery space command

memory space

# df -h will show you where your free space (if any) is, on your mounted partitions. # du -sh /* will show you how much drive space each of your top-level directories are consuming, which might help identify files that don’t need to be on the root partition # fdisk -l (that’s a lower-case … Read more

Command for determining my public IP on linux PC

Finding external IP using external services The easiest way is to use an external service via a commandline browser or download tool. Since wget is available by default in Ubuntu, we can use that. To find your ip, use- wget -qO- http://ipecho.net/plain ; echo

How can I download an entire website?

wget –mirror -p –convert-links -P ./LOCAL-DIR WEBSITE-URL –mirror : turn on options suitable for mirroring. -p : download all files that are necessary to properly display a given HTML page. –convert-links : after the download, convert the links in document for local viewing. -P ./LOCAL-DIR : save all the files and directories to the specified directory.

Linux IP Commands

Display Current Config for all NIC’s: ifconfig Display Current Config for eth0: ifconfig eth0 Assign IP: ifconfig eth0 192.168.1.2 Ping: ping -c 3 192.168.1.1 Assign multiple IP’s: ifconfig eth0:0 192.168.1.2 Assign second IP: ifconfig eth0:1 192.168.1.3 Disable network card: ifconfig eth0 down Enable network card: ifconfig eth0 up View current routing table: route “or” route … Read more

Linux Gateway / Router IP Address

How Do I Find Out My Linux Gateway / Router IP Address? need to use route command. This command can manipulates the kernel’s IP routing tables. It can be also use to print gateway / router IP address. Type the following command to see default gateway: $ route -n Output: Kernel IP routing table Destination … Read more

cgi-bin folder in a subdomain

Should I delete the cgi-bin folder in a subdomain A cgi-bin folder was automatically created in the directory for clothing.mysite.com. Do I need it? I’m only using the subdomain to install wordpress on it. I don’t really understand what the cgi-bin folder is for and I’m happy to leave it if it doesn’t harm anything. … Read more

Clear Memory Cache on Linux centos

By default, every Linux OS has an efficient memory management system used to clear the buffer cache periodically. You can manually free up the memory cache with the following simple command: linux:~$ sudo sh -c “sync; echo 3 > /proc/sys/vm/drop_caches” However, if you want to force the Linux OS to do clearing memory cache on … Read more