Archive

Archive for the ‘OpenSource’ Category

使用git svn创建一个svn的分支

April 22nd, 2013 No comments


git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/
git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch
git svn fetch newbranch [-r]
git checkout -b local-newbranch -t newbranch
git svn rebase newbranch

From: http://stackoverflow.com/questions/296975/how-do-i-tell-git-svn-about-a-remote-branch-created-after-i-fetched-the-repo

Categories: OpenSource, Others, Tech.Notes Tags:

Mac mkyaffs2image binary Re: HOWTO: Roll Your Own Firmware

April 10th, 2013 No comments

Here’s a Mac (intel 32bit snow leopard) built binary of mkyaffs2image

http://www.multiupload.com/DD76DX276D

I have only tested it so far that it runs. Use at your own peril.

Based on the source from http://code.google.com/p/fatplus/downloads/list .

Got it to compile by adding the following to devextras.h

#if defined(__APPLE__) || defined (__FreeBSD__)
typedef long long loff_t;
#endif

No luck on finding or building a mac binary of unyaffs so far. However, a Windows binary can be found at http://boomtopper.blogspot.com/2009/10/unyaffs-windows-binary.html

From: http://forums.seagate.com/t5/FreeAgent-Theater-and-GoFlexTV/HOWTO-Roll-Your-Own-Firmware/m-p/48669

–EOF–

/proc/net/tcp文件网络状态

January 21st, 2013 No comments

/proc/net/tcp或/proc/net/tcp6 文件,这里记录的是ipv4/ipv6下所有tcp连接的情况,包括下列数值:
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 0100007F:13AD 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 521 1 dce53a80 300 0 0 2 -1
最主要的,就是local_address本地地址:端口、rem_address远程地址:端口、st连接状态。
注1:文件中都是用的16进制,所以HTTP的80端口记录为0050。
注2:状态码对应如下
00 “ERROR_STATUS”,
01 “TCP_ESTABLISHED”,
02 “TCP_SYN_SENT”,
03 “TCP_SYN_RECV”,
04 “TCP_FIN_WAIT1″,
05 “TCP_FIN_WAIT2″,
06 “TCP_TIME_WAIT”,
07 “TCP_CLOSE”,
08 “TCP_CLOSE_WAIT”,
09 “TCP_LAST_ACK”,
0A “TCP_LISTEN”,
0B “TCP_CLOSING”,

–EOF–

Categories: Android, OpenSource, Tech.Notes Tags: , , ,

在ubuntu上面安装谷歌拼音输入法libgooglepinyin

November 5th, 2012 2 comments

ubuntu自动的拼音输入发实在是太难用了, 前段时间无意中看到一个linux环境下面的谷歌拼音输入法libgooglepinyin,试用了一段时间,感觉非常不错。

安装过程非常简单, 具体过程如下:

1. 按照必要的编译环境如: GCC, cmake 等

1
sudo apt-get install cmake build-essential opencc mercurial ibus

2. 安装谷歌输入法libgooglepinyin

1
2
3
4
5
6
7
8
9
hg clone http://code.google.com/p/libgooglepinyin/
 
cd libgooglepinyin
 
mkdir build; cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
 
make
sudo make install

3. 安装ibus皮肤 ibus-googlepinyin

1
2
3
4
5
6
7
8
9
hg clone http://code.google.com/p/libgooglepinyin.ibus-wrapper/ ibus-googlepinyin
 
cd ibus-googlepinyin
 
mkdir build; cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
 
make
sudo make install

4. 重新启动ibus-daemon

1
sudo killall -9 ibus-daemon

5. ibus配置谷歌输入法

打开 IBUS设置 → 输入法 → 选择输入法→ 汉语 → GooglePinyin,然后将其上升到顶,或者把其他的输入法删掉。

更详细的安装过程参考: http://code.google.com/p/libgooglepinyin/wiki/INSTALL

-EOF-

windows版本的Emacs无法显示图片的解决方法

May 27th, 2012 No comments

原文参考: http://blog.csdn.net/atskyline/article/details/7569621

可以先在运行下面几个语句检查一下是否已经支持了图片

(image-type-available-p ‘png)

(image-type-available-p ‘gif)

(image-type-available-p ‘jpeg)

(image-type-available-p ‘tiff)

(image-type-available-p ‘xbm)

(image-type-available-p ‘xpm)

这几个函数复制到随便Lisp模式的buffer,

然后在每一行行尾按C-j,就可以看到每个函数运行的结果,返回t证明已经可以支持图片了。

Win 的不能显示图片是因为编译后默认没有带几个DLL文件。

把以下DLL文件拷贝到EMACS安装目录的BIN目录下,就可以显示图片了。

jpeg62.dll
libgcrypt-11.dll
libgnutls-26.dll
libpng14-14.dll
libtasn1-3.dll
libtiff3.dll
libungif4.dll
libXpm.dll
xpm4.dll
zlib1.dll

这些文件都可以在

http://gnuwin32.sourceforge.net/packages.html

一个个下载到。

另外一个比较快的方法了在

https://code.google.com/p/emacs-for-windows/downloads/list

有已经修改过的EMACS版本。

我把emacs里面图片相关的链接库单独提取出来供大家下载使用:
emacs-images

–EOF-