Soft&Skills

Password

2013-07-16. Category & Tags: Soft&Skills Soft&Skills

Many people have the problem of memorizing passwords in different web sites, so they decided to use one password for all the web sites. But the risk is obvious, if a hacker could get one of your accounts, it means all your accounts, maybe even your online bank. Then one may try use different passwords for different sites … It becomes a vicious circle … Here are some tips which you could use to generate your passwords. ...

Iptables In Case of

2013-07-14. Category & Tags: Soft&Skills Soft&Skills

Read First ! # 用一个实例深入理解 iptables 的 SNAT/DNAT, bak iptables 详解 (理论+一些常用规则) Chain 顺序 # 入站顺序:PREROUTING→INPUT 出站顺序:OUTPUT→POSTROUTING 转发顺序:PREROUTING→FORWARD→POSTROUTING ref1: cnblog; ref2 Linux iptables 用法与 NAT, ref: //翻译的比较差或者自动翻译,有些东西顺序不对 ACCEPT vs. DROP vs. REJECT # 1、ACCEPT 一旦包满足了指定的匹配条件,就会被 ACCEPT,并且不会再去匹配当前链中的其他规则或同一个表内的其他规则,但它还要通过其他表中的链。 2、DROP 如果包符合条件,这个 target 就会把它丢掉,也就是说包的生命到此结束,不会再向前走一步,效果就是包被阻塞了。 在某些情况下,这个 target 会引起意外的结果,因为它不会向发送者返回任何信息,也不会向路由器返回信息,这就可能会使连接的另一方的 sockets 因苦等回音而亡。 解决这个问题的较好的办法是使用 REJECT(因为它在丢弃包的同时还会向发送者返回一个错误信息,这样另一方就能正常结束),尤其是在阻止端口扫描工具获得更多的信息时,可以隐蔽被过滤掉的端口等等(因为扫描工具扫描一个端口时,如果没有返回信息,一般会认为端口未打开或被防火墙等设备过滤掉了)。 还要注意如果包在子链中被 DROP 了,那么它在主链里也不会再继续前进,不管是在当前的表还是在其他表里。 3、REJECT REJECT 和 DROP 基本一样,区别在于它除了阻塞包之外,还向发送者返回错误信息。 现在,此 target 还只能用在 INPUT、FORWARD、OUTPUT 和它们的子链里,而且包含 REJECT 的链也只能被它们调用,否则不能发挥作用。 它只有一个选项,是用来控制返回的错误信息的种类的。 ref: iptables ACCEPT DROP REJECT 说明 ...

wordpress

2013-07-14. Category & Tags: Soft&Skills Soft&Skills

WordPress 主题如何设置多语言支持: PoEdit # http://www.yaohaixiao.com/wordpress/wordpress-theme-is-how-to-set-up-a-multi-language-support/ 移动网站 / 修改网站路径 / 去掉URL路径中多余层级的目录 # eg: http://xxx.local/wordpress/mywebsite/index.php => http://xxx.local/ Step 1. setup vhost for apache, setup system host file for local domain. # NameVirtualHost *:80 <VirtualHost *:80> ServerName xxx.local DocumentRoot "c:\path\to\wordpress\mywebsitefiles" <Directory "c:\path\to\wordpress\mywebsitefiles"> DirectoryIndex index.php index2.php index.html AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> Step 2. modify db # After reading http://codex.wordpress.org/Moving_WordPress , I found only siteurl in the wp_options table. ...

诡异的数据库 trouble shooting

2013-07-11. Category & Tags: Soft&amp;Skills Soft&amp;Skills

1. ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable) http://dev.mysql.com/doc/refman/5.0/en/stored-programs-logging.html **`SET GLOBAL log_bin_trust_function_creators = 1; `** 用完改回来. 2. 生成的备份sql在drop event 没有 if exist 导致出错.手动添加(利用替换). 3. Procedure 里的 LIMIT 在 v5.5.6之前不能使用变量做参数. ERROR 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘row_count ; END’ at line 24 ...

snmp, mib & rrdtool, mrtg, cacti

2013-06-09. Category & Tags: Soft&amp;Skills Soft&amp;Skills

apt-get install snmp-mibs-downloader && download-mibs; apt-get install rrdtool mrtg cacti; Install & Config SNMP # etc….. RRDtool basic tutorial # http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html MRTG - How To # http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/ mini how-to (old): http://www.geocities.com/rjayasin/RH7X-mrtg-howto.htm Cacti - Important templates # 1. Apache stats Template: http://forums.cacti.net/about9861.html , useful for web server; 2. MySQL Stats Template: http://forums.cacti.net/about11010.html ; 3. Graph templates for Squid: http://forums.cacti.net/about4142.html ; 4. Windows uptime statistics: http://forums.cacti.net/about10514.html ; More: http://forums.cacti.net/viewtopic.php?t=15067 . Trouble Shooting # #snmpwalk -v 2c -c public localhost . ...

一个时区引发的血案 [timezone] [ubuntu] [cacti]

2013-06-08. Category & Tags: Leading, Soft&amp;Skills Leading, Soft&amp;Skills

拿cacti试着玩,和mrtg一起装的。 第一天(昨天)装上就睡觉了,今天起来接着玩。 发现自己新建的数据所产生的图表和rrd文件显示不出来数据,总是 NaN, copy其他已经有的文件替换新文件就可以显示,当然,数据还是老文件的。 然后,发现copy的rrd文件生成的图和原rrd一致,即使过了半小时也是一样的,难道从同一个数据源获取的信息被写到不同的rrd文件?md5检查证明这个想法是错误的。 还有个很诡异的问题,早晨我特地用bc算了一个很大的数,但是他显示的cpu load最高的时候却是在中午,我都怀疑有人在我吃饭的时候黑了我的服务器? 把cacti的dev模式打开,详细检查log。没发现任何报错,update的rrd文件也没报错。我汗~~~灵异事件。。。 突然发现写入rrd文件的时间戳貌似和生成图表用的时间戳存在巨大差异,一对比,差4小时~!!! 然后就想起来给这台服务器刚换过时区,应该是这个问题了。看来只替换时区文件是不行的 。。。 所以我: dpkg-reconfigure tzdata && reboot 。。。 很难说清到底哪些程序需要重启,干脆整机重启吧,几秒的事儿~ //win server 就2了,几分钟起来就不错了。 这里还有另一篇文章:(我没试过) http://www.wikihow.com/Change-the-Timezone-in-Linux

Vim In Case Of

2013-05-01. Category & Tags: Soft&amp;Skills Soft&amp;Skills

Language Support # scala # mkdir -p ~/.vim/{ftdetect,indent,syntax} && \ for d in ftdetect indent syntax ; && \ do wget -O ~/.vim/$d/scala.vim https://raw.githubusercontent.com/derekwyatt/vim-scala/master/$d/scala.vim; && \ done ref Fold # zr //unfold one level zR //unfold all levels zm //fold one level zM //fold all levels Buffer # See also ‘vim 只删除,不剪切’.2/16/13434/).