发布于2011的文章

Oct 30

SRS HD Audio Lab Gold 和 SRS Audio Essentials 都是 SRS Audio SandBox 的升级版本,主要增强了界面体验(更酷?),添加了 Windows7 x64 的支持,已经更多更好的音效。基本的介绍可以参照本站以前的文章:Volume Logic and SRS Audio Sandbox,新增得功能有:

音效:
SRS WOW HD – 提升压缩和未压缩音频性能,能在水平位置与垂直位置创造声场深度,并增强低音相应。
SRS TruSurround XT – 多声道音源传输为两声道立体声环境时提供逼真的环绕声体验。
SRS Circle Surround II – 混合立体声或单声道音源输出为5.1或6.1甚至7.1环境并具备环绕音频效果。
SRS Headphone 360 – 为耳机提供真实的5.1环绕声体验。

高级音频性能
SRS 3D – 为单声道或是立体声环境提供3D环境音效。
SRS 3D Center Control – 一个虚拟化的动态空间以聆听测试前景声与背景声混合效果。
SRS TruBass – 低音混合效果
SRS FOCUS – 为压缩音源提供扬声器输出优化
SRS Definition – 传递更具现场感更生动的声音效果。
SRS Dialog Clarity – 使电影或是视频中的声乐表现更加生动清晰。

笔记本电脑由于空间限制,使用 SRS 系列软件可以获得不错的效果。

SRS HD Audio Lab Gold 破解方法:解压安装,用压缩包内 HDAL.exe 文件覆盖安装目录内的原文件即可;

SRS Audio Essentials 破解方法:解压安装,在系统“服务”中停止 SRSHDAudioService 这个服务,运行 Patch.exe ,选择

* %ProgramFiles%\SRS Audio Essentials\AudioEssentials.exe
* %ProgramFiles%\Common Files\SRS Labs\DSP Proxy\SRSDSPProxy.dll

这两个文件,分别破解。注意, Windows7 x64 版本只需要破解 AudioEssentials.exe 。



Oct 23

这个脚本功能很简单,如果你有境外 PHP 主机空间,利用这个脚本可以查询到被 DNS 污染的一些站点的真实 IP 。缓存的结果可以直接拷贝到系统 Hosts 文件中使用,也可以转换为 Unbound 的 localzone 格式供 Unbound 调用。hosts.txt 中包含需要查询的站点主机名,一行一个,ipcache.txt 则为查询结果缓存文件,标准的 Windows 系统 Hosts 文件格式。

可以到本站: gethosts 页面体验效果。


<?php
/**
 * gethosts
 *
 * @link       https://www.quakemachinex.com/gethosts/
 * @copyright  Copyright (c) 2011 AvP
 * @license    MIT Style License
 * @version    1.0
 */

$hostsLock = true; //用户提交的查询数据是否写入 hosts.txt,默认:不写入

$isPost = false;

if (isset($_POST['hosts'])){
    $hosts_txt = $_POST['hosts'];
    $isPost = true;
	if (!$hostsLock) file_put_contents('hosts.txt',$hosts_txt);
} else {
	$hosts_txt = file_get_contents('hosts.txt');
}
$hosts_array = preg_split('/[\s,]+/', $hosts_txt, -1, PREG_SPLIT_NO_EMPTY);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>gethosts</title>
<script src="ZeroClipboard.js" type="text/javascript"></script>
<script type="text/javascript">
//类似 PHP 中的 trim
    function trim(str) {
        var str = str.replace(/^\s\s*/, ''),
            ws = /\s/,
            i = str.length;
        while (ws.test(str.charAt(--i)));
        return str.slice(0, i + 1);
    }
//基于 ZeroClipboard 的跨浏览器复制到剪贴板
    function ctoc() {
        var txt = document.getElementById('hostsMap').value;

        if (window.clipboardData) {
            window.clipboardData.setData("text", txt);
            alert("Copied text to clipboard:\n" + txt);
        } else {
            var clip = new ZeroClipboard.Client();
            clip.glue('clickme');
            clip.setText(txt);
            clip.addEventListener('complete', function(client, text) {
                alert("Copied text to clipboard:\n" + text);
            });
            }
    }
//转换 Hosts 文件格式到 Unbound 的 localzone 格式
    function htol() {
        var i;
        var localz = new Array();
        var hosts = document.getElementById('hostsMap').value;
        var localzs='';
        hostdomain = hosts.split("\n");
        for (i=0;i<hostdomain.length;i++) {
            if (trim(hostdomain[i]) != '') {
                localz[i] = hostdomain[i].split("\t");
                localzs += 'local-data: "'+localz[i][1]+' A '+localz[i][0]+'"\n';
            }
        }
        document.getElementById('hostsMap').value = localzs;
    }
