Technology Tips

TECHNOLOGY TIPS

IPTables – Opening up Multiple Ports – One Liner

#—for all subnets / tcp protocol—# #iptables -A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.122.0/24 --match multiport --dports 22,25,123,53 #—for subnet – 192.168.122.0/24 / tcp protocol —# #iptables -A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.122.0/24 --match multiport --dports 22,25,123,53 Note:...

Read More
Technology Tips

TECHNOLOGY TIPS

Opening Port on Iptables

By default iptables is the firewall that is enabled on linux systems. It is very simple to open ports without totally disabling the iptables service. Here are simple steps: iptables -I INPUT -p tcp --dport <port> -m state --state NEW,ESTABLISHED -j ACCEPT iptables -I OUTPUT -p tcp --sport <port>...

Read More
Technology Tips

TECHNOLOGY TIPS

Increasing SSH Timeouts

Here are the steps to increase ssh timeout at the server level on Linux OS: These steps are performed on CentOS: Modify the following directives by editing the sshd config file: /etc/ssh/sshd_config TCPKeepAlive yes ClientAliveInterval 30 ClientAliveCountMax 99999   Restart SSH Demon after modifying the config file: [root@mars ~]#...

Read More
Technology Tips

TECHNOLOGY TIPS

AWK one liner – Getting Sum of a Column

The following AWK one liner that can be used to get sum of a column in a text file: Here is the sample of file content: cat file_size.txt -rw——- 1 oracle oinstall 4096 Jun 8 18:24 file0000018500000001 -rwxr-xr-x 1 oracle oinstall 19 Jun 14 13:33 file0000034c00000001 -rw——- 1 oracle...

Read More