“软件” 标签页面:

  • 让SSH/SOCKS成为全局代理的软件们(Windows+Linux)

    Windows下的有:

    1. Proxifier 下载地址
    2. ProxyCap 下载地址

    前者比较好用,可控规则较多。我正在使用。

    Linux下的有:

    1. proxychains 下载地址
    2. redsocks 下载地址
    3. tsocks 下载地址

    proxychain功能较多,支持多个代理轮询等;redsocks据说支持android;tsocks配置简单。

     

    proxychains教程

    假设代理为127.0.0.1,端口为7070。我在Ubuntu下安装。

    安装很简单:

    sudo apt-get install proxychains

    配置:

    sudo vi /etc/proxychains.conf

    把最后的“[ProxyList]”部分配置为自己的代理即可:

    socks4  127.0.0.1 7070

    使用方法:

    proxychains <程序名>

    即可让程序使用代理。

     

    redsocks教程

    严格意义上来说,proxychains不算自动的全局代理,有没有像Proxifier这样,开了之后自动让所有启动的程序都走系统代理呢?答案就是redsocks。

    首先安装Ubuntu编译环境和必要的库:

    sudo apt-get install autoconf automake libtool libevent-dev g++

    下载源代码,然后编译安装:

    ./mkauto.sh

    cp redsocks /usr/local/bin/

    配置文件为:

    base {
    // debug: connection progress & client list on SIGUSR1
    log_debug = off;

    // info: start and end of client session
    log_info = off;

    /* possible `log' values are:
    * stderr
    * file:/path/to/file
    * syslog:FACILITY facility is any of "daemon", "local0"..."local7"
    */
    log = "file:/dev/null";
    // log = stderr;
    // log = "file:/path/to/file";
    // log = "syslog:local7";

    // detach from console
    daemon = on;

    /* Change uid, gid and root directory, these options require root
    * privilegies on startup.
    * Note, your chroot may requre /etc/localtime if you write log to syslog.
    * Log is opened before chroot & uid changing.
    */
    // user = nobody;
    // group = nobody;
    // chroot = "/var/chroot";

    /* possible `redirector' values are:
    * iptables - for Linux
    * ipf - for FreeBSD
    * pf - for OpenBSD
    * generic - some generic redirector that MAY work
    */
    redirector = iptables;
    }

    redsocks {
    /* `local_ip' defaults to 127.0.0.1 for security reasons,
    * use 0.0.0.0 if you want to listen on every interface.
    * `local_*' are used as port to redirect to.
    */
    local_ip = 127.0.0.1;
    local_port = 12345;

    // `ip' and `port' are IP and tcp-port of proxy-server
    ip = 127.0.0.1;
    port = 7070;

    // known types: socks4, socks5, http-connect, http-relay
    type = socks5;

    // login = "foobar";
    // password = "baz";
    }

    redudp {
    // `local_ip' should not be 0.0.0.0 as it's also used for outgoing
    // packets that are sent as replies - and it should be fixed
    // if we want NAT to work properly.
    local_ip = 127.0.0.1;
    local_port = 10053;

    // `ip' and `port' of socks5 proxy server.
    ip = 10.0.0.1;
    port = 1080;
    login = username;
    password = pazzw0rd;

    // kernel does not give us this information, so we have to duplicate it
    // in both iptables rules and configuration file. By the way, you can
    // set `local_ip' to 127.45.67.89 if you need more than 65535 ports to
    // forward ;-)
    // This limitation may be relaxed in future versions using contrack-tools.
    dest_ip = 8.8.8.8;
    dest_port = 53;

    udp_timeout = 30;
    udp_timeout_stream = 180;
    }

    dnstc {
    // fake and really dumb DNS server that returns "truncated answer" to
    // every query via UDP, RFC-compliant resolver should repeat same query
    // via TCP in this case.
    local_ip = 127.0.0.1;
    local_port = 5300;
    }

    // you can add more `redsocks' and `redudp' sections if you need.

    这里的配置没有配置udp的代理部分,只是配置了tcp即redsocks部分。监听端口是12345。日志关闭了,因为好像我下载的当前版本无论怎么样都产生一堆调试日志,不知道以后会不会修复这点。

    启动关闭脚本redsocks.sh为(via):

    #! /bin/bash

    SSHHOST=creke
    SSHPORT=22
    SSHUSR=creke
    SSHPWD=creke

    SSHDAEMON=/usr/local/bin/plink
    SSHPIDFILE=/var/run/sshtunnel.pid

    start_ssh()
    {
        echo "Start SSH Tunnel Daemon: "
        start-stop-daemon -b -q -m -p $SSHPIDFILE --exec $SSHDAEMON -S \
        -- -N -D 127.0.0.1:7070 -P $SSHPORT -pw $SSHPWD $SSHUSR@$SSHHOST
        echo "SSH Tunnel Daemon Started."
    }

    stop_ssh()
    {
        #ps aux|grep "ssh -NfD 1234"|awk '{print $2}'|xargs kill
        if [ -f $SSHPIDFILE ]; then
        PID=$(cat $SSHPIDFILE)
        kill $PID
        while [ -d /proc/$PID ];
        do
        sleep 1
        done
        fi
        rm -rf $SSHPIDFILE
        echo "SSH Tunnel Daemon Stoped."
    }

    case "$1" in
      start)
        start_ssh
        cd /usr/local/redsocks
        if [ -e redsocks.log ] ; then
          rm redsocks.log
        fi
        ./redsocks -p /usr/local/redsocks/redsocks.pid #set daemon = on in config file
        # start redirection
        # iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 12345
        # iptables -t nat -A OUTPUT -p tcp --dport 443 -j REDIRECT --to 12345
        # Create new chain
        iptables -t nat -N REDSOCKS

        # Ignore LANs and some other reserved addresses.
        iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
        iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
        iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
        iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
        iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
        iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
        iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
        iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN

        # Anything else should be redirected to port 12345
        iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
        # Any tcp connection should be redirected.
        iptables -t nat -A OUTPUT -p tcp -j REDSOCKS
        ;;

      stop)
        stop_ssh
        cd /usr/local/redsocks
        if [ -e redsocks.pid ]; then
          kill `cat redsocks.pid`
          rm redsocks.pid
        else
          echo already killed, anyway, I will try killall
          killall -9 redsocks
        fi
        # stop redirection
        iptables -t nat -F OUTPUT
        iptables -t nat -F REDSOCKS
        iptables -t nat -X REDSOCKS
        ;;

      start_ssh)
        start_ssh
        ;;

      stop_ssh)
        stop_ssh
        ;;

      clean_dns)
        # iptables -A INPUT -p udp --sport 53 -m state --state ESTABLISHED -m you-know-who -j DROP -m comment --comment "drop you-know-who dns hijacks"
        echo this function not finished
        ;;

      *)
        echo "Usage: redsocks start|stop|start_ssh|stop_ssh|clean_dns" >&2
        exit 3
        ;;
    esac

    iptables的规则是让所有的TCP包都发送到redsocks监听的端口12345。本脚本还整合了ssh的daemon启动,使用start-stop-daemon来实现。

    启动和关闭:

    将启动关闭脚本中的开头的几个变量配置好

    启动命令:sudo ./redsocks.sh start

    关闭命令:sudo ./redsocks.sh stop

    2011.11.09 / 22 条评论 / 43,552 次点击 / 分类: 所谓技术

  • 又一个软件巨人的诞生――甲骨文(Oracle)收购SUN公司(附官方详细公告)

    又一个软件巨人的诞生——甲骨文(Oracle)收购SUN公司
        今天的IT头条:甲骨文收购SUN公司。官方发布的消息:http://www.sun.com/aboutsun/media/presskits/2009-0420/index.jsp
        关于甲骨文(Oracle)和SUN公司的概述(英文):http://www.sun.com/aboutsun/media/presskits/2009-0420/sun_oracle_presentation.pdf
        至此,甲骨文公司已经拥有Oracle+Sun+Bea+PeopleSoft+JD Edwards+Siebel+Primavera等产品,成为又一个软件巨人!
        从今以后,两者究竟如何相存?SUN的两大人气“草根”产品:JAVA和MySQL究竟何去何从。我们继续拭目以待吧!
     
    附:官方详细公告《Oracle to Buy Sun》
    Oracle to Buy Sun
    SANTA CLARA, Calif. April 20, 2009 Sun Microsystems (NASDAQ: JAVA) and Oracle Corporation (NASDAQ: ORCL) announced today they have entered into a definitive agreement under which Oracle will acquire Sun common stock for $9.50 per share in cash. The transaction is valued at approximately $7.4 billion, or $5.6 billion net of Sun's cash and debt.
    "We expect this acquisition to be accretive to Oracle's earnings by at least 15 cents on a non-GAAP basis in the first full year after closing. We estimate that the acquired business will contribute over $1.5 billion to Oracle's non-GAAP operating profit in the first year, increasing to over $2 billion in the second year. This would make the Sun acquisition more profitable in per share contribution in the first year than we had planned for the acquisitions of BEA, PeopleSoft and Siebel combined," said Oracle President Safra Catz.
    "The acquisition of Sun transforms the IT industry, combining best-in-class enterprise software and mission-critical computing systems," said Oracle CEO Larry Ellison. "Oracle will be the only company that can engineer an integrated system - applications to disk - where all the pieces fit and work together so customers do not have to do it themselves. Our customers benefit as their systems integration costs go down while system performance, reliability and security go up."
    There are substantial long-term strategic customer advantages to Oracle owning two key Sun software assets: Java and Solaris. Java is one of the computer industry's best-known brands and most widely deployed technologies, and it is the most important software Oracle has ever acquired. Oracle Fusion Middleware, Oracle's fastest growing business, is built on top of Sun's Java language and software. Oracle can now ensure continued innovation and investment in Java technology for the benefit of customers and the Java community.
    The Sun Solaris operating system is the leading platform for the Oracle database, Oracle's largest business, and has been for a long time. With the acquisition of Sun, Oracle can optimize the Oracle database for some of the unique, high-end features of Solaris. Oracle is as committed as ever to Linux and other open platforms and will continue to support and enhance our strong industry partnerships.
    "Oracle and Sun have been industry pioneers and close partners for more than 20 years," said Sun Chairman Scott McNealy. "This combination is a natural evolution of our relationship and will be an industry-defining event."
    "This is a fantastic day for Sun's customers, developers, partners and employees across the globe, joining forces with the global leader in enterprise software to drive innovation and value across every aspect of the technology marketplace," said Jonathan Schwartz, Sun's CEO, "From the Java platform touching nearly every business system on earth, powering billions of consumers on mobile handsets and consumer electronics, to the convergence of storage, networking and computing driven by the Solaris operating system and Sun's SPARC and x64 systems. Together with Oracle, we'll drive the innovation pipeline to create compelling value to our customer base and the marketplace."
    "Sun is a pioneer in enterprise computing, and this combination recognizes the innovation and customer success the company has achieved. Our largest customers have been asking us to step up to a broader role to reduce complexity, risk and cost by delivering a highly optimized stack based on standards," said Oracle President Charles Phillips. "This transaction will preserve and enhance investments made by our customers, while we continue to work with our partners to provide customers with choice."
    The Board of Directors of Sun Microsystems has unanimously approved the transaction. It is anticipated to close this summer, subject to Sun stockholder approval, certain regulatory approvals and customary closing conditions.
    There will be a conference call today to discuss the transaction at 5:30 a.m. Pacific time. Investors can listen to the conference call by dialing (719) 234-7870, passcode 923645. A replay will be available for 24 hours after the call ends at (719) 884-8882, passcode: 923645. A live audio webcast of the call will be made available at www.oracle.com/investor and a replay will be available for seven days after the call ends.
    About Oracle
    Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. For more information about Oracle, please visit our Web site at http://www.oracle.com.
     
    About Sun Microsystems, Inc.
    Sun Microsystems develops the technologies that power the global marketplace. Guided by a singular vision -- "The Network is the Computer" -- Sun drives network participation through shared innovation, community development and open source leadership. Sun can be found in more than 100 countries and on the Web at http://sun.com.
    Trademarks
    Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
    Sun, Sun Microsystems, the Sun logo, Java, Solaris and the Network is the Computer are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries in the United States and other countries.
    Cautionary Statement Regarding Forward-Looking Statements
    This press release contains certain forward-looking statements within the meaning of Section 27A of the Securities Act of 1933 and Section 21E of the Securities Exchange Act of 1934, including but not limited to, statements regarding Sun's expected contributions to Oracle's earnings and profits, the integration of Sun's product offerings into Oracle's business, the anticipated value of the combined business to customers and partners, and the expected closing of the proposed Merger. These forward-looking statements involve certain risks and uncertainties that could cause actual results to differ materially from those indicated in such forward-looking statements, including, but not limited to, the ability of the parties to consummate the proposed Merger, satisfaction of closing conditions precedent to the consummation of the proposed Merger, the ability of Oracle to successfully integrate Sun's operations and employees, the ability to realize anticipated synergies and cost savings of the proposed Merger, and such other risks as identified in Oracle's Annual Report on Form 10-K for the fiscal year ended May 31, 2008, Oracle's most recent Quarterly Reports on Form 10-Q, Sun's Annual Report on Form 10-K for the fiscal yea
    r ended June 30, 2008, and Sun's most recent Quarterly Reports on Form 10-Q, each as filed with the SEC, which contain and identify important factors that could cause the actual results to differ materially from those contained in the forward-looking statements. Oracle and Sun assume no obligation to update any forward-looking statement contained in this press release.
    Additional Information about the Merger and Where to Find It
    Sun plans to file with the Securities and Exchange Commission (the "SEC") and mail to its stockholders a proxy statement in connection with the proposed merger with Soda Acquisition Corporation, pursuant to which Sun would be acquired by Oracle (the "Merger"). The proxy statement will contain important information about the proposed Merger and related matters. INVESTORS AND STOCKHOLDERS ARE URGED TO READ THE PROXY STATEMENT CAREFULLY WHEN IT BECOMES AVAILABLE. Investors and stockholders will be able to obtain free copies of the proxy statement and other documents filed with the SEC by Sun through the web site maintained by the SEC at www.sec.gov. In addition, investors and stockholders will be able to obtain free copies of the proxy statement from Sun by contacting Investor Relations by telephone at (800) 801-7869 (within the U.S.) or (408) 404-8427 (outside the U.S.), or by mail at Sun Microsystems, Inc., Investor Relations, Mail Stop UMPK14-336, 4150 Network Circle, Santa Clara, California 95054, USA.
    Sun and its directors and executive officers may be deemed to be participants in the solicitation of proxies from the stockholders of Sun in connection with the proposed Merger. Information regarding the interests of these directors and executive officers in the transaction described herein will be included in the proxy statement described above. Additional information regarding these directors and executive officers is also included in Sun's proxy statement for its 2008 Annual Meeting of Stockholders, which was filed with the SEC on September 24, 2008. This document is available free of charge at the SEC's web site at www.sec.gov, and from Sun by contacting Investor Relations by telephone at (800) 801-7869 (within the U.S.) or (408) 404-8427 (outside the U.S.), or by mail at Sun Microsystems, Inc., Mail Stop UMPK14-336, 4150 Network Circle, Santa Clara, California 95054, USA, or by going to Sun's Investor Relations page on its corporate web site at www.sun.com.
     

    2009.04.20 / 暂无评论 / 1,426 次点击 / 分类: 随心随感

  • 我的软件安装使用原则

     我的软件安装使用原则
        我早在几个月前就想安装IIS玩了,只不过由于在学校(寄宿学校)念书的原因一直没有空。今天是正式放假的日子,终于可以着手研究IIS了。
        本文可以说是本人研究IIS的一个副产品,略谈一下我安装和使用软件的一些原则。
        其实我的原则概括起来就是“两化”和“两随”(看多新闻联播了,呵呵)。“两化”指的是“绿色化”和“无毒化”;“两随”就是“随心随用”。
        下面分别解释一下听起来挺玄乎的原则。
        绿色化,在一个方面指的是软件在安装和使用时不会制造出太多的系统垃圾,如不会向注册表里加入N多注册键值,不会在系统目录或者用户目录内生成N多文件,不会在系统中注册N多控件等。本人就不是很喜欢VB编写的程序,安装时有一大堆DLL和OCX要塞进系统目录,装后还要对他们进行Regsvr注册,心里的感觉只能用“不爽”二字概括之。如果“绿色化”这一方面的解释让你怀疑我有洁癖的嫌疑的话,那么它的另一方面的解释你应该会同意。着另一方面的解释就是软件不用依存安装及安装后的系统或注册表等配置信息即可运行。其实说得通俗一点就是我们现在常说的绿色软件或准绿色软件,即安装一个软件后,把它的程序拷贝到另一部没装此软件的电脑,软件仍能正常运行,则所谓之绿色或准绿色。
        无害化,它的解释是,一个软件在使用上不会给系统造成运行不稳定、用户隐私泄露等危害;还有另外一点,这点不知道从什么时候开始被人们无意中坚守着,那就是,在安装过程中不会强加安装各种浏览器插件、广告程序,不会胡乱修改用户的电脑的设置。想当年,3721上网助手捆绑在大大小小的软件中,以至于有一段时间3721公司还自豪地宣布“中国每十台电脑就有4台装有上网助手”,有点基础的用户们大概便是从这时起开始慢慢认清这个所谓“免费午餐”的真实面目,慢慢地坚守起这“无害化”第二条原则吧。
        “随心随用”中的“随心”就是说,一个软件要设计的人性化,要符合用户的使用习惯,如果你使用一个软件要适时顾虑到软件制作者的种种规定和操作,这种软件,能丢就丢掉吧;“随意”是说软件安装后用到它是它才启动,不用到时就乖乖地躺在硬盘里,一般的软件就别自作多情让自己随系统启动。当然,防火墙和杀毒软件这类的软件就不“一般”了,当然要随系统启动而启动,况且我们也“一般”都是系统启动就用到它们的,哈哈。
        其实在使用软件时还有一个最基本的原则凌驾于此“两化”“两随”上,那就是“具体问题具体分析”,灵活运用才是使用软件的最基础。  

    2006.01.20 / 暂无评论 / 1,113 次点击 / 分类: 所谓技术