下载游戏:《古墓丽影9》中文免安装绿色豪华硬盘版[1.1.732.1升级档][解压即玩] 光压缩包所有分卷加起来就有快10个G 结果用QQ旋风下载下来后成乱序的了 然后到网站上一看发现QQ旋风本身就把链接那些顺序没搞对。 参考下载地址:Tomb.Raider.9.v1.1.732.1.CHS.Green.Edition

自己根据使用7-zip打开压缩包的“之前分割”和“之后分割”信息拼凑了半天,结果还是有一个文件“bigfile.001.tiger”不能成功解压。最终放弃。

结果在网上搜索了半天,竟然发现“360压缩”竟然宣称自己可以修复。

原文在:http://yasuo.360.cn/update.html

1.6正式版(2011-5-26)
  1.智能压缩方式,360压缩支持智能极速、强力压缩、标准压缩等压缩方式。智能压缩根据文件智能选择压缩算法,大幅提升压缩速度。
  2.多种格式支持,支持解压rar、zip、7z、iso等39种格式的压缩文件。
  3.解压速度更快,采用多线程解压处理,优化了解压逻辑,速度更快。
  4.损坏格式兼容,对格式头有损坏的压缩包一样修复解压。
* 5.分卷压缩智能解压,智能判断解压rar分卷包时的文件夹名乱序问题。
  6.更安全的压缩软件,内含360云安全引擎,对压缩包内木马进行检测,更安全。
  7.不断完善的细节体验,支持跳转到桌面、自动消重文件夹等20多处相对传统压缩软件的细节功能改进。

抱着尝试的心态,下载了一个最新版的安装上尝试后。发现真的正常解压了所有压缩包。 总算是解决了目前的尴尬问题,所以在此留文提醒有遇到跟我同样问题的朋友。

成功解压版本:360zip_beta_3.1.0.1071

如果socket想使用HTTP代理,需要进行下面步骤:

  1. connect到代理服务器
  2. send(Format(“CONNECT %s:%s HTTP/1.1rnUser-Agent: MyApp/0.1rnrn”, <真正目标IP>, <真正目标端口>)
  3. recv 数据,并且根据数据内容判断CONNECT协议是否成功(是否有返回"HTTP/1.1 200")
  4. 如果第3步成功了,那么这个socket就已经是通过HTTP代理来连接的了,剩下的该怎么发包收包都照旧了

错误1

error LNK2019: unresolved external symbol _deflateEnd@4

原因1: 未使用zlib的链接库

  • 解决:
#pragma comment(lib, "zlibstat.lib") // for static lib
#pragma comment(lib, "zdll.lib") // for dll lib

原因2:在使用静态库时即使包含了zlibstat.lib没有定义宏“ZLIB_WINAPI”

  • 解决: 在项目属性中 C/C++ -> Preprocessor -> Preprocessor Definitions 添加“ZLIB_WINAPI” 注意:这个必须在项目中添加,使用#define来添加是无效的。

错误2

error LNK2026: module unsafe for SAFESEH image

原因:两个项目SAFESEH设置不同

  • 解决: 设置项目属性: Linker -> Advanced -> [Image Has Safe Exception Handlers] = “No” 注意:这个必须在项目中添加,使用#pragma来添加是无效的。

错误3

error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj)或类似其他的error LNK2005:

原因:与libcmt库冲突了

  • 解决:
#pragma comment(linker, "/NODEFAULTLIB:libcmt.lib")

概要

有六种类型的可重用的库:

静态单线程库 (调试/发行版) 静态多线程的库 (调试/发行版) 动态链接库 (DLL)(Debug/Release) 注意每个库都有一个调试版本和发布版本。

Reusable Library            Switch    Library    Macro(s) Defined
--------------------------- --------- ---------- ----------------------
Single Threaded             /ML       LIBC       (none)
Static MultiThread          /MT       LIBCMT     _MT
Dynamic Link (DLL)          /MD       MSVCRT     _MT and _DLL
Debug Single Threaded       /MLd      LIBCD      _DEBUG
Debug Static MultiThread    /MTd      LIBCMTD    _DEBUG and _MT
Debug Dynamic Link (DLL)    /MDd      MSVCRTD    _DEBUG, _MT, and _DLL

下面的代码可以使用可重用库的头文件中以确保一致使用正确的编译器开关:

// MyReusableStaticSingleThreadReleaseLibrary.h
#if defined(_MT) || defined(_DEBUG)
    #error The /ML compiler switch is required.
