This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -E "Jun 6|Jun 7" error.log.1 > /mnt/aaa.log | |
cat error.log.1 | grep -E 98162 | |
grep -E "suc|stop|getInOutBytes|found" error.log.1 | |
egrep -iH "max|suc" /var/log/IBSng/MAIN/* --color | |
grep "89794" .log. | grep "Jun 17" --color | |
ssh root@172.16.4.12 'grep "19:06:25" /var/log/IBSng/ONLINE_WORKER/* >$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh key | |
ssh-keygen -t rsa | |
cat ~/.ssh/id_rsa.pub | ssh -p 22 swapnil@remote-server ";mkdir -p ~/.ssh && cat >> ~/.ssh/authorized$ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install | |
#time | |
LC_ALL="en_US.UTF-8" | |
#repository | |
deb http://ftp.debian.org/debian/ testing main contrib non-free | |
deb http://ftp.debian.org/debian wheezy main | |
#after install package | |
apt-get install libc6-dev | |
apt-get install python-mpi4py | |
apt-get install openmpi-bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#check connectivity in linux server and ldap | |
python | |
import ldap | |
ldap.initialize("ldap://192.168.100.2:389") | |
x = ldap.initialize("ldap://192.168.100.2:389") | |
x.bind_s("USERNAME", "PASSWORD") | |
after return error check error in website | |
http://wiki.servicenow.com/index.php?title=LDAP_Error_Codes#gsc.tab=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SNMP | |
apt-get install snmp | |
apt-get install snmp-mibs-downloader | |
download-mibs | |
cat /etc/snmp/snmp.conf → Add → mibs +ALL | |
Check MIB’s | |
snmptranslate -Tp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Networking | |
#IPv4 Forwarding: | |
nano /etc/sysctl.conf → Change 0 to 1 in ip_forward | |
sysctl -p && echo 1 > /proc/sys/net/ipv4/ip_forward | |
#IPtables: | |
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT | |
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenVPN Config | |
apt-get install openvpn easy-rsa | |
mkdir /etc/openvpn/easy-rsa | |
cp -rf /usr/share/easy-rsa/* /etc/openvpn/easy-rsa | |
Edit the vars file in order to create certificates information: | |
nano /etc/openvpn/easy-rsa/vars | |
cd /etc/openvpn/easy-rsa | |
source vars | |
./clean-all → Cleans everything in keys | |
./build-ca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All connections to server | |
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | |
All connection States | |
netstat -nat | awk '{print $6}' | sort | uniq -c | sort -n | |
Limit HTTP connections to 20 sessions | |
iptables -I INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above | |
20 --connlimit-mask 24 -j DROP | |
Checking how many connections to 80 | |
netstat -n | grep :80 |wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Users & Groups | |
Group file: /etc/group | |
Add User: | |
adduser USER | |
New Group: | |
groupadd GROUP | |
newgrp GROUP | |
Account numbering and important settings: /etc/login.defs | |
Own a user a folder: | |
chown -R USER FOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NMAP | |
Ping with nmap | |
nmap -sP IP | |
Port state | |
nmap --reason HOST | |
TCP connect() scan—(Nmap -sT ) | |
TCP SYN or half-open scan—(Nmap -sS ) | |
TCP FIN, XMAS, and NULL scans—(Nmap -sF , -sX , -sN ) | |
TCP ACK scan—(Nmap -sA ) | |
TCP idle scan—(Nmap -sI ) |
OlderNewer