[update持续更新]command usage

来源:互联网 发布:k 线数据 编辑:程序博客网 时间:2024/06/13 08:41

git的一些常用命令

$git reset  - - soft HEAD^ 此命令即是撤销commit的操作的。哈哈哈

$git log --pretty=format:"%h %an %s" | grep "keyword"此命令用来搜索那些制定keyword的commit id

比如你要查找你自己曾经提交过的就可以$git log --pretty=format:"%h %an %s" | grep your_name  , 还可以在前面添加repo forall -c来扩大查找范围(如果你熟悉repo的话)

$ git config --global user.name "Firstname Lastname"

Sets the name of the user for all git instances on the system

 

$ git config --global user.emailyour_email@youremail.com

Sets the email of the user for all git instances on the system

 

如果是生成patch的话可以

git format-patch [old commit id]..[new commit id]  

-----------------------------------------------------------------------------分割线---------------------------------------------------------------------------------------

改变外挂设备的写权限

1.      If has mount ,umount your new disk, for example,#umount /dev/sdb1

2.      #cd /media 

         #mkdir cat

          #mount –o rw /dev/sdb1 /media/cat

3.       Okay,then your file has the rwx permission, you can make your codebase.

df命令查找硬盤

Tips: 改变目录权限 chmod –R a+x [directory path]

-----------------------------------------------------------------------------分割线---------------------------------------------------------------------------------------

模拟器上网做以下几步(proxy下)

启动模拟器

1.       Settings ->无线和网络 ->更多… -> 移动网络-> APN -> T-mobileUS

在“代理”中设置172.28.128.34(proxy地址),“端口”80

“用户名”和“密码”为登录windows的用户名和密码

2.       terminal中输入cat /etc/resolv.conf看下dns服务器地址(应该都一样的吧)

For example,显示为nameserver 172.28.128.158

                                      nameserver 172.28.128.159

3.       ./adb shell setprop net.dns1 172.28.128.158或者是……159

-----------------------------------------------------------------------------分割线---------------------------------------------------------------------------------------

opengl相关

Ubuntu下:http://my.oschina.net/liujinofhome/blog/34406

Opengl

Sudo gedit install build-essential

Sudo gedit install freeglut3-dev

-----------------------------------------------------------------------------分割线---------------------------------------------------------------------------------------

linux的grep和find用处

grep可以查找字串,当然find也可以用来但是比较繁琐

grep -R --include="*.cpp" key dir

上述命令的含义:

在dir目录下递归查找所有.cpp文件中的关键字key


find用法主要用于查找文件

find dir -name '*.c'     找dir文件夹下所有.c文件