<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>swigger&#039;s BLOG</title>
	<atom:link href="https://www.swigger.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.swigger.net</link>
	<description>醉卧沙场君莫笑 古来征战几人回</description>
	<lastBuildDate>Wed, 13 May 2015 03:23:18 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>bugfreeforsvn</title>
		<link>https://www.swigger.net/2015/05/13/bugfreeforsvn/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 13 May 2015 02:11:49 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=382</guid>

					<description><![CDATA[在网上花了九牛二虎之力，没下到bugfreeforsvn.tar.gz。这个软件 &#8230; <a href="https://www.swigger.net/2015/05/13/bugfreeforsvn/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>在网上花了九牛二虎之力，没下到bugfreeforsvn.tar.gz。这个软件是没有人维护了，但这么多人下了，也没一个做个镜像，实在是看不下去了。</p>
<p>还好，最后在51cto找到个人，是近期还在网上有活动的，给他发邮件要到了。</p>
<p>不过下来一看，这代码质量也太烂了。因为又找又发邮件的花了太多时间，在拿到文件之前，我就已经根据能看到的其原理，自己写了一个postcommit.pl</p>
<p>今天把这两个都分享出来。二选一即可。算是做个好人。</p>
<p>立即下载：</p>
<p><a href="https://www.swigger.net/wp-content/uploads/2015/05/postcommit_pl.tar.gz">postcommit_pl.tar.gz</a> <a href="https://www.swigger.net/wp-content/uploads/2015/05/BugFreeforSVN.tar.gz">BugFreeforSVN.tar.gz</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>使iphone ssh可以输入中文</title>
		<link>https://www.swigger.net/2013/03/08/%e4%bd%bfiphone-ssh%e5%8f%af%e4%bb%a5%e8%be%93%e5%85%a5%e4%b8%ad%e6%96%87/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 08 Mar 2013 15:46:48 +0000</pubDate>
				<category><![CDATA[ios]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=362</guid>

					<description><![CDATA[结论很简单，把以下内容写入/etc/inputrc set input-meta &#8230; <a href="https://www.swigger.net/2013/03/08/%e4%bd%bfiphone-ssh%e5%8f%af%e4%bb%a5%e8%be%93%e5%85%a5%e4%b8%ad%e6%96%87/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>结论很简单，把以下内容写入/etc/inputrc<br />
set input-meta on<br />
set meta-flag on<br />
set output-meta on<br />
set convert-meta off</p>
<p>过程：通过gdb调试/bin/bash，从rl_read_init_file开始调试，后来强制调用rl_variable_dumper，输出信息。<br />
在正常的linux上，写测试代码调用rl_variable_dumper输出调试信息，两相比对，再逐步化简得出结论。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>手机中毒</title>
		<link>https://www.swigger.net/2012/11/02/%e6%89%8b%e6%9c%ba%e4%b8%ad%e6%af%92/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 02 Nov 2012 05:13:11 +0000</pubDate>
				<category><![CDATA[ios]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=356</guid>

					<description><![CDATA[iphone 4s, ios5. 表现： ssh一直不能使用，不能连接到ipho &#8230; <a href="https://www.swigger.net/2012/11/02/%e6%89%8b%e6%9c%ba%e4%b8%ad%e6%af%92/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>iphone 4s, ios5.<br />
表现： ssh一直不能使用，不能连接到iphone的sshd. 用sbsettings开，关无效。<br />
怀疑 sbsettings，启用ssh后卸载，重启，无效。<br />
重装openssh，无效，多次重装发现，在装的过程中可以连上，但很快失效。<br />
利用装的进程的短短时间快速记录进程，与不能用的时候对比，发现sshd被杀。<br />
发现文件系统上 /usr/sbin/sshd 在能连上时存在，不能连时，此文件被删除。<br />
因此怀疑有进程删除了/usr/sbin/sshd</p>
<p>经过排查和google，找到了可疑进程poc-bbot，原来这个竟然是 iphone ikee worm。<br />
删除办法 http://www.iphonefaq.org/archives/97723<br />
此毒是通过扫描网段里的22端口，用root帐号alpine密码登录传染jailbroken iphone的。<br />
我的手机root密码早就改了，在越狱之后不久就改了。回想起来，应该就是在这一很短的时间里就中了ikee病毒。还好此毒危害不大，以后不能在公共wifi下越狱了。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>build arm toolchain</title>
		<link>https://www.swigger.net/2012/03/04/build-arm-toolchain/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 04 Mar 2012 06:18:28 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=351</guid>

					<description><![CDATA[[code lang=&#8221;outline&#8221;] #this  &#8230; <a href="https://www.swigger.net/2012/03/04/build-arm-toolchain/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>[code lang=&#8221;outline&#8221;]<br />
#this is not a bash script file, just log of commands.<br />
export ARCH=arm<br />
export TARGET=arm-pc-linux-gnueabi<br />
export PREFIX=/usr/arm<br />
export SYSROOT=$PREFIX/sysroot<br />
export PATH=$PREFIX/bin:$PATH</p>
<p>#prepare<br />
sudo mkdir $PREFIX<br />
#chown to allow make install happy at user level so that we won&#8217;t crash system files on error.<br />
sudo chown $USER $PREFIX<br />
mkdir -p $SYSROOT/usr/include</p>
<p>#build binutils<br />
mkdir binutils-2.22/build ; cd binutils-2.22/build<br />
../binutils-2.22/configure &#8211;target=$TARGET &#8211;prefix=$PREFIX &#8211;with-sysroot=$SYSROOT  &#8211;disable-nls<br />
make<br />
make install</p>
<p>#build gcc stage1<br />
../gcc-4.6.3/configure &#8211;target=$TARGET &#8211;prefix=$PREFIX &#8211;enable-interwork &#8211;enable-languages=c &#8211;without-headers &#8211;disable-shared &#8211;disable-threads &#8211;with-gnu-as &#8211;with-gnu-ld<br />
make all-gcc all-target-libgcc<br />
#cd arm-* ; make libgcc_eh.a<br />
make install-gcc install-target-libgcc</p>
<p>#linux headers<br />
make at91rm9200dk_defconfig<br />
make include/linux/version.h<br />
cp -a include/linux          $SYSROOT/usr/include/<br />
cp -a include/asm-generic    $SYSROOT/usr/include/<br />
cp -a ./arch/arm/include/asm $SYSROOT/usr/include/<br />
cp -a ./arch/x86/include/asm/ioctl.h  $SYSROOT/usr/include/asm/<br />
cp -a ./arch/x86/include/asm/errno.h  $SYSROOT/usr/include/asm/<br />
cp -a ./arch/avr32/include/asm/bitsperlong.h $SYSROOT/usr/include/asm/</p>
<p>#build eglibc<br />
cd eglibc-2.14/libc ; ln -s ../linuxthreads . ; ln -s ../ports .<br />
mkdir ../../build<br />
cd ../../build<br />
../eglibc-2.14/libc/configure &#8211;prefix=/usr &#8211;host=$TARGET &#8211;enable-add-ons &#8211;with-headers=$SYSROOT/usr/include<br />
vim config.make<br />
#add -march=armv6 -mfpu=vfp to CFLAGS<br />
make<br />
make install_root=$SYSROOT install</p>
<p>#build gcc stage2<br />
../gcc-4.6.3/configure &#8211;target=$TARGET &#8211;prefix=$PREFIX &#8211;enable-languages=c,c++ &#8211;with-sysroot=$SYSROOT</p>
<p>#done</p>
<p>[/code]</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>fix openwrt network script bug</title>
		<link>https://www.swigger.net/2012/01/23/fix-openwrt-network-script-bug/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 23 Jan 2012 09:31:30 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[openwrt]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=336</guid>

					<description><![CDATA[On my router there are some interfaces i &#8230; <a href="https://www.swigger.net/2012/01/23/fix-openwrt-network-script-bug/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>On my router there are some interfaces in /etc/config/network. The wan interface is configured as a PPPOE netowrk to connect my ISP. There is also a pptp-vpn connected named zvpn. I found it is very slow to run &#8220;/etc/init.d/network reload&#8221;, taking about 2 miniutes. If I comment out the zvpn interface, it runs fast.</p>
<p>Obviously, the vpn connection depends on my main connection &#8212; the wan interface which works in PPPOE mode. So this should be the key point. I spent many hours before to find how to config the dependency, including asking this question in the openwrt forum, but with no luck.  Today I wrote some debug statements in the network scripts and almost brick my router to find what is wrong, finaly I got it.</p>
<p>I thought it is because the vpn interface is inited before wan, so I named my vpn interface as zvpn to make it as the last one,  but I&#8217;m wrong.  I don&#8217;t need to care its name.  The network scripts load each interface in the order of what it is in the configration file &#8212; /etc/config/network. However, there is a problem: the network scripts also unload each interface in this order.</p>
<p>We know, the unload order should be the reverse of the load order. This can be changed by patch /sbin/ifdown.</p>
<p>This is the patch:</p>
<p>[code lang=&#8221;diff&#8221;]<br />
&#8212; /rom/sbin/ifdown        2012-01-21 22:21:29.000000000 +0800<br />
+++ ifdown      2012-01-23 17:23:46.000000000 +0800<br />
@@ -7,10 +7,17 @@<br />
 case &#8220;$1&#8221; in<br />
        &#8220;-a&#8221;)<br />
                [ -e &#8220;/tmp/resolv.conf.auto&#8221; ] &#038;&#038; rm /tmp/resolv.conf.auto<br />
+               TODO=<br />
                config_cb() {<br />
&#8211;                       [ interface != &#8220;$1&#8221; -o -z &#8220;$2&#8221; ] || eval &#8220;$0 -w $2&#8221;<br />
+                       [ interface != &#8220;$1&#8221; -o -z &#8220;$2&#8243; ] || TODO=&#8221;$2 $TODO&#8221;<br />
                }<br />
                config_load network<br />
+               for i in $TODO ; do<br />
+                       $0 -w $i<br />
+               done<br />
                exit 0<br />
        ;;<br />
        &#8220;-w&#8221;) shift ;;<br />
[/code]</p>
<p>Openwrt has a recovery mode that helps me to unbrick my router after I made some bad modifications to the config files. To enter this mode, power off the router, hold reset button, power on, keep holding reset button until 192.168.1.1 replying ping requests. Then just telnet 192.168.1.1, mount -t jffs2 /dev/mtdblock3 /overlay/, and fix problems there.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>install vmware tools on debian (guest) for newest kernel (3.1.0)</title>
		<link>https://www.swigger.net/2012/01/19/install-vmware-tools-on-debian-guest-for-newest-kernel-3-1-0/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 19 Jan 2012 10:13:24 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=326</guid>

					<description><![CDATA[vmware version: vmware workstation 8.0.1 &#8230; <a href="https://www.swigger.net/2012/01/19/install-vmware-tools-on-debian-guest-for-newest-kernel-3-1-0/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>vmware version: vmware workstation 8.0.1 build-528992<br />
debian kernel: 3.1.0-1-486<br />
vmware tools fails to install or run.</p>
<p>solution:<br />
1. apt-get install libglib2.0-0<br />
2. patch /usr/lib/vmware-tools/modules/source/vmhgfs.tar<br />
unpack vmhgfs.tar, patch, repack.<br />
the patch:<br />
[code lang=&#8221;diff&#8221;]<br />
diff -ur vmhgfs-only-old/file.c vmhgfs-only/file.c<br />
&#8212; vmhgfs-only-old/file.c      2011-11-14 11:41:31.000000000 +0800<br />
+++ vmhgfs-only/file.c  2012-01-19 17:59:47.899616529 +0800<br />
@@ -84,6 +84,8 @@<br />
 #if defined VMW_FSYNC_OLD<br />
                      struct dentry *dentry,<br />
 #endif<br />
+                                        loff_t start,<br />
+                                        loff_t end,<br />
                      int datasync);<br />
 static int HgfsMmap(struct file *file,<br />
                     struct vm_area_struct *vma);<br />
@@ -990,6 +992,8 @@<br />
 #if defined VMW_FSYNC_OLD<br />
           struct dentry *dentry,        // IN: Dentry for this file<br />
 #endif<br />
+                 loff_t start,<br />
+                 loff_t end,<br />
           int datasync)                        // IN: fdatasync or fsync<br />
 {<br />
    LOG(6, (KERN_DEBUG &#8220;VMware hgfs: HgfsFsync: was called\n&#8221;));<br />
diff -ur vmhgfs-only-old/filesystem.c vmhgfs-only/filesystem.c<br />
&#8212; vmhgfs-only-old/filesystem.c        2011-11-14 11:41:31.000000000 +0800<br />
+++ vmhgfs-only/filesystem.c    2012-01-19 16:41:00.303867660 +0800<br />
@@ -358,6 +358,8 @@<br />
    HgfsSuperInfo *si;<br />
    HgfsMountInfo *mountInfo;<br />
    struct dentry *rootDentry;<br />
+   struct dentry *tmpDentry;<br />
+   struct inode *inode;</p>
<p>    ASSERT(sb);</p>
<p>@@ -408,15 +410,15 @@<br />
     * and superblock. Then HgfsInstantiate will do the rest, issuing a getattr,<br />
     * getting the inode, and instantiating the dentry with it.<br />
     */<br />
&#8211;   rootDentry = compat_d_alloc_name(NULL, &#8220;/&#8221;);<br />
+   inode = new_inode(sb);<br />
+   tmpDentry = d_alloc_root(inode);<br />
+   rootDentry = compat_d_alloc_name(tmpDentry, &#8220;/&#8221;);<br />
    if (rootDentry == NULL) {<br />
       LOG(4, (KERN_WARNING &#8220;VMware hgfs: HgfsReadSuper: Could not allocate &#8221;<br />
               &#8220;root dentry\n&#8221;));<br />
       result = -ENOMEM;<br />
       goto exit;<br />
    }<br />
&#8211;   rootDentry->d_parent = rootDentry;<br />
&#8211;   rootDentry->d_sb = sb;<br />
    result = HgfsInstantiate(rootDentry, HGFS_ROOT_INO, NULL);<br />
    if (result) {<br />
       LOG(4, (KERN_WARNING &#8220;VMware hgfs: HgfsReadSuper: Could not instantiate &#8221;<br />
[/code]</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>some notes for mac osx dev.</title>
		<link>https://www.swigger.net/2012/01/08/some-notes-for-mac-osx-dev/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 08 Jan 2012 08:06:17 +0000</pubDate>
				<category><![CDATA[MAC]]></category>
		<category><![CDATA[开发]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=323</guid>

					<description><![CDATA[set install_name for dylib g++ -install_ &#8230; <a href="https://www.swigger.net/2012/01/08/some-notes-for-mac-osx-dev/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>set install_name for dylib<br />
g++ -install_name xxx.o -o xxx.dylib</p>
<p>view install_name:<br />
method1:   otool -L xxx.dylib         see the first row.</p>
<p>change install_name<br />
install_name_tool -change old.dylib  new.dylib  xxx.dylib</p>
<p>pack libs<br />
lipo -create a_32.dylib a_64.dylib -output  a.dylib</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>patch mindmanager to avoid fuzzy text.</title>
		<link>https://www.swigger.net/2011/12/28/patch-mindmanager-to-avoid-fuzzy-text/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 28 Dec 2011 11:21:03 +0000</pubDate>
				<category><![CDATA[破解狂]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=321</guid>

					<description><![CDATA[mindmanager is a great tool, but it has  &#8230; <a href="https://www.swigger.net/2011/12/28/patch-mindmanager-to-avoid-fuzzy-text/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>mindmanager is a great tool, but it has a bug (or they the devlopers may think it&#8217;s a feature) not fixed for years. That is, the fuzzy text problem. Just search mindmanager fuzzy text , there are many results about this bug and some patches for the old versions of mindmanager. Just as what is said from http://forum.us.mindjet.com/viewtopic.php?f=16&#038;t=3060 ，disabling the call to GdipSetTextRenderingHint fixes this bug.</p>
<p>steps to make a patch<br />
1. open a debugger, ex: ollydbg, load mindmanager.<br />
2. break at GdipSetTextRenderingHint  (gdiplus.dll!_GdipSetTextRenderingHint@8)<br />
3. when it break down, track the call to it. It&#8217;s something like:<br />
[code lang=&#8221;outline&#8221;]00688A2D  call        00CC8792 [/code]<br />
goto 00CC8792 , it is something like:<br />
[code lang=&#8221;outline&#8221;]00CC8792  jmp         dword ptr ds:[0E5A758h] [/code]<br />
change it to :<br />
retn 8<br />
code bytes: c2 08 00 90 90 90<br />
4. save the modification to mindmanager.exe<br />
5. done, enjoy clear text.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>patch openwrt to avoid &#8220;bad substitution&#8221;</title>
		<link>https://www.swigger.net/2011/11/13/patch-openwrt-to-avoid-bad-substitution/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 12 Nov 2011 19:36:16 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[openwrt]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=316</guid>

					<description><![CDATA[when editing some configration of openwr &#8230; <a href="https://www.swigger.net/2011/11/13/patch-openwrt-to-avoid-bad-substitution/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>when editing some configration of openwrt , this error maybe occured:<br />
/sbin/ifup: eval: line 1: syntax error: bad substitution</p>
<p>I found at least one reason of this error code, and fixed it.<br />
[code lang=&#8221;diff&#8221;]<br />
&#8212; /rom/lib/network/config.sh<br />
+++ config.sh<br />
@@ -15,7 +15,7 @@</p>
<p>        local fam<br />
        for fam in ipv4 ipv6; do<br />
&#8211;               if [ -d /proc/sys/net/$fam ]; then<br />
+               if ls /proc/sys/net/$fam/*/$ifn 2>/dev/null ; then<br />
                        local key<br />
                        for key in /proc/sys/net/$fam/*/$ifn/*; do<br />
                                local val<br />
[/code]</p>
<p>If there is no such file , $key is &#8220;/proc/sys/net/ipv4/*/eth1:1/*&#8221; before this modification, statements in then case are not executed after modification. so this code resolved the problem of reporting:<br />
/sbin/ifup: eval: line 1: syntax error: bad substitution</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google&#8217;s IP Range</title>
		<link>https://www.swigger.net/2011/08/30/googles-ip-range/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 14:18:04 +0000</pubDate>
				<category><![CDATA[软件使用]]></category>
		<guid isPermaLink="false">http://www.swigger.net/?p=313</guid>

					<description><![CDATA[the following ip addresses belong to goo &#8230; <a href="https://www.swigger.net/2011/08/30/googles-ip-range/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>the following ip addresses belong to google.</p>
<p>64.233.160.0 &#8211; 64.233.191.255<br />
66.102.0.0 &#8211; 66.102.15.255<br />
66.249.64.0 &#8211; 66.249.95.255<br />
72.14.192.0 &#8211; 72.14.255.255<br />
74.125.0.0 &#8211; 74.125.255.255<br />
209.85.128.0 &#8211; 209.85.255.255<br />
216.239.32.0 &#8211; 216.239.63.255 </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
