-
Notifications
You must be signed in to change notification settings - Fork 0
/
hints.txt
68 lines (56 loc) · 3.15 KB
/
hints.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#Anti DDOS filter. Ban IP which is has more than 20 queries to URL.
tail -500 access.log | grep research-pape | awk '{print $1}' | sort | uniq -c | awk '{if ($1>20) print $2}' | xargs -I {} iptables -I INPUT -s {} -m comment --comment “ddoser” -j DROP
============================================================================================================
#Domain STATUS
#!/bin/bash
hostname=$(cat /etc/hostname)
for i in $(ls /var/www/html); do echo "$i = $(curl -s -o /dev/null -w "%{http_code}" $i)" >> /root/sat_domains.txt; done
scp /root/sat_domains.txt root@ip:/root/sat_domains_$HOSTNAME;
============================================================================================================
#AWS. Mapped EC2 IPS
#!/bin/bash
for i in `curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/`; do
for x in `curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${i}/ipv4-associations/`; do
echo "public ip: $x" "is private `curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${i}/ipv4-associations/${x}`";
done
done
============================================================================================================
#Centos.Manually Puppet Agent 3.8.7 installation:
#/bin/bash
yum remove puppet -y
wget -q https://pm.puppetlabs.com/puppet-enterprise/3.8.7/puppet-enterprise-3.8.7-el-6-x86_64.tar.gz -O /tmp/puppet-enterprise-3.8.7-el-6-x86_64.tar.gz
tar xvfp /tmp/puppet-enterprise-3.8.7-el-6-x86_64.tar.gz -C /tmp/
echo "
q_install=y
q_puppet_cloud_install=n
q_puppet_enterpriseconsole_install=n
q_puppet_symlinks_install=y
q_puppetagent_certname=$HOSTNAME
q_puppetagent_install=y
q_puppetagent_server=puppet-satellites.uncomp.com
q_puppetmaster_install=n
q_puppetdb_install=n
q_vendor_packages_install=y
" > /tmp/puppet-enterprise-3.8.7-el-6-x86_64/my_answers.txt
/tmp/puppet-enterprise-3.8.7-el-6-x86_64/puppet-enterprise-installer -a /tmp/puppet-enterprise-3.8.7-el-6-x86_64/my_answers.txt
ln -s /opt/puppet/bin/puppet /usr/bin/puppet
rm -rf /etc/puppetlabs/puppet/ssl
puppet agent -t
============================================================================================================
Import single database from --all-databases dump:
sed -n '/^-- Current Database: `dbname`/,/^-- Current Database: `/p' alldatabases.sql > output.sql
============================================================================================================
Kill Queries Like Select
mysql -e "show processlist" | grep SELECT | awk '{print $1}' | xargs -I{} mysql -e "kill {}"
============================================================================================================
XHProf:
Added to php.ini
auto_prepend_file = "/var/www/xhgui/external/header.php"
or Puppet verse:
<% if (@fqdn == "essay.staging") %>auto_prepend_file = "/var/www/xhgui/external/header.php"
<%else %>
auto_prepend_file =
<% end -%>
============================================================================================================
GRANT SELECT, UPDATE ON `db_name`.* TO 'db_user'@'%' IDENTIFIED BY "password";
============================================================================================================