2016年4月7日星期四

sclinux添加第三方源

CENTOS常用源官方指引
https://wiki.centos.org/AdditionalResources/Repositories
scientific linux常用源官方指引
https://www.scientificlinux.org/community/unofficial-resources/

1:安装YUM优先级插件
yum install yum-priorities.noarh

2:安装EPEL
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5[67].noarch.rpm
rpm -Uvh epel-release-latest-5.noarch.rpm

3:安装REMI,依赖于EPEL源,主要用于PHP,Mysql安装
wget http://rpms.remirepo.net/enterprise/remi-release-5[67].rpm
rpm -Uvh remi-release-5[67].rpm

4:安装rpmforge
此处选择正确的版本下载
rpm -Uvh XXX.rpm

5:对于scientific linux
yum search yum-conf 列出源
yum install yum-conf-XXX
yum repolist 查看使用了哪些源

2016年4月6日星期三

Atutor安装

1:安装Apache,开启httpd服务,开启防火墙
yum install httpdn
chkconfig httpd on
iptables -I RH-Firewall-1-INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-------------------------------------------------
-I 插入第一行
RH-Firewall-1-INPUT子链名
-p协议
--dport 80目标端口
-m模块
--state状态检测,NEW,ESTABLISHED,RELATED,INVALID
-j 跳转
ACCEPT同意
------------------------------------------------
service iptables save

2:修改hostname,hosts
vi /etc/sysconfig/network
HOSTNAME=lams.cqdlt.com
vi /etc/hosts
XXX.XXX.XXX.XXX lams.XXX.com

3:安装Mysql,开启Mysql服务,配置
yum install mysql-server
chkconfig mysqld onmysqladmin -u root password 'new-password' 设置root密码

mysql_secure_installation 初次配置
mysql -u root -p连接数据库
create database atutor;建立数据库atutor
create user 'atutor'@'localhost' identified by 'atutor123';建立数据
grant all on atutor.* to atutor@localhost;建立授权
flush privileges 使配置生效

4:安装PHP等包
yum install php php-mysql php-gd php-mbstring
vi /var/www/html/info.php
<?php
phpinfo();
?>
service httpd restart
通过客户端可以查看PHP信息

5:安装Atutor
cd /var/www/html
wget http://downloads.sourceforge.net/project/atutor/ATutor%202/ATutor-2.2.1.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fatutor%2Ffiles%2FATutor%25202%2F&ts=1459915090&use_mirror=jaist
tar -zxvf ATutor-2.2.1.tar.gz 解压包
chown -R apache:apache ATutor 修改目录用户
mkdir -p /var/www/ATutor/content建立文件存放目录
chown apache:apache content更改所有者
chmod 2777 content/修改权限
客户端访问开始安装
http://192.168.30.222/ATutor/

6:修改语言翻译
vi /var/www/html/ATutor/include/
修改为define ('AT_DEVEL_TRANSLATE',1);

Scientific Linux 虚拟机模板建立

1:将网卡设置为E1000,安装scientific linux5
linux text选择字符届面安装
选择跳过CD检查


Unselect所有安装选项
2:配置IP地址(参数明细)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
IPADDR=192.168.30.222
NETWORK=192.168.30.0
NETMASK=255.255.255.0
GATEWAY=192.168.30.1
使配置生效,/etc/init.d/network restart
配置DNS服务器
VI /etc/resolv.conf
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

3:使用setup程序进行配置
Setup配置验证网络服务等
4:更新
yum update
5:作为模板分发后IP地址失效解决(针对centos6)
在虚拟机配置文件中找到MAC地址,在下面两个文件中修改
编辑/etc/sysconfig/network-script/ifcfg-ethp
HWADDR
编辑/etc/udev/rules.d/70-persistant-net.rules
ATTR{address}==
重启网络

2014年12月11日星期四

Linux下执行脚本导出mysql表数据

mysql -uroot -ppassword asteriskcdrdb -e "select * from cdr" > b.txt
连接上mysql,使用root,password登录 asteriskcdrdb数据库,
执行select *from cdr并将数据内容输出至b.txt

2014年2月8日星期六

ubuntu 13.04 linphone enable g729

