Skip to content

Instantly share code, notes, and snippets.

View 2arunpmohan's full-sized avatar

ARUN P MOHAN 2arunpmohan

  • Factweavers
  • Cochin
View GitHub Profile
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**
@2arunpmohan
2arunpmohan / devops: how to open a port.md
Last active January 5, 2019 12:28
how to open up a port?

the below command will open up the 9100 port.

sudo iptables -I INPUT -p tcp --dport 9100 -jACCEPT

This wont work with AWS

@2arunpmohan
2arunpmohan / mysql: create and restore sql dump files.md
Last active January 5, 2019 12:32
how to create and restore sql dump files - command line

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

@2arunpmohan
2arunpmohan / kibana: change the axis values using scripts .md
Last active January 5, 2019 12:33
Kibana JSON input values usage

Kibana Script usage

How to show the data on Y-axis in percentage

Use case example.

What we want to achieve?
Suppose we want to show the usage statistics of a process in Kibana.
The Y axis -  being the usage of the RAM
and the x-axis - the date/time
@2arunpmohan
2arunpmohan / logstash logs_indexing common guide lines.md
Last active April 21, 2024 14:34
logs_indexing common guide lines

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
@2arunpmohan
2arunpmohan / mapping for suggest - 02.sh
Last active January 5, 2019 12:38
bash scripts for "suggest" mapping example of suggest implementation
#!/bin/bash
if [ -z $1 ] ; then
echo "Please enter hostname"
exit
fi
hostname=$1
curl -XDELETE "http://$hostname:9200/suggest-simple"
@2arunpmohan
2arunpmohan / mappings for attachment.sh
Created September 8, 2016 08:38
bash scripts for reference mapping for pdf attachments in elasticsearch
#!/bin/bash
if [ -z $1 ] ; then
echo "Please enter hostname"
exit
fi
hostname=$1
curl -XDELETE "http://$hostname:9175/pdf-attachment-04"
@2arunpmohan
2arunpmohan / new_gist_file_0
Created September 8, 2016 06:59
netstat for information regarding port utilisation
#To know the ports and process utilisations
sudo netstat -ntlp