How to view only TCP Established connections lsof -iTCP | grep ESTABLISHED How to view traffic on specific port ( port 22) Syntax is : lsof -i : port number lsof -i :22 | grep ESTABLISHED How to view traffic from specific ip address lsof -i@ip.of.your.user how to view open files by a individual users [...]
Archive for the ‘Miscellaneous Admin Commands’ Category
Linux: lsof command and its uses
Monday, November 1st, 2010Mysql Server processlist shows negative value(-) in connect column for system user
Wednesday, June 9th, 2010Some times process list out put show negative value like bellow : Command : watch /usr/local/mysql/bin/mysqladmin -ppass processlist 8 | system user | | Connect | -1247 | Has read all relay log; waiting for the slave I/O thread to update it | One of the reason : make sure both Server has same time [...]
Linux:How to configure logrotate for ModSecurity(source install)
Monday, April 26th, 2010Problem: When you install Mod-security from source , by default log-rotate will not rotate those logs file as the path for log files are not defined logrotate configuration file by default. So if you want to allow logo-ratate to rotate your modsecurity log files. here is the steps: 1. Create a file modsecurity under /etc/logrotate.d [...]
Linux:How to create multiple OpenVPN instances
Monday, April 26th, 2010Problem : How to configure openvpn to create multiple instances and listen more then 2 ports(1194,1195) ?? Solution: you need more then 2 openvpn configuration file. example : openvpn.conf and openvpn1.conf Now you need to define different port , Server Ip address,ifconfig-pool-persist, and log files For openvpn.conf : port 1194 proto tcp dev tun server [...]
how to configure logrotate for apache log files
Wednesday, March 24th, 2010Problem : When you install apache from source , by default logrotate will not rotate those logs file as the path for log files are different. Solution: You can edit httpd file under /etc/logrotate.d/ directory and insert bellow lines /usr/local/apache/logs/*log { missingok notifempty sharedscripts postrotate /usr/local/apache/bin/apachectl graceful > /dev/null 2>/dev/null || true endscript } Now [...]
Linux:How to use aide to check file system integrity
Monday, March 15th, 2010Installing Aide: Yum install aide Creating the database: aide -c /etc/aide.conf –i Output : AIDE database at /var/lib/aide/aide.db.new.gz initialized. This process creates a new file, aide.db.new.gz in /var/lib/aide/.You must rename this file to aide.db.gz, which is the correct name for the AIDE database. Testing Aide: aide -c /etc/aide.conf –C
Linux/windows-How to add a printer from cups by using .ppd file
Friday, February 12th, 2010Recently I was trying to add a Canon LBP3460 Printer in my linux Server, I was trying to use .ppd which was available from canon website, but that file would not work. so I download the file from : http://openprinting.org/printer_list.cgi , and its works perfectly . here is the procedure:: Download the .ppd file from [...]
Linux print job administration
Friday, January 22nd, 2010How to find every Printer Status : lpc status How to view print job for a particular printer: lpq -Pprinter-spool-name [root@Host~]# lpq -PGI_LBP GI_LBP is ready and printing Example: Rank Owner Job File(s) Total Size<br /> active xxx 231020 s.t-avprnt.0H9 4096 bytes<br /> 1st xxxx 231023 s.t-avprnt.0HD 4096 bytes</p> How to remove a particular print [...]