
linux
文章平均质量分 60
seebit
这个作者很懒,什么都没留下…
展开
-
添加public用户
useradd -d /home/samba publicpasswd public 加入samba用户smbpasswd -a public原创 2009-07-24 10:52:00 · 417 阅读 · 0 评论 -
移植wu-ftpd编译错误的解决方法
bison -y ftpcmd.yftpcmd.y:197.9: syntax error, unexpected =ftpcmd.y:205.9: syntax error, unexpected =ftpcmd.y:228.17-18: $2 of `cmd has no declared typeftpcmd.y:260.17-18: $2 of `cmd has no declared原创 2010-04-27 16:42:00 · 912 阅读 · 0 评论 -
建立mipsel-gdb交叉调试调试环境
1. 编译PC端的gdb (client)关键点是./configure --host=i686-pc-linux-gnu --target=mipsel-linux --prefix=/usr/local/mips-gdb这个时候编译器要用x86版本的, 不是用交叉编译器2. 编译目标板上的程序gdbserver(先进入gdb/gdbserver目录)./configure -原创 2010-04-30 16:32:00 · 1326 阅读 · 0 评论 -
proxy-suite ftp代理服务器的配置要点
<br />AllowMagicUser yes<br />AllowTransProxy yes<br />DestinationAddress x.x.x.x<br />Group root<br />User root<br />配置数据连接的端口范围:<br />主动模式<br />ActiveMinDataPort 5000<br />ActiveMaxDataPort 6000<br />被动模式<br />PassiveMinDataPort 11000<br />PassiveMa原创 2010-07-03 16:30:00 · 628 阅读 · 0 评论 -
Linux防火墙配置
) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables start 关闭: service iptables stop 需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。 在开启了防火墙时,做如下设置原创 2011-10-20 11:39:39 · 727 阅读 · 0 评论 -
samba-mount
mount -t smbfs -o codepage=cp936,username=用户名,password=密码 -l //ip地址/共享文件夹名 挂载点或mount -t smbfs -o codepage=cp936,username=用户名,password=密码 -l //计算机名/共享文件夹名 挂载点或mount -t smbfs -o codepage=cp9转载 2011-10-31 18:42:57 · 1165 阅读 · 0 评论 -
mount.cifs 命令
mount.cifs //IP/dir localPath -o nounix,noserverino转载 2011-11-04 18:01:00 · 3124 阅读 · 0 评论 -
Linux系统中如何添加自己的库文件路径
库文件在连接(静态库和共享库)和运行(仅限于使用共享库的程序)时被使用,其搜索路径是在系统中进行设置的。一般 Linux 系统把 /lib 和 /usr/lib 两个目录作为默认的库搜索路径,所以使用这两个目录中的库时不需要进行设置搜索路径即可直接使用。对于处于默认库搜索路径之外的库,需要将库的位置添加到库的搜索路径之中。设置库文件的搜索路径有下列两种方式,可任选其一使用: 在环境变量 LD转载 2011-11-04 19:54:22 · 594 阅读 · 0 评论 -
使用TC的netem配置模拟网络
tc qdisc add dev eth0 root handle 1: prio tc qdisc add dev eth0 parent 1:3 handle 30: netem delay 50ms 10ms distribution normal loss 10%tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 mat原创 2012-03-16 16:57:29 · 1751 阅读 · 0 评论 -
iproute2源IP路由配置
ip route add 192.168.0.0/24 dev eth0 table 10ip route add default via 192.168.0.1 dev eth0 table 10ip rule add from 192.168.0.10 table 10 pref 100ip route add 192.168.0.0/24 dev eth1 table 11原创 2012-03-17 13:31:18 · 1153 阅读 · 0 评论 -
ps和top
ps -ef --- 查看所有进程的各种信息(同 ps -Af)ps -eLf --- 查看所有进程并且显示线程ps -eLo pid,lwp,pcpu,pmem | grep 6137 --- 查看6137号进程的各线程CPU占用率原创 2012-11-29 16:12:33 · 438 阅读 · 0 评论 -
xp硬盘安装ubuntu server12.10后记
参照网上的ubuntu desktop版本的安装方法,安装server版本有一些不同之处,经过尝试成功后记录如下:1. vmlinuz,initrd.gz从hd-media目录下载,menu.lst添加的内容title Install Ubunturoot (hd0,5)kernel (hd0,5)/vmlinuz root=/dev/ram ramdisk_size=32000原创 2013-02-02 12:59:49 · 1078 阅读 · 0 评论 -
关于Ubuntu DNS配置的保存
配置 /etc/resolv.conf 后每次重启会自动消失应该配置到 /etc/resolvconf/resolv.conf.d/base 里面nameserver x.x.x.xnameserver y.y.y.y原创 2013-03-22 16:01:28 · 799 阅读 · 0 评论 -
ubuntu内核模块编译环境
apt-get install linux-headers然后可以选择需要的内核版本安装原创 2013-04-10 20:17:09 · 1464 阅读 · 0 评论 -
samba共享文件夹设置
[coop]comment = Shared Folder with username and passwordpath = /home/username/cooppublic = nowritable = yesvalid users = usernamecreate mask = 0777directory mask = 0777available = yes原创 2013-08-10 17:08:39 · 677 阅读 · 0 评论 -
交叉编译的一般方法
一般软件包有一个configure或者Configure脚本执行./configure --help 获取帮助, 查看一下一些feature选项的含义,确定是否需要一些feature项1.改变安装路径 --prefix软件编译后一般安装路径是/usr/bin,/usr/lib,/usr/include例如指定--prefix=$HOME这安装路径改到$HOME/bin,$HOME/lib,$H原创 2010-04-27 16:09:00 · 2704 阅读 · 0 评论 -
移植openssh到montavista后记
1. 按照方法交叉编译2. 按照方法复制文件到目标板(sshd随便放), 可执行程序都要交叉strip一下3. 拷贝PC机上etc目录下passwd, group,shadow三文件到目标板/etc目录4. 确保目标板内核编译选项已经打开Unix98 PTY支持:Device Drivers --->Character devices --->[*] Unix98 PTY suppo原创 2010-04-23 15:56:00 · 576 阅读 · 0 评论 -
linux多IP(网卡)配置
多IP:第一种方法:ifconfig eth0:1 192.168.5.129 netmask 255.255.255.0然后,你用ifconfig,就会发现多了一个ip,但这个ip是暂时的,重启以后就不存在了第二种方法cp /etc/sysconfig/network-script..s/ifcfg-eth0 /etc/sysconfig/network-script..s/ifcfg-et原创 2009-08-05 16:50:00 · 400 阅读 · 0 评论 -
Core Dump
今天调试一个程序, 用到了core dump, 于是写出来, 记于此. 什么是Core Dump? Core的意思是内存, Dump的意思是扔出来, 堆出来. 开发和使用Unix程序时, 有时程序莫名其妙的down了, 却没有任何的提示(有时候会提示core dumped). 这时候可以查看一下有没有形如core.进程号的文件生成, 这个文件便是操作系统把程序down掉时的内存内容扔出来生成的,原创 2009-08-21 17:21:00 · 475 阅读 · 0 评论 -
处理panic后的系统自动重启
panic.c源文件有个方法,当panic挂起后,指定超时时间,可以重新启动机器if (panic_timeout > 0) { int i; /* * Delay timeout seconds before rebooting the machine. * We cant use the "normal" timers s原创 2009-08-21 17:49:00 · 1898 阅读 · 0 评论 -
常用命令
查看内核信息 dmesg原创 2009-06-20 15:22:00 · 354 阅读 · 0 评论 -
Linux下查看系统启动时间和运行时间
1.uptime命令输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.002.查看/proc/uptime文件计算系统启动时间cat /proc/uptime输出: 5113396.94 575949.85第一数字即是系统已运行的时间5113396.94 秒,运用系统工具date即可算出系统启动时间第二数字系统原创 2009-09-03 09:34:00 · 644 阅读 · 0 评论 -
linux下rwx权限数字解释
chmod也可以用数字来表示权限如chmod777file 语法为:chmodabcfile 其中a,b,c各为一个数字,分别表示User、Group、及Other的权限。 r=4,w=2,x=1 若要rwx属性则4+2+1=7; 若要rw-属性则4+2=6; 若要r-x属性则4+1=7。 范例: chmoda=rwxfile 和 chmod777file 效果相同 chmo原创 2009-09-02 11:40:00 · 34767 阅读 · 1 评论 -
linux socket 端口范围
int sysctl_local_port_range[2] = { 1024, 4999 };Socket.c (linux-2.6.18/net/sctp): .get_port = sctp_get_port,Socket.c (linux-2.6.18/net/sctp): .get_port = sctp_get_port,Tcp_ipv4.c (linux-2.6.18/ne原创 2009-09-02 14:51:00 · 4088 阅读 · 0 评论 -
core dump
检查core dump设置 ulimit -c 编译加-g选项 gcc -g -o test test.c 分析异常 gdb test core.* gdb -c core.* test 显示异常堆栈 bt, where原创 2009-09-08 16:03:00 · 366 阅读 · 0 评论 -
CentOS网络设置
这里介绍一下Linux下的网络设置文件,这是网络计算机服务器的前提条件。1.网络的基本设置我们在设置网络环境的时候,提前要弄清楚以下的相关信息。IP IP地址 Netmak 子网掩码 Gateway 默认网关 HostName 主机名称 DomainName原创 2009-07-09 16:59:00 · 425 阅读 · 0 评论 -
linux下的samba服务配置
samba变慢,修改默认网关和DNS到一个有效值解决. 启动 Samba 服务 [root@sample ~]# vi /etc/sysconfig/iptables ← 编辑 iptables 配置文件[root@sample ~]# /etc/rc.d/init.d/iptables restart ← 重新启动 iptables ,使新的规则生效 [root@sam原创 2009-07-15 17:17:00 · 720 阅读 · 0 评论 -
LINUX 环境变量总结
我们在Linux下安装系统软件的时候,经常遇到一些系统环境变量配置的问题。什么是环境变量?如何定制环境变量?我将在下面做一些介绍。一、什么是环境变量?Linux是一个多用户的操作系统。多用户意味着每个用户登录系统后,都有自己专用的运行环境。而这个环境是由一组变量所定义,这组变量被称为环境变量。用户可以对自己的环境变量进行修改以达到对环境的要求。二、定制环境变量 环境变量是和Shell紧密相转载 2009-10-10 12:38:00 · 317 阅读 · 0 评论 -
mipsle交叉编译pth
1. 修改configure文件:cross_compiling=yes2.运行export CC="/opt/crosstool/mipsel-unknown-linux-gnu/gcc-3.3.3-glibc-2.2.5/bin/mipsel-unknown-linux-gnu-gcc"./configure --prefix /home/frank/pth --host mi原创 2010-04-09 15:17:00 · 726 阅读 · 0 评论 -
修改ramdisk
解压gunzip -f ramdisk.gzchmod 777 ramdisk挂载到某个目录 mount -o loop ramdisk test 在test目录下增删文件/目录 压缩gzip -9 ramdisk原创 2010-04-21 16:35:00 · 467 阅读 · 0 评论 -
linux磁盘空间不够用,添加硬盘
添加硬盘后启动虚拟机, 如果添加的SCSI硬盘这时应该多出一个sdb/sdc/..的盘,可以用 fdisk -l 查看到分区fdisk /dev/sdb ---> n p 1 回车 回车 w 格式化mkfs -t ext3 -c /dev/sdb1挂载到某个目录 mount /dev/sdb1 /homevi /etc/fstab 添加一行 /dev/sdb1 /home原创 2010-04-21 16:28:00 · 1210 阅读 · 0 评论 -
修改socket收发缓冲区大小限制
方法一:编辑 /etc/sysctl.conf, 在最后添加内容net.core.rmem_max=2097152net.core.wmem_max=2097152然后执行 /sbin/sysctl -p方法二:执行命令echo 2097152 > /proc/sys/net/core/wmem_maxecho 2097152 > /proc/sys原创 2013-08-15 11:22:39 · 6048 阅读 · 0 评论