</script>
</head>
<body>
<?php
//判定字符串是否是 IP 地址
function IsIPAdress($value){

    if (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $value)){
        return true;
    }
    return false;
}
//获取真实 IP,并且缓存,用户提交数据不缓存
function getRealIP(){
    global $hosts_array, $isPost;
    if($isPost) {
        foreach($hosts_array as $hostname){
            $ip = gethostbyname($hostname);
            if (IsIPAdress($ip)) {
                $i = $i + 1;
                echo "$ip\t$hostname";
                echo "\n";
                if ($i > 25) return;
            }
        }
    } else {
        $cache_days = 1; //缓存多少天
        $fz = filesize('ipcache.txt');
        $ipcache_create_time = filectime('ipcache.txt');
        $time_now = date("Y-m-d H:i:s");
        $ipcache_stay_days = (strtotime($time_now)-strtotime(date("Y-m-d H:i:s",$ipcache_create_time)))/86400;
        $ipcache_stay_days = floor($ipcache_stay_days);

        if ($fz && $fz != 0 && $ipcache_stay_days < $cache_days) {
            $ipcache = file_get_contents('ipcache.txt');
            echo $ipcache;
         } else {
            foreach($hosts_array as $hostname){
                $ip = gethostbyname($hostname);
                if (IsIPAdress($ip)) {
                    $ipcacheall .= "$ip\t$hostname\n";
                }
            }
            $local_ipcache = 'ipcache.txt';
            $local_ipcache_actual = fopen($local_ipcache, 'w+');
            fwrite($local_ipcache_actual, $ipcacheall);
            fclose($local_ipcache_actual);
            $ipcache = file_get_contents('ipcache.txt');
            echo $ipcache;
         }
     }
}
?>
    <div style="width:1024px; margin:0 auto;">
        <div style="float:left;margin:0 10px;">
            <h2>Blocked Hostnames</h2>
            <form method="post">
                <button type="submit" style="margin: 5px auto; display: block;">Get Hosts</button>
                <textarea name="hosts" style="width:400px;height:550px;margin:0;padding:3px;display:block;"><?php echo $hosts_txt;?></textarea>
            </form>
        </div>
        <div style="float:left;margin:0 10px;">
            <h2>hosts</h2>
            <div style="margin: 5px auto; display: block;">
            <button type="button" id="clickme" onclick="ctoc();">CopyToClipboard(Click Twice!)</button>
            <button type="button" id="hosttolocal" onclick="htol();">ConventerToLocalzone</button>
            </div>
            <textarea id="hostsMap" onclick="this.focus();this.select()"style="width:500px;height:550px;margin:0;padding:3px;display:block;"><?php getRealIP(); ?></textarea>
        </div>
    </div>
</body>
</html>

ZeroClipboard 可到官方下载。 :!:


Oct 23

ClipXNewIcon

ClipX 是一款轻巧的剪贴板增强软件,使用介绍请参照 剪切板增强软件 ClipX 使用介绍

官方的 x64 版本界面控件不能显示 XP 式样,发现是 Manifest 没有正确按照 x64 (Windows7,Vista)版本描述的缘故,这个做了更改。顺便把软件自带的图标全部换成了真彩的,有 28 种可选,并且停靠在任务栏的图标也正确调用 32x32 大小的图标了。

顺便记录下标准的 x64 执行文件 manifest 内容:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    name="ClipX"
    processorArchitecture="*"
    version="1.0.3.9"
    type="win32"
  />
  <description>ClipX is a tiny clipboard history manager</description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df"
        language="*"
      />
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"
        />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
    </application>
  </compatibility>
  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <asmv3:windowsSettings
         xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

Tags: , , ,

Oct 10

Dimensions 2 Folders 可以基于图片的分辨率来组织图片,将相同分辨率或者自定义分辨率的图片放入各自的目录中,在某些情况下非常实用。

主要特点:

递归扫描,可以扫描子目录;
自定义目录分隔符, 例如: 800x600, 800 x 600, 800X600, 800$600 等;
三种排序组织方式.

下载可以去官方站点,有免安装版本。


Sep 25

Google 提供了一个获取站点 favicon 的服务:

http://www.google.com/s2/favicons?domain=

但是天朝,Google 不稳定,所以需要把这些站点图标缓存到本地,以下:


//从URL中提取域名函数
function get_domain($url) {
/*
Author : Ayush
URL : http://Webgarb.com
*/
    $url = explode('/', str_replace('www.', '', str_replace('http://', '', $url)));
    return $url[0];
}

function getFavicon($var){
    $cache_days = 30; //图标缓存多少天
    $linkdomain = get_domain($var);
    $favicon_cache_dir = ABSPATH.'wp-content'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'favicon_cache';
    $favicon_url = 'https://www.quakemachinex.com/blog/wp-content/plugins/favicon_cache/'.$linkdomain.'.png';
    $fp = fopen ($favicon_cache_dir.'/'.$linkdomain.'.png', 'r');
    $favicon_create_time = filectime($favicon_cache_dir.'/'.$linkdomain.'.png');
    $time_now = date("Y-m-d H:i:s");
    $favicon_stay_days = (strtotime($time_now)-strtotime(date("Y-m-d H:i:s",$favicon_create_time)))/86400;
    $favicon_stay_days = floor($favicon_stay_days);

    if ($fp && $favicon_stay_days < $cache_days) {
        return $favicon_url;
     } else {
        $remote_favicon = file_get_contents('http://www.google.com/s2/favicons?domain='.$linkdomain);
        $local_favicon = $favicon_cache_dir.'/'.$linkdomain.'.png';
        $local_favicon_actual = fopen($local_favicon, 'w+');
	fwrite($local_favicon_actual, $remote_favicon);
	fclose($local_favicon_actual);
        return $favicon_url;
     }

}

把这个函数引用到友情链接或者 BlogRoll 都行,可以参见本站效果。


[5/10]  < 1 2 3 4 5 6 7 8 9 10 >