#endif

// MyReusableStaticMultithreadReleaseLibrary.h
#if !defined(_MT) || defined(_DLL) || defined(_DEBUG)
    #error The /MT compiler switch is required.
#endif

// MyReusableDynamicLinkReleaseLibrary.h
#if !defined(_MT) || !defined(_DLL) || defined(_DEBUG)
    #error The /MD compiler switch is required.
#endif

// MyReusableStaticSingleThreadDebugLibrary.h
#if defined(_MT) || !defined(_DEBUG)
    #error The /MLd compiler switch is required.
#endif

// MyReusableStaticMultithreadDebugLibrary.h
#if !defined(_MT) || defined(_DLL) || !defined(_DEBUG)
    #error The /MTd compiler switch is required.
#endif

// MyReusableDynamicLinkDebugLibrary.h
#if !defined(_MT) || !defined(_DLL) || !defined(_DEBUG)
    #error The /MDd compiler switch is required.
#endif

原文:http://support.microsoft.com/kb/140584/zh-cn

在SSH连接后执行下面命令:

export LANG=en_US
export LC_ALL=en_US

不过上面的修改只是临时的,仅这一次连接有效。等到下次再连接的时候,又得重新调用。所以可以采用下面永久解决这个问题:

echo 'LANG="en_US.UTF-8"  
LANGUAGE="en_US:en"' > /etc/default/locale

通过终端(terminal)命令安装

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

通过解压官网安装包安装

  1. 将下载的tar.bz2文件解压
tar xf Sublime Text 2.0.1 x64.tar.bz2
  1. 将解压后的文件夹移动到应用程序文件夹
sudo mv Sublime Text 2 /opt/
  1. 设置terminal快速启动命令
sudo ln -s /opt/Sublime Text 2/sublime_text /usr/bin/sublime
  1. 在桌面创建快捷方式
sudo sublime /usr/share/applications/sublime.desktop
  1. 将下面的代码保存进去
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=sublime
Terminal=false
Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.webp
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n
TargetEnvironment=Unity

貌似安装sublime3的时候会自动创建快速启动命令,所以如果安装的是3就不用再手动设置了

摘抄自原文:http://my.oschina.net/rc6688/blog/162043#OSC_h2_4

如何安装kernel-devel,可以参考我之前的文章:《Linux下编译驱动发现没有内核源码的解决办法》

下面是我写的一个自动脚本:

cd /usr/src/kernels
cd $(ls -d */ | head -n 1)
ln -s -f $(pwd) /lib/modules/$(uname -r)/build

至于为什么要费劲去 *cd $(ls -d / | head -n 1) 的原因是:很多系统装出来的 kernel-devel 目录名称跟 $(uname -r) 并不一致

至此这个问题修复完成。

在Linux 2.6.33.6中,源文件在:/usr/src/kernels/2.6.33.6/include/linux/skbuff.h

struct sk_buff在2.6.18中的定义:

struct sk_buff {
        /* These two members must be first. */
        struct sk_buff          *next;
        struct sk_buff          *prev;

        struct sock             *sk;
        struct skb_timeval      tstamp;
        struct net_device       *dev;
        struct net_device       *input_dev;

        union {
                struct tcphdr   *th;
                struct udphdr   *uh;
                struct icmphdr  *icmph;
                struct igmphdr  *igmph;
                struct iphdr    *ipiph;
                struct ipv6hdr  *ipv6h;
                unsigned char   *raw;
        } h;

        union {
                struct iphdr    *iph;
                struct ipv6hdr  *ipv6h;
                struct arphdr   *arph;
                unsigned char   *raw;
        } nh;

        union {
                unsigned char   *raw;
        } mac;

        struct  dst_entry       *dst;
        struct  sec_path        *sp;
        /*
         * This is the control buffer. It is free to use for every
         * layer. Please put your private variables there. If you
         * want to keep them across layers you have to do a skb_clone()
         * first. This is owned by whoever has the skb queued ATM.
         */
        char                    cb[48];

        unsigned int            len,
                                data_len,
                                mac_len,
                                csum;
        __u32                   priority;
        __u8                    local_df:1,
                                cloned:1,
                                ip_summed:2,
                                nohdr:1,
                                nfctinfo:3;
        __u8                    pkt_type:3,
                                fclone:2,
#ifndef CONFIG_XEN
                                ipvs_property:1;
#else
                                ipvs_property:1,
                                proto_data_valid:1,
                                proto_csum_blank:1;
#endif
        __be16                  protocol;

        void                    (*destructor)(struct sk_buff *skb);
#ifdef CONFIG_NETFILTER
        struct nf_conntrack     *nfct;
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
       struct sk_buff          *nfct_reasm;
#endif
#ifdef CONFIG_BRIDGE_NETFILTER
        struct nf_bridge_info   *nf_bridge;
#endif
        __u32                   nfmark;
#endif /* CONFIG_NETFILTER */
#ifdef CONFIG_NET_SCHED
        __u16                   tc_index;       /* traffic control index */
#ifdef CONFIG_NET_CLS_ACT
        __u16                   tc_verd;        /* traffic control verdict */
#endif
#endif
#ifdef CONFIG_NET_DMA
        dma_cookie_t            dma_cookie;
#endif
#ifdef CONFIG_NETWORK_SECMARK
        __u32                   secmark;
#endif

        /* These elements must be at the end, see alloc_skb() for details.  */
        unsigned int            truesize;
        atomic_t                users;
        unsigned char           *head,
                                *data,
                                *tail,
                                *end;
        /* Extra stuff at the end to avoid breaking abi */
#ifndef __GENKSYMS__
        int                      peeked;
#endif
};

struct sk_buff在2.6.33中的定义:

struct sk_buff {
        /* These two members must be first. */
        struct sk_buff          *next;
        struct sk_buff          *prev;

        ktime_t                 tstamp;

        struct sock             *sk;
        struct net_device       *dev;

        /*
         * This is the control buffer. It is free to use for every
         * layer. Please put your private variables there. If you
         * want to keep them across layers you have to do a skb_clone()
         * first. This is owned by whoever has the skb queued ATM.
         */
        char                    cb[48] __aligned(8);

        unsigned long           _skb_dst;
#ifdef CONFIG_XFRM
        struct  sec_path        *sp;
#endif
        unsigned int            len,
                                data_len;
        __u16                   mac_len,
                                hdr_len;
        union {
                __wsum          csum;
                struct {
                        __u16   csum_start;
                        __u16   csum_offset;
                };
        };
        __u32                   priority;
        kmemcheck_bitfield_begin(flags1);
        __u8                    local_df:1,
                                cloned:1,
                                ip_summed:2,
                                nohdr:1,
                                nfctinfo:3;
        __u8                    pkt_type:3,
                                fclone:2,
                                ipvs_property:1,
                                peeked:1,
                                nf_trace:1;
        __be16                  protocol:16;
        kmemcheck_bitfield_end(flags1);

        void                    (*destructor)(struct sk_buff *skb);
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        struct nf_conntrack     *nfct;
        struct sk_buff          *nfct_reasm;
#endif
#ifdef CONFIG_BRIDGE_NETFILTER
        struct nf_bridge_info   *nf_bridge;
#endif

        int                     skb_iif;
#ifdef CONFIG_NET_SCHED
        __u16                   tc_index;       /* traffic control index */
#ifdef CONFIG_NET_CLS_ACT
        __u16                   tc_verd;        /* traffic control verdict */
#endif
#endif

        kmemcheck_bitfield_begin(flags2);
        __u16                   queue_mapping:16;
#ifdef CONFIG_IPV6_NDISC_NODETYPE
        __u8                    ndisc_nodetype:2;
#endif
        kmemcheck_bitfield_end(flags2);

        /* 0/14 bit hole */

#ifdef CONFIG_NET_DMA
        dma_cookie_t            dma_cookie;
#endif
#ifdef CONFIG_NETWORK_SECMARK
        __u32                   secmark;
#endif
        union {
                __u32           mark;
                __u32           dropcount;
        };

        __u16                   vlan_tci;

        sk_buff_data_t          transport_header;
        sk_buff_data_t          network_header;
        sk_buff_data_t          mac_header;
        /* These elements must be at the end, see alloc_skb() for details.  */
        sk_buff_data_t          tail;
        sk_buff_data_t          end;
        unsigned char           *head,
                                *data;
        unsigned int            truesize;
        atomic_t                users;
};

有了以上定义的话,我们就可以做类似如下定义来使我们的驱动支持多内核了:

struct sk_buff *new_skb;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
new_skb->mac.raw = (unsigned char *)new_eth_p;
#else
new_skb->mac_header = (unsigned char *)new_eth_p;
#endif

参考:http://www.linuxquestions.org/questions/linux-kernel-70/struct-sk_buff-differs-in-2-6-18-and-2-6-33-kernel-882507/