Page5 of 42 1 3 4 5 6 7 42
10 07 2012

VPS防止CC攻击

#bigCat.Linux(" Comment.isBlank ")

http://www.zhujima.com/jiaobengongji.html\r\n\r\n\r\n

\r\n#!/bin/bash\r\ncur=`date +%H%M%S`\r\nbecur=`date -d "1 minute ago" +%H%M%S`\r\nbadip=`tail -n 10000 /home/wwwlogs/zhujima.com.log | egrep -v "\.(gif|jpg|jpeg|png|css|js)" | awk  -v a="$becur" -v b="$cur" -F [' ':] '{t=$5$6$7;if (t>=a && t<=b) print $1}' | sort | uniq -c | awk '{if ($1>=20) print $2}'`\r\nif [ ! -z "$badip" ];then\r\nfor ip in $badip;\r\ndo\r\nif test -z "`/sbin/iptables -nL | grep $ip`";then\r\n/sbin/iptables -I INPUT -s $ip -j DROP\r\nfi\r\ndone\r\nfi

\r\n\r\n屏蔽每分钟访问页面超过20的IP,这些页面已经排除图片,css,js等静态文件。\r\n\r\n

\r\n#!/bin/bash\r\nkeyword="cc-atack"\r\nbadip=`tail -n 5000  /home/wwwlogs/zhujima.com.log | grep "$keyword"  | awk '{print $1}' | sort | uniq -c | sort -nr | awk '{print $2}'`\r\nif [ ! -z "$badip" ];then\r\nfor ip in $badip;\r\ndo\r\nif test -z "`/sbin/iptables -nL | grep $ip`";then\r\n/sbin/iptables -I INPUT -s $ip -j DROP\r\nfi\r\ndone\r\nfi

\r\n\r\n关键词屏蔽

4 06 2012

putty openssh server refuse our key

#bigCat.Linux(" Comment.isBlank ")

必须用openssh去创建公钥和私钥\r\n然后用puttygen去转换openssh的私钥为putty的私钥\r\n\r\n\r\n\r\n

cd ~/.ssh\r\nssh-keygen -t rsa \r\ncat id_rsa.pub > authorized_keys\r\nrm -f id_rsa.pub\r\nchmod 400 authorized_keys

\r\n\r\n

22 05 2012

I cannot add a new domain because of existing DNS records

#bigCat.Linux, DataBase(" Comment.isBlank ")

http://kb.parallels.com/en/1364\r\n\r\n\r\nAPPLIES TO:\r\nParallels Plesk Panel\r\nSymptoms\r\nAn attempt at new domain creation fails, and the following error is shown:\r\n\r\nDNS records for domain with such name already exist\r\n\r\nor\r\n\r\nThe subdomain with such name already exists\r\n\r\n\r\nCause\r\nA DNS record for the domain you are trying to add already exists in the Parallels Plesk Panel (PP) database, so a new domain with the same name cannot be added.\r\n\r\nResolution\r\nTry to find a record with a similar name in the DNS settings of the existing domains.\r\n\r\nIf it is difficult to find it manually, you may follow these steps:\r\n\r\n1. Open the "psa" database:\r\nLinux:\r\n# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa\r\n\r\nWindows:\r\nRefer to this article: 3472 [How To] How to access Parallels Plesk Panel database\r\n2. Run the following query to find the DNS record preventing new domain creation (replace YOUR-DOMAIN with the real name of the domain you are trying to create):\r\nLinux:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%YOUR-DOMAIN%';\r\n\r\nWindows:\r\nFor MSSQL and MySQL DB provider:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%YOUR-DOMAIN%';\r\n\r\nFor MS Access DB provider:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '*YOUR-DOMAIN*';\r\n\r\nExample:\r\n\r\nYou try to create a domain called "support.mydomain.com," but the above error appears. The above shell command returns the following output:\r\nmysql> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%support.mydomain.com%';\r\n\r\n+-------------+-----------------------+------+----------------+\r\n| name | host | type | val |\r\n+-------------+-----------------------+------+----------------+\r\n| mydomain.com| support.mydomain.com. | A | 192.168.45.200 |\r\n+-------------+-----------------------+------+----------------+\r\n\r\nYou need to open the corresponding domain (mydomain.com in our example) in the PP Web Interface and examine its DNS zone for the records that contain name of the domain you tried to add. If you want to create the "support.mydomain.com" domain as a separate domain in PP, then the existing record with a similar name has to be removed from the "mydomain.com" DNS zone.\r\n\r\n\r\nAnother possible case:\r\n\r\nA DNS record may exist in the dns_recs table, but have no PP domain associated with it. This may be because of a failed domain removal in the past. You can remove such records directly from the dns_recs table using the below query.\r\n\r\nNote: Make sure you back up the "psa" database modifying it.\r\nLinux:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '%domain.com%';\r\n\r\nWindows:\r\nFor MSSQL and MySQL DB provider:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '%domain.com%';\r\n\r\nFor MS Access DB provider:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '*domain.com*';\r\n

15 05 2012

您没有足够的权限访问这个页面。You are not allowed to edit this page.

#bigCat.WordPress(" Comment.isBlank ")

http://wordpress.org/support/topic/you-are-not-allowed-to-edit-this-page\r\n修改 wp_options > wp_user_roles > option_value 为下面的值\r\n\r\n

a:5:{s:13:"administrator";a:2:{s:4:"name";s:23:"Administrator|User role";s:12:"capabilities";a:51:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;}}s:6:"editor";a:2:{s:4:"name";s:16:"Editor|User role";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:16:"Author|User role";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:21:"Contributor|User role";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:20:"Subscriber|User role";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}
12 12 2011

随手记

#bigCat.NoteBook(" for Comments = 4 ")

\r\n\r\nIntellij IDEA 终于甩出了 11版本,大鲸鱼灰常的形象\r\n想起之前用8的时候是个台球黑8,真乃神器\r\n\r\n这次更新终于把丑陋的界面向DreamWeaver看齐了,毫无悬念的性能提升,虽然再快也不够快\r\n\r\n问题:修改hosts的时候提示\r\n

Cannot save file:\r\nC:\Windows\System32\drivers\\r\n
etc\hosts___jb_bak___ (access denial)

\r\n应该是更改了修改文件的方式,客服5分钟内回复了我说:\r\n

You can workaround it by adding\r\n\r\n-Didea.no.safe.write=true\r\n\r\nin IDEA_HOME\bin\idea.exe.vmoptions file.\r\n\r\n 

\r\n给热爱户外的老爹买了只moto的defy三防Android手机,刷了MIUI,这不得不说是我喜欢到极致的ROM,各种贴心小细节\r\n

1.对老年人有字体设置\r\n2.超精致海量主题\r\n3.短信联系人和通话都有本地化

\r\n 

Page5 of 42 1 3 4 5 6 7 42
Host: (miao) | Word: Press | Code: HTML5