手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2024年11月的文章

保存的一封邮件

这篇日志被加密了,请输入密码后查看。

Wine中文显示

突然发现wine的中文显示其实很简单
从1.1.4开始wine的界面就已经支持中文了,但是对于软件中的中文支持并不太好,主要原因。还是字体。。。
Let's go
首先,copy一下字体:把simsun.ttc (即宋体)复制到 ~/.wine/drive_c/windows/fonts
然后:

XML/HTML代码
  1. [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]  
  2. "Arial"="simsun"  
  3. "Arial CE,238"="simsun"  
  4. "Arial CYR,204"="simsun"  
  5. "Arial Greek,161"="simsun"  
  6. "Arial TUR,162"="simsun"  
  7. "Courier New"="simsun"  
  8. "Courier New CE,238"="simsun"  
  9. "Courier New CYR,204"="simsun"  
  10. "Courier New Greek,161"="simsun"  
  11. "Courier New TUR,162"="simsun"  
  12. "FixedSys"="simsun"  
  13. "Helv"="simsun"  
  14. "Helvetica"="simsun"  
  15. "MS Sans Serif"="simsun"  
  16. "MS Shell Dlg"="simsun"  
  17. "MS Shell Dlg 2"="simsun"  
  18. "System"="simsun"  
  19. "Tahoma"="simsun"  
  20. "Times"="simsun"  
  21. "Times New Roman CE,238"="simsun"  
  22. "Times New Roman CYR,204"="simsun"  
  23. "Times New Roman Greek,161"="simsun"  
  24. "Times New Roman TUR,162"="simsun"  
  25. "Tms Rmn"="simsun"  
当然,你也可以COPY其他字体,然后替换掉这上面的simsun。把这 段内容保存成一个reg文件,例如:fonts.reg
最后,到命令行下支持wine regedit fonts.reg,OK,你现在重新打开记事本,是不是发现可以输入中文了?

Tags: linux, wine, ubuntu, editplus

Good and Bad PHP Code

by Kevin Yank

The following is republished from the Tech Times #165.

When interviewing a PHP developer candidate for a job at SitePoint, there is one question that I almost always ask, because their answer tells me so much about the kind of programmer they are. Here’s the question: “In your mind, what are the differences between good PHP code and bad PHP code?”

The reason I like this question is because it tests more than just a candidate’s encyclopedic knowledge of PHP’s functions. Zend’s PHP certification does a good job of that (as does the test that Yahoo! issues to applicants for its PHP developer jobs, apparently).

Rather, the answer to this question tells me whether a PHP developer has, for example, experienced the pain of working with poorly-written code inherited from a careless predecessor, and whether he or she will go the extra mile to save the rest of the team from that same pain.

I don’t have a set notion of the perfect answer to the question, but I do know the kinds of things I’m hoping to hear. Just off the top of my head:

Good PHP code should be structured. Long chunks of code can be broken up into functions or methods that achieve sub-tasks with simple code, while non-obvious snippets should be commented to make their meaning plain. As much as possible, you should separate frontend HTML/CSS/JavaScript code from the server-side logic of your applications. PHP’s object oriented programming features give you some especially powerful tools to break up your applications into sensible units.

Good PHP code should be consistent. Whether that means setting rules for the names of variables and functions, adopting standard approaches to recurring tasks like database access and error handling, or simply making sure all of your code is indented the same way, consistency makes your code easier for others to read.

Good PHP code should be portable. PHP has a number of features, such as magic quotes and short tags, that can break fragile code when they are switched on or off. If you know what you’re doing, however, you can write code that works by adapting to its environment.

Good PHP code should be secure. While PHP offers excellent performance and flexibility out of the box, it leaves important issues like security entirely in the hands of the developer. A deep understanding of potential security holes like Cross-Site Scripting (XSS), Cross-Site Request Forgeries (CSRF), code injection vulnerabilities, and character encoding loopholes is essential for a professional PHP developer these days.

Once a candidate has answered this question, I usually have a pretty good idea of whether they’ll be hired or not. Of course, there’s always the possibility that an interviewee simply isn’t able to articulate these types of things, so we also have our candidates sit a PHP developer exam.

Many of the questions in this exam seem straightforward on the surface, but they give candidates plenty of opportunity to show how much they care about the little details.

The following “bad” code is a highly simplified example of the sort of thing we might put in our PHP developer exam. The question might be something like “How would you rewrite this code to make it better?”
 
<?php
    echo("<p>Search results for query: " .
        $_GET['query'] . ".</p>");
?>

<?php
    echo("<p>Search results for query: " .     $_GET['query'] . ".</p>");
?>

The main problem in this code is that the user-submitted value ($_GET['query']) is output directly to the page, resulting in a Cross Site Scripting (XSS) vulnerability. But there are plenty of other ways in which it can be improved.

So, what sort of answer are we hoping for?

Good:
 
<?php
     echo("<p>Search results for query: " .
         htmlspecialchars($_GET['query']) . ".</p>");
?>


<?php
    echo("<p>Search results for query: " .
         htmlspecialchars($_GET['query']) . ".</p>");
?>

This is the least we expect. The XSS vulnerability has been remedied using htmlspecialchars to escape dangerous characters in the submitted value.

Better:
 
<?php
     if (isset($_GET['query']))
     {
       echo '<p>Search results for query: ',
           htmlspecialchars($_GET['query'], ENT_QUOTES), '.</p>';
     }
?>


<?php
    if (isset($_GET['query'])) {
        echo '<p>Search results for query: ',
          htmlspecialchars($_GET['query'], ENT_QUOTES), '.</p>';
    }
?>

Now this looks like someone we might want to hire:

    * The “short” opening PHP tag (<?) has been replaced with the more portable (and XML-friendly) <?php form.
    * Before attempting to output the value of $_GET['query'], isset is used to verify that it actually has a value.
    * The unnecessary brackets (()) around the value passed to echo have been removed.
    * Strings are delimited by single quotes instead of double quotes to avoid the performance hit of PHP searching for variables to interpolate within the strings.
    * Rather than using the string concatenation operator (.) to pass a single string to the echo statement, the strings to be output by echo are separated by commas for a tiny performance boost.
    * Passing the ENT_QUOTES argument to htmlspecialchars to ensure that single quotes (') are also escaped isn’t strictly necessary in this case, but it’s a good habit to get into.

Somewhat distressingly, the number of PHP developers looking for work that are able to give a fully satisfactory answer to this sort of question—at least here in Melbourne—are few and far between. We spent a good three months interviewing for this latest position before we found someone with whom we were happy!

So, how would you do when asked a question like this one? Are there any factors that make PHP code good or bad that you feel I’ve left out? And what else would you look for in a PHP developer?

在线破解MD5网站收集

除了http://www.cmd5.com/外,你可以到下面试试

MD5 Reverse Lookup
http://linardy.com/md5.php
Digest-MD5-Reverse-1.3
http://search.cpan.org/~blwood/Digest-MD5-Reverse-1.3/
md5 hash search
http://www.hashchecker.com/index.php?_sls=search_hash
mmkey
http://www.mmkey.com/md5/
Dictionary Based Hash Cracker
http://www.securitystats.com/tools/hashcrack.php

project md5
http://schwett.com/md5/
xmd5
http://www.xmd5.org/index_en.htm
http://www.md5.org.cn/index_en.htm

TMTO[dot]ORG
http://www.tmto.org/home/
md5 rednoize
http://md5.rednoize.com/
MD5 Rainbow
http://passcracking.ru/
Reverse MD5 hash lookup
http://tools.benramsey.com/md5/
md5decrypt
http://www.md5decrypt.com/
md5
http://md5decryption.com/
alimamed
http://alimamed.pp.ru/md5/
md5crack
http://md5crack.it-helpnet.de/index.php?op=add
md5 hash database project
http://shm.hard-core.pl/md5/
Hash Calculator
https://www.astalavista.net/?cmd=rainbowtables
Ice Breaker
http://ice.breaker.free.fr/
md5This
http://www.md5this.com/
MD5 Encryption/Decryption Tool
http://md5.allfact.info/
MD5 Cracker (How safe is your password?)
http://bokehman.com/cracker/
MD5-crack
http://www.tydal.nu/article/md5-crack/

This is the site for Passwords Recovery. MD5 Rainbow Tables are used here.
http://passcracking.com/
http://passcracking.ru/
MD5 :: Reverse engineer your MD5
http://md5.idiobase.de/
The MD5 Collision Database
http://www.md5-db.com/index.php
GData: An Online MD5 Hash Database
http://gdataonline.com/
milw0rm MD5 Cracker
http://www.milw0rm.com/cracker/info.php
milw0rm MD5 checker
https://elitehackers.info/forums/showthread.php?t=5767
原文来自:http://hi.baidu.com/isbx/blog/item/7fcd5d60aa261ad88cb10df6.html
膘叔:其实MD5这东西呀,你可以自己写套程序,把1-0,a-z等一些常用字典遍历一下生成MD5到数据库里,以后自己查起来就方便了。这是最方便的做法,呵呵,在那里跑上个一两天,估计可以跑出几个G的数据了吧?

Tags: md5, online, collect, crack

什么是D2,写在D2参加之后

D2前端技术论坛(Designer & Developer Frontend Technology Forum),简称 D2 ,为国内前端开发者提供一个交流的机会,一起分享技术的乐趣,探讨行业的发展,以技术会友。它是中国所有前端开发者的节日。D2 将努力营造一种轻松自由的交流氛围,没有任何商业色彩,以纯粹的技术交流为根本,共同推动国内前端技术的发展,发掘前端技术可以创造的更大价值。

授课人介绍:

      • 马鉴 (Zerlot Ma, 七月)
        Platform Technology Evangelist
        Adobe
        Blog:www.7yue.com
      • 史珉头像 史珉 (Aspirin)
        高级Flash工程师
        土豆网
      • 王超群头像 王超群
        互联网策略顾问
        微软(中国)有限公司
        Blog:blogs.msdn.com/cqwang
      • 许湛头像 许湛 (Justin)
        前端开发主管
        阿里巴巴(国际站)
        Blog:www.alldone.cn
      • 李戎头像 李戎 (小麦)
        资深前端开发工程师
        土豆网
        Blog:www.mikkolee.com
      • 郑叶飞头像 郑叶飞 (怿飞)
        资深前端开发工程师
        淘宝网
        Blog:www.planabc.net


Tags: d2, taobao, tudou, microsoft, adobe