the below command will open up the 9100 port.
sudo iptables -I INPUT -p tcp --dport 9100 -jACCEPT
This wont work with AWS
| A systemd component called journald collects and manages journal entries from all parts of the system. This is basically log information from applications and the kernel. | |
| **1. To see all log entries, starting at the oldest entry** | |
| `journalctl` | |
| **2. journal entries from the current boot** | |
| `journalctl -b` |
| **1. start a service** | |
| `sudo systemctl start nginx.service` | |
| **2. Stop a service** | |
| `sudo systemctl stop nginx.service` | |
| **3.Restart a service** |
the below command will open up the 9100 port.
sudo iptables -I INPUT -p tcp --dport 9100 -jACCEPT
This wont work with AWS
create dump files
mysqldump -u root -p test_arun > /home/user/Desktop/test_arun_dump.sql
Restore dump files
mysql -u root -p test_arun_restored < test_arun_dump.sql
for this, we need to create the database "test_arun_restored" prior to to the ececution of the command
Size of all the directories, files etc in the current directory in human-readable format.
du -sh *
command to know the free space in the disk:
df -h .
https://unix.stackexchange.com/a/185777
For that first get the process id (pid) from the below command
ps aux | grep logstash
After the collection of pid (suppose the pid = 6666) from above, use that like below to get the start time
ps -eo pid,cmd,lstart | grep 6666
| #!/bin/bash | |
| if [ -z $1 ] ; then | |
| echo "Please enter hostname" | |
| exit | |
| fi | |
| hostname=$1 | |
| curl -XDELETE "http://$hostname:9200/suggest-simple" |
| #!/bin/bash | |
| if [ -z $1 ] ; then | |
| echo "Please enter hostname" | |
| exit | |
| fi | |
| hostname=$1 | |
| curl -XDELETE "http://$hostname:9175/pdf-attachment-04" |
| #To know the ports and process utilisations | |
| sudo netstat -ntlp |