export JAVA_OPTS="-Xms2048m -Xmx3056m -XX:MaxPermSize=256m"
Linux administration , Unix administration , Vmware Vsphere administration , Oracle DBA ,apache, backup, dhcp, dns, kvm, xen, kernel, ldap, kvm, monitoring, ticketing, networking, Mail servers, SAN,troubleshooting
Labels
- Amanda (2)
- Ansible (2)
- Answer these Questions (2)
- antivirus (2)
- apache (3)
- Bash (16)
- Chef (3)
- Citrix (2)
- clusters (2)
- Concept (22)
- DatabaseAdminstration (11)
- DevOps (1)
- dhcp (2)
- Downloads (3)
- ELK (1)
- ELK stack (1)
- encryption (1)
- Free trainings (1)
- Frequently Used Commands (46)
- FTP (1)
- git (1)
- gpg (2)
- Hardware (1)
- httpd (2)
- Interview Questions (53)
- iptables (1)
- IT NEWS (3)
- java (1)
- kibana (2)
- knife (1)
- KVM (2)
- linux (17)
- Linux installations (22)
- Linux Jobs (4)
- Linux Links (2)
- logstash (1)
- Mac (1)
- MediaWiki (1)
- MySql (2)
- Nagios (2)
- Networking (3)
- open Nebula (5)
- Open Source tools (12)
- OpenNMS (1)
- openSSL (1)
- Oracle on Linux (5)
- Performance Monitoring (1)
- php (1)
- postfix (1)
- postgres (1)
- postgres-XL (1)
- Product Reviews (1)
- Python (2)
- rssh (1)
- Samba (2)
- Scripting (16)
- security (4)
- selinux (1)
- Server (1)
- SFTP (1)
- Social Awareness (1)
- Solaris (1)
- SSL (1)
- svn (1)
- TCP/IP (1)
- Technology (1)
- Tips and Tricks (32)
- Training and materials (8)
- Troubleshooting (6)
- Ubuntu (18)
- unix (1)
- virtualization (17)
- Vmware (25)
- Vyatta (1)
- windows7 (1)
- xml (1)
How to check syntax of dhcpd (dhcpd.conf file )
/usr/sbin/dhcpd -t -cf /etc/dhcpd.conf
Some other quick tips:
1. Syntax checking for dhcpd files:
/usr/sbin/dhcpd -t -cf /etc/dhcpd.conf
This will do a basic syntax check to find those missing ; or other odd things.
2. host {} are global. You will see this warning if you place the host in a subnet zone. This is because when ISC will parse the file and make hostnames work globally (you can also make it do neat if then things but that makes my head hurt.) For the most part it is useful to put hosts in a group setting. This keeps them out of subnets, and also allows you to put common items with them (say for PXE booting with cobbler).
group {
next-server rhn.example.com;
filename “pxelinux.0″;
host noah {
hardware ethernet 00:11:00:11:00:11;
fixed-address 192.168.1.121;
}
}
Some other quick tips:
1. Syntax checking for dhcpd files:
/usr/sbin/dhcpd -t -cf /etc/dhcpd.conf
This will do a basic syntax check to find those missing ; or other odd things.
2. host {} are global. You will see this warning if you place the host in a subnet zone. This is because when ISC will parse the file and make hostnames work globally (you can also make it do neat if then things but that makes my head hurt.) For the most part it is useful to put hosts in a group setting. This keeps them out of subnets, and also allows you to put common items with them (say for PXE booting with cobbler).
group {
next-server rhn.example.com;
filename “pxelinux.0″;
host noah {
hardware ethernet 00:11:00:11:00:11;
fixed-address 192.168.1.121;
}
}
How to get list of all cron jobs ( crontab ) in a server
Run below as root :
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
If you want to see who owns that cron job run below :
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
getent passwd cut -d: -f1 perl -e'while(<>){chomp;$l = `crontab -u $_ -l 2>/dev/null`;print "$_\n$l\n" if $l}'
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
If you want to see who owns that cron job run below :
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
getent passwd cut -d: -f1 perl -e'while(<>){chomp;$l = `crontab -u $_ -l 2>/dev/null`;print "$_\n$l\n" if $l}'
Bash Script to get public ip
#!/bin/bash
pubip=$( curl http://ip4.me 2>/dev/null | sed -e 's#<[^>]*>##g' | grep '^[0-9]' )
echo $pubip
you can replace curl command with
pubip=$( curl http://ip4.me 2>/dev/null | sed -e 's#<[^>]*>##g' | grep '^[0-9]' )
echo $pubip
you can replace curl command with
curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
Apache hardening tips - Subhash C
# Server banner
ServerSignature Off // will not show apache version etc
ServerTokens Prod // Will hide OS version etc
# Disable TRACE requests
TraceEnable off
### Security Fixes
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE
TRACK)
RewriteRule .* - [F]
ServerSignature Off // will not show apache version etc
ServerTokens Prod // Will hide OS version etc
# Disable TRACE requests
TraceEnable off
### Security Fixes
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE
TRACK)
RewriteRule .* - [F]
Some Find commands regularly used for finding disk usage
find . -size +500000 -print
du -ch | grep total ( total size of directory)
du -sk * | sort -nr | head -3
find /home -type f | xargs ls -s | sort -rn | awk '{size=$1/1024; printf("%dMb %s\n", size,$2);}' | head
find / -type f -size +300000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
du -hs /home/* | grep G
du -hs /home/* | grep M
Subscribe to:
Posts (Atom)