随笔分类 -  Linux

摘要:错误:/bin/bash^M: bad interpreter: 没有那个文件或目录解决方案:运行脚本时出现了这样一个错误,打开之后并没有找到所谓的^M,查了之后才知道原来是文件格式的问题,也就是linux和windows之间的不完全兼容。。。具体细节不管,如果验证:vim test.sh:set ff?如果出现fileforma=dos那么就基本可以确定是这个问题了。:set fileformat=unix:wq! 阅读全文
posted @ 2013-07-05 11:22 Master HaKu 阅读(1144) 评论(0) 推荐(0) 编辑
摘要:1. Run the shell $ sh script.sh # Assuming script is in the current directory. Or: $ sh /home/path/script.sh # Using full path of script.sh. #讲脚本改为可执行模式 $ chmod a+x script.sh $ ./script.sh #./ represents the current directory Or: $ /home/path/script.sh # Full path of the script is used 阅读全文
posted @ 2013-04-25 14:39 Master HaKu 阅读(180) 评论(0) 推荐(0) 编辑
摘要:按顺序依次为 秒(0~59) 分钟(0~59) 小时(0~23) 天(月)(0~31,但是你需要考虑你月的天数)月(0~11) 天(星期)(1~7 1=SUN 或 SUN,MON,TUE,WED,THU,FRI,SAT) 7.年份(1970-2099) 其中每个元素可以是一个值(如6),一个连续区间(9-12),一个间隔时间(8-18/4)(/表示每隔4小时),一个列表(1,3,5),通配符。由于"月份中的日期"和"星期中的日期"这两个元素互斥的,必须要对其中一个设置?. 0 0 10,14,16 * * ? 每天上午10点,下午2点,4点 0 0/30 阅读全文
posted @ 2013-03-29 12:46 Master HaKu 阅读(233) 评论(0) 推荐(0) 编辑
摘要:vi /etc/sysconfig/i18n 将内容改为 LANG="zh_CN.GB18030" LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en" SYSFONT="lat0-sun16" 阅读全文
posted @ 2013-03-29 12:40 Master HaKu 阅读(175) 评论(0) 推荐(0) 编辑
摘要:1. 首先写好你的java quartz job, 然后用Eclipse把它导出成runnable jar2. 编写shell脚本#!/bin/sh# chkconfig: 23456 80 10# description: check pnrexport SERVER=/usr/job/ cd $SERVER case "$1" in start) nohup java -server -jar ZeusService.jar zeus.quartz.air.XePnrTrigger -Xms128m -Xmx1024m & echo $! > $SERVE 阅读全文
posted @ 2013-03-29 11:41 Master HaKu 阅读(596) 评论(0) 推荐(0) 编辑
摘要:1. 安装SVN服务器软件2. 在home下创建svn根目录 mkdir /home/svnroot3. 在 /home/svnroot下创建Project1 , Project 2, Project3 三个项目文件夹,这三个文件夹要存放不同项目的SVN版本库。4. 同样在/home/svnroot中创建 CodeAuth 文件夹,该文件夹将保存 passwd 和authz文件,在第6步中实现。5. 创建项目 cd /home/svnroot svnadmin create Project1 svnadmin create Project2 svnadmin create Project3分别 阅读全文
posted @ 2013-02-22 15:34 Master HaKu 阅读(5959) 评论(0) 推荐(0) 编辑
摘要:1.环境centos5.52.安装svnyum -y install subversion3.配置建立版本库目录mkdir /www/svndatasvnserve -d -r /www/svndata4.建立版本库创建一个新的Subversion项目svnadmin create /www/svndata/oplinux配置允许用户rsync访问cd /www/svndata/oplinux/confvi svnserve.confanon-access=noneauth-access=writepassword-db=passwd注:修改的文件前面不能有空格,否则启动svn server出 阅读全文
posted @ 2013-02-01 18:00 Master HaKu 阅读(40730) 评论(0) 推荐(0) 编辑
摘要:1. 首先去http://dev.mysql.com/downloads/mysql/5.5.html#downloads站点下载 MySQL-devel-5.5.29-2.linux2.6.i386.rpm MySQL-client-5.5.29-2.linux2.6.i386.rpm MySQL-server-5.5.29-2.linux2.6.i386.rpm2. yum install libaio3. 卸载旧的mysqlyum remove mysqlrpm -e --nodeps mysql-libs-5.1.*4. 安装#rpm -ivh MySQL-devel-5.5.29-2 阅读全文
posted @ 2013-01-30 11:37 Master HaKu 阅读(6784) 评论(0) 推荐(0) 编辑
摘要:1.查看CentOS自带的JDK是否安装,如果已经安装卸载#rpm –qa | grep jdk#rpm –qa | grep gcj#yum –y remove java-*-gcj-comat2.安装JDK下载jdk-6u18-linux-i586.bin或者jdk-6u18-linux-i586-rpm.bin,本次安装使用jdk-6u18-linux-i586.bin#mkdir /usr/local/java#cd .usr/local/java#chmod +x jdk-6u18-linux-i586.bin#./jdk-6u18-linux-i586.bin选择YES3.配置环境 阅读全文
posted @ 2013-01-28 13:40 Master HaKu 阅读(1549) 评论(0) 推荐(0) 编辑
摘要:一、CentOS 修改IP地址修改对应网卡的IP地址的配置文件 #gedit /etc/sysconfig/network-scripts/ifcfg-eth0修改以下内容DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0 BOOTPROTO=static #设置网卡获得ip地址的方式,可能的选项为static,dhcp或bootp,分别对应静态指定的 ip地址,通过dhcp协议获得的ip地址,通过bootp协议获得的ip地址 BROADCAST=192.168.0.255 #对应的子网广播地址 HWADDR=00:07:E9:05:E8:B4 #对 阅读全文
posted @ 2013-01-28 11:31 Master HaKu 阅读(2935) 评论(0) 推荐(0) 编辑
摘要:一:使用CentOS常用命令查看cpu more /proc/cpuinfo | grep "model name" grep "model name" /proc/cpuinfo [root@localhost /]# grep "CPU" /proc/cpuinfo model name : Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz model name : Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz 如果觉得需要看的更加舒服 grep 阅读全文
posted @ 2013-01-28 11:27 Master HaKu 阅读(1127) 评论(0) 推荐(0) 编辑
摘要:很大的原因是防火墙:通过/etc/init.d/iptables status命令查询是否有打开80端口,如果没有可通过两种方式处理:1.修改vi /etc/sysconfig/iptables命令添加使防火墙开放80端口(推荐)-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT2.关闭防火墙/etc/init.d/iptables stop#start 开启#restart 重启永久性关闭防火墙chkconfig --level 35 iptables off 阅读全文
posted @ 2013-01-28 11:25 Master HaKu 阅读(788) 评论(0) 推荐(0) 编辑
摘要:1. 分区规划 2. 新增根目录分区3. 新增引导分区4. 新增swap分区5. 新增Home分区6. 最终分区图 阅读全文
posted @ 2013-01-25 16:48 Master HaKu 阅读(4677) 评论(0) 推荐(0) 编辑
摘要:1. 将vmware的两张网卡的IP获得方式设置成自己获取 将vmware的两张网卡的IP获得方式设置成自己获取,很多情况下这两张网卡的IP在安装完vmware时会自动给你一个默认的IP地址,我刚开始做的时候因为这里没有修改所以导致我一直没有成功,后来才发现这里必须去自动获取IP,否则会连接不到路由器的网关,打开网络和网络共享中心,修改这两张网卡的ip获取方式2. 设置VMWare网卡适配器模式VM->Settings->选择桥接模式 3. 修改ubuntu网络ip地址为DHCP (注:静态IP方式会不能访问internet) sudo gedit /etc/network/int 阅读全文
posted @ 2013-01-22 17:20 Master HaKu 阅读(515) 评论(0) 推荐(0) 编辑
摘要:1. 安装Qt集成环境 sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer2. 编写一个简单的Qt程序生成一个简单的窗口#include<QApplication>#include<QLabel>intmain(intargc,char*argv[]){QApplicationapp(argc,argv);QLabel*label=newQLabel("HelloQt!");label->show();returnapp.exec();}3 阅读全文
posted @ 2012-05-29 15:25 Master HaKu 阅读(769) 评论(0) 推荐(0) 编辑
摘要:1. 首先安装g++ sudo apt-get install build-essential2. 输入一个简单的cpp程序#includeusingnamespacestd;intmain(){cout<<"HelloUbuntu!"<<endl;return0;}3. 编译 david@ubun... 阅读全文
posted @ 2012-05-29 15:00 Master HaKu 阅读(2425) 评论(0) 推荐(0) 编辑
摘要:1. 代码编写#include<stdlib.h>#include<stdio.h>#include"mysql.h"intmain(intargc,char*argv[]){MYSQLmy_connection;intres;mysql_init(&my_connection);if(mysql_real_connect(&my_connection,"localhost","root","mysql","mysql",0,NULL,0)){printf 阅读全文
posted @ 2012-05-25 15:58 Master HaKu 阅读(3980) 评论(0) 推荐(0) 编辑
摘要:1. 安装mysql client包 sudo apt-get install libmysqlclient15-dev2. 编写C程序#include<stdlib.h>#include<stdio.h>#include"mysql.h"intmain(intargc,char*argv[]){MYSQL*conn_ptr;conn_ptr=mysql_init(NULL);if(!conn_ptr){fprintf(stderr,"mysql_initfailed\n");returnEXIT_FAILURE;}conn_pt 阅读全文
posted @ 2012-05-25 15:33 Master HaKu 阅读(378) 评论(0) 推荐(0) 编辑
摘要:1. 安装mysql sudo apt-get install mysql-server 阅读全文
posted @ 2012-05-03 14:57 Master HaKu 阅读(162) 评论(0) 推荐(0) 编辑
摘要:1.gedit编写C代码#include<stdio.h>intmain(intargc,char*argv[]){printf("Hello,David\n");return0;}2. 编译 gcc -o hello hello.c3. 执行 ./hello 阅读全文
posted @ 2012-05-03 09:34 Master HaKu 阅读(191) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示