Linux Common
elfylin
这个作者很懒,什么都没留下…
展开
-
ubuntu 9.10共享失败解决
<br />Failed to execute child process "testparm" (No such file or directory)<br />解决方法如下:<br />sudo cp /usr/bin/testparm.samba3 /usr/bin/testparm<br />sudo cp /usr/bin/net.samba3 /usr/bin/net<br />sudo chmod +x /usr/bin/testparm /usr/bin/net<br /><br /><原创 2010-09-17 22:47:00 · 1106 阅读 · 0 评论 -
tar 压缩命令使用
tar在linux上是常用的打包、压缩、加压缩工具,他的参数很多,折里仅仅列举常用的压缩与解压缩参数 参数: -c :create 建立压缩档案的参数; -x : 解压缩压缩档案的参数; -z : 是否需要用gzip压缩; -v: 压缩的过程中显示档案; -f: 置顶文档名,在f后面立即接文件名,不能再加参数 举例: 一,将整个/home/www/image原创 2010-09-17 22:41:00 · 634 阅读 · 0 评论 -
给Vmware进行硬盘扩容 & Vmtools
VM6.0增加了一个命令行工具:vmware-vdiskmanager.exe程序,可以用来方便快速地调整虚拟磁盘的空间大小,以扩容为例:1.关闭虚拟操作系统电源;2.进入VMWare安装路径,使用命令:C:/Program Files/VMware/VMware Workstation>vmware-vdiskmanager -x 12Gb K:/VM/Ubuntu/Ub转载 2011-03-17 23:36:00 · 2264 阅读 · 0 评论 -
ftp shell cmd
ip_addr="$1"name="$2"passwd="$3"command1="$4"command2="$5"command3="$6"echo "open $ip_addr">ftp_inputecho "user $name $passwd">>ftp_inputecho "binary">>ftp_inputecho "epsv4">>ftp_inputecho "原创 2012-03-14 22:09:47 · 1221 阅读 · 0 评论 -
Build compile environment for gingerbread on Ubuntu1104
Since the latest version of android is 3.0 and above, it is quiet necessary for us to set up a building enviroment for gingerbread and above.1 install the operation system. (remember if you want t原创 2011-08-07 09:42:29 · 972 阅读 · 1 评论 -
build ginger on 32bit of ubuntu 10.10
First of all, the most part will be the same as ubuntu 11.04, which is metioned in this article:http://blog.csdn.net/elfylin/article/details/6666034The main purpose here is to discuss the diff原创 2011-09-17 06:07:05 · 1026 阅读 · 0 评论 -
在ubuntu10.10中安装sun-java5-jdk的方法
之前看到一个写9.04安装的,今天发现一个更简单的。 在ubuntu10.04中无法直接安装java5. 执行sudo gedit /etc/apt/sources.list,添加以下内容,将10.04的源改成9.04的源。deb http://cn.archive.ubuntu.com/ubuntu/ jaunty multiversedeb ht转载 2011-03-29 18:34:00 · 1453 阅读 · 0 评论 -
android 工程 快速查找分支
先贴一个代码 android代码都是通过拉分支来区别不同项目的,编译的时候用分支代码覆盖主分支,这样子可以尽量减少代码量的前提实现了差异化。不过缺点也明显,就是修改一个文件必须同步到各个分支,要不然就会可能有编译问题。 这样就有了一个需求,就是在一个大的工程中寻找所有定制文件。之前用find -name 当工程比较小的时候,这种方法还可行。不过随着工程变大,分支文件上G了,原创 2010-10-18 18:15:00 · 1093 阅读 · 0 评论 -
awk
1.awk common format and example awk '{cmd}' inputfileor awk 'condition {cmd}'or awk '{if(condition) cmd}for example, b.txta b cd e f>>awk '{printf $1}' b.txtad>>awk '$1=="a" {pr原创 2012-02-16 00:05:20 · 845 阅读 · 0 评论 -
exec and get pid
exec is used for start another program in the c code of linux1.execlint execl(const char*path,const char* arg,...)the last parameter must end up with NULL.#include #include int main(){原创 2012-03-17 00:03:17 · 956 阅读 · 2 评论 -
scp and ftp and linux shell
1 scpsudo scp abc [email protected]:/home/sudo mount -s smbfs -o username=root //192.168.1.1/share /homesudo mount -t ntfs UUID="966A4B803710F028" -w /media/D2ftpcd dir //enter dir of th原创 2012-02-07 21:09:36 · 511 阅读 · 0 评论 -
local shell
to be continuedcheckerror(){ if [ "$?" -eq 1 ] then echo "error $*" exit else echo "OK" fi}#get archtechtureresult=`uname -a |grep "x86_64"`if [ ! -s arch ]thenarch=amd64fi原创 2012-08-22 23:47:27 · 1857 阅读 · 1 评论 -
Ubuntu 11.04 安装java6 配置java项
更新自带的源后,发现找不到sun-java6-jdk 安装办法如下:编辑源列表:进入/etc/apt/下,sudo vi sources.list,将#deb http://archive.canonical.com/ubuntu lucid partner #deb-src http://archive.canonical.com/ubuntu lucid partn转载 2011-05-10 22:53:00 · 2226 阅读 · 0 评论 -
win7 ubuntu
一、安装了win7,想再安装ubuntu本来Win7 有C D E三个区和系统保留区,后来就在E盘用Win7自带工具,多分出来50G,用来给linux但是,在ubuntu安装是时候却发现只有2个分区,一个就是sda和C盘一样的,然后就是剩余一个区是其它几个分区之和。整了半天终于搞清楚了Win7自带的分区工具有问题,它建立分区的时候,默认都是建立主分区了,而一个盘原创 2012-08-18 23:14:46 · 2125 阅读 · 4 评论 -
ubuntu svn
1. can't find dnsgedit /etc/nsswitch.conf#hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4hosts: files dns2.can't input passwordrm ~/.gnome2/keyrings/login.keyring原创 2012-10-21 09:36:42 · 1504 阅读 · 0 评论 -
正则表达式
From Unix Shell 编程 第七章一、基本含义表regular expression^ 只只匹配行首$ 只只匹配行尾* 只一个单字符后紧跟*,匹配0个或多个此单字符[ ] 只匹配[ ]内字符。可以是一个单字符,也可以是字符序列。可以使用 -表示[ ]内字符序列范围,如用[1-5]代替[12345]\ 只用来屏蔽一个元字符的特殊含义。因为有时在 shel转载 2011-10-23 12:04:32 · 452 阅读 · 0 评论 -
Shell 脚本 遍历文件夹
遍历文件夹,作用不说了,用处太多了 贴代码 .sh deepls() { cd "$1" for x in * do if [ -f $x ] then echo $x fi if [ -d $x ] then (deepls "$PWD/$x") fi done}deepls $PW转载 2010-10-18 13:45:00 · 3534 阅读 · 0 评论 -
Linux查看文件夹大小
du -sh 查看当前文件夹大小du -sh * | sort -n 统计当前文件夹(目录)大小,并按文件大小排序(主要常用就这两种方式) 附送:du -sk filename 查看指定文件大小 Linux:ls以K、M、G为单位查看文件大小Linux:ls以K、M、G为单位查看文件大小。#man ls……-h, --human-readable原创 2010-09-17 22:43:00 · 624 阅读 · 1 评论 -
linux 下设置环境变量
<br />老生常谈了,因为今天又用到了,再记录一下,自己也巩固一下。<br /> <br />1.配置/etc/profile 这个脚本在登录时会执行<br />全局(公有)配置,不管是哪个用户,登录时都会读取该文件。<br />2.配置/ect/bashrc,在ubuntu下面是/ect/bash.bashrc<br /> 这个应该是全局的,我用root登录是可以,其它用户忘了。<br />但是据说这个只能用shell登录,远程登录不会执行(改天再测试一下。)<br />3.配置~/.profi原创 2010-10-01 22:24:00 · 824 阅读 · 1 评论 -
man 同名帮助
比如按照samba后,有一个smbpasswd这个命令,于此同时也有smbpasswd这个文件这2项各有一个帮助文档。但是man smbpasswd就默认显示命令帮助,而没有显示文件的帮助可以指定man 5 smbpasswd 即可原创 2010-11-04 21:44:00 · 711 阅读 · 0 评论 -
samba找不到smbpasswd文件tdbsam smbpasswd
<br />安装好linux fc9 ,samba,配置了两个测试目录和临时用户,无意中突然发现在/etc/samba/目录里并没有samba的用户认证文件:smbpasswd<br /><br />通过添加用户,修改密码,都可正常操作,而且相应的用户名也可以正常登陆,可就是找不到smbpasswd文件<br /><br />逐行检查smb.conf文件,终于找到了可疑点:passdb backend = tdbsam<br /><br />这时才记起来,linux有个和smbpasswd更转载 2010-11-04 21:57:00 · 9552 阅读 · 1 评论 -
Ubuntu给samba 添加权限
samba装好了,可以共享,也可以读写,但是美中不足的是没有给共享加权限,安全性不够。给samba共享加权限就要动配置文件了/etc/samba/smb.conf1、给samba添加一个用户smbpasswd -a root注意:其一这个用户名必须是系统有的,其二必须是root账户2、配置samba配置文件如下:[home] path = /home valid users = root public = no writable = yes printable = n原创 2010-11-04 22:04:00 · 9487 阅读 · 1 评论 -
ubuntu 安装 vsftp服务
<br />1.查看系统是否有ftp服务<br />ps -e | grep vsftpd<br /> <br />2.按装vsftpd<br />apt-get install vsftpd<br /> <br />安装完成后,vsftpd会自动开启,而且会给系统创建一个ftp的用户。<br /> <br />3.重启<br />/etc/init.d/vsftpd restart<br /> <br />4.默认目录<br />默认情况下vsftp自动开启匿名账号,其默认目录可以查看/etc/pas原创 2010-11-07 00:08:00 · 3211 阅读 · 0 评论 -
sudo 补充
<br />配置文件 /etc/sudoers<br />格式如下:<br />USER_FLAG HOST_FLAG=(RUNAS_FLAG) COMMAND_FLAG<br />例子:<br />1、beinan ALL=/bin/chown,/bin/chmod<br />表示beinan 能够在任何可能出现的主机名的系统中,能够转换到root用户下执行 /bin/chown 和/bin/chmod 命令<br /><br /><br />2、beinan ALL=(root) /bin/ch转载 2011-01-02 22:19:00 · 667 阅读 · 0 评论 -
Android JNI和NDK关系
<br />1、什么JNI<br />Java Native Interface(JNI)标准是java平台的一部分,它允许Java代码和其他语言写的代码进行交互。JNI 是本地编程接口,它使得在 Java 虚拟机(VM) 内部运行的 Java 代码能够与原创 2011-01-06 23:23:00 · 7279 阅读 · 0 评论 -
use of at on linux
'at' is a quite use shell command on linux.It can help you to execute a command at some time or some timer later.We use 'man at', we原创 2011-09-18 22:07:34 · 486 阅读 · 0 评论 -
ubuntu设置本地源详解版(在9.10亲测)
本地源,其一,可以进行软件包备份,下次就不用去网上下载了。其二,对于没有网络的ubuntu,也可以用apt-get 来安装软件了。走了很多弯路,这个本地源搞了很多回,但是每次都不是一次成功。今天又试了一回,刚刚搞好,索性把具体设置贴上来得了。1.首原创 2010-09-17 22:36:00 · 1811 阅读 · 0 评论 -
改变MTU
/system/bin/ifconfig rmnet0 mtu 1460原创 2011-07-16 11:02:04 · 660 阅读 · 0 评论 -
linux disk command
1 mounted disk informationthere are three files to record the mounted disk informationa、/etc/fstab$cat /etc/fstab# /etc/fstab: static file systeminformation.## Use 'blkid'to print the un原创 2011-11-09 23:24:26 · 925 阅读 · 0 评论 -
How to use vi on linux
vi is quite useful if you want to edit a file with a command shell.maybe most of us are not familar of it, since we are too used of the GUI interface.Here is some basic useage of this tool, and I原创 2011-09-18 22:42:42 · 675 阅读 · 1 评论 -
find string in file (need to be improved)
maybe it will be useful when we want to find a variable in a directory.target=$1traversal(){ cd "$1" for x in * do if [ -f $x ] then #echo $x grep $target原创 2011-12-29 23:37:01 · 636 阅读 · 0 评论 -
linux 递归删除 指定文件
这个命令比较实用 比如删除当前目录下所有的svn find -name ".svn" -exec rm -r {} \;原创 2010-09-17 22:45:00 · 837 阅读 · 0 评论 -
mount a new disk for ubuntu
1 find all the disk on the computer.$sudo fdisk -lDisk /dev/sdb: 500.1 GB, 500107862016 bytes255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectorsUnits = sectors of 1 * 512原创 2011-11-09 23:14:04 · 1636 阅读 · 0 评论