My HP 8540W installed Ubuntu 13.04, I want to install voip softphone, the first choice is Ekiga. After installed Ekiga, There was not G729 codec, so I give up.
The second choice is linphone,  serach in google, somebody saies install the linphone use ppa,  g729 can use.
Now, this is the step by step
1.add linphone source
sudo add-apt-repository ppa:linphone/release
2.updae the source
sudo apt-get update
3.install linphone
sudo apt-get install linphone
4.config the linphone
Open the Option menu -  preferences -  codecs, G729 was not in the codecs list,  but AMR in the list.
5.find out the difference between G729 and AMR
dpkg -L linphone-plugin-amr
the libmsamr.so model in this directory /usr/lib/mediastreamer/plugins
dpkg -L linphone-plugin-g729
the libmsbcg729.so model in this directory /usr/lib/x86_64-linux-gnu/mediastreamer/plugins/

6.copy the model to /usr/lib/mediastreamer/plugins
sudo cp -d /usr/lib/x86_64-linux-gnu/mediastreamer/plugins/libmsbcg729.*  usr/lib/mediastreamer/plugins

that's right! Now G729 in the codecs list, enjoy it


2014年1月24日星期五

eclipse sqlexplorer 配置

Install eclipas
HowTO
http://tutorialforlinux.com/2013/09/27/how-to-install-eclipse-ide-for-java-developers-ubuntu-13-04-raring13-10-saucy/
download eclipse from this sit
http://www.eclipse.org/downloads/

extract eclips package
sudo mv eclipse /opt
ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse

Install JDK
HowTo
http://tutorialforlinux.com/2013/10/23/how-to-install-oracle-java-jdk7-on-ubuntu-13-10-saucy-i386amd64-easy-visual-guide/
download Oracle jave JDK from this site
http://www.oracle.com/technetwork/java/javase/downloads/index.html

extract JDK package

relocate JDK7
sudo su
if [ ! -d '/usr/lib/jvm' ]; then mkdir /usr/lib/jvm; fi
mv /tmp/jdk1.7* /usr/lib/jvm/

update system java to oracle JDK
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7*/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7*/bin/javac 1065
update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.7*/bin/jar 1065
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7*/bin/javaws 1065
update-alternatives --config java

install Eclipse SQL Explorer
run eclipse, help-install new software
add Eclipse SQL Explorer site http://eclipsesql.sourceforge.net/

1:Microsoft SQL Server
http://www.microsoft.com/en-us/download/details.aspx?id=11774
sqljdbc_4.0.2206.100_enu.tar.gz
download sqljdbc_4.0.2206.100_enu.tar.gz

eclipse config
window-preferences-sql explorer-jdbc drivers-Microsoft MSSQL Server JDBC Driver

Edit - Extra Class Path
Add sqljdbc4.jar(atfer extract the tar.gz file)

Driver Class Name:
com.microsoft.sqlserver.jdbc.SQLServerDriver

Example URL:
jdbc:sqlserver://<server_name>:<1433>;databaseName=databasename
jdbc:sqlserver://192.168.2.73:1433;databaseName=dlt
---------------------------------------------------------------------------------------------------------------------

2:Oracle Thin Driver
download oracle thin client driver
eclipse config
window-preferences-sql explorer-jdbc drivers-Oracle Thin Driver


Edit - Extra Class Path
Add ojdbc14.jar.jar(atfer extract the file)

Driver class Name:
oracle.jdbc.driver.OracleDriver
Example URL:
jdbc:oracle:thin:@<server>:1521:<database_name>
jdbc:oracle:thin:@192.168.2.31:1521:erpg
---------------------------------------------------------------------------------------------------------------------

3:My Sql
dev.mysql.com/downloads/connector/j/
download mysql-connector-java-5.1.28.tar.gz

Edit - Extra Class Path
Add mysql-connector-java-5.1.28.jar(atfer extract the file)

Driver class Name:
com.mysql.jdbc.Driver

Example URL: 
jdbc:mysql://<hostname>[<:3306>]/<dbname>
jdbc:mysql://192.168.2.45:3306/test

 


















2014年1月23日星期四

ubuntu安装qq international

ubuntu版本:13.10
安装playonlinux
1:install a non-listed program
2: install a program in a new virtual drive
3:wine版本1.7.4
4:安装的库文件riched20 msxml6 ie8 vcrun2008

5:qq版本qq intl 2.1
6:重要一点,将windows目录内tahoma字体复制到windows,font目录
安装完毕后即可正常使用,不过密码只能用软键盘输入