http://www.infiniteloop.co.jp/blog/2012/10/linuxthermometer/
USB 溫度計
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
2013/07/17
2012/11/24
clinet snmp install
CentOS
yum -y install net-snmp
#install tools
#yum -y install net-snmp-utils
# setup secret
echo 'rocommunity XXXXXX' >> /etc/snmp/snmpd.conf
# setup snmp proxy
# squid sample
# proxy -v 1 -c public 127.0.0.1:3401 .1.3.6.1.4.1.3495
chkconfig snmpd on
service snmpd start
Ubuntu Server
apt-get install snmpd
#mv /etc/snmp/snmpd.conf snmpd.conf.old
#vim /etc/snmp/snmpd.conf
#rocommunity XXXXXX "ip address" (from monitor)
echo 'rocommunity XXXXXX "ip address" (from monitor) ' >> /etc/snmp/snmpd.conf
sudo /etc/init.d/snmpd restart
2012/11/23
Cacti install note
0.
yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi ntp php-gd rrdtool
1.
fc-cache -vfs
mysqladmin --user=root password mypassword
mysqladmin --user=root --password reload
# Install and Configure Cacti
mkdir -p /var/www/html/cacti
cd /var/www/html/
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar zxvf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a cacti
cd cacti
cd /var/www/html/cacti/cacti-0.8.8a
2.
service mysqld start
chkconfig mysqld on
#import Cacti SQL
mysqladmin -u root -p mypassword create cacti
mysql -u root -pmypassword cacti < cacti.sql
mysql -u root -pmypassword
# MySQL command
mysql> GRANT ALL ON cacti.* TO admin@localhost IDENTIFIED BY 'adminpassword';
mysql> flush privileges;
yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi ntp php-gd rrdtool
1.
fc-cache -vfs
mysqladmin --user=root password mypassword
mysqladmin --user=root --password reload
# Install and Configure Cacti
mkdir -p /var/www/html/cacti
cd /var/www/html/
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar zxvf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a cacti
cd cacti
cd /var/www/html/cacti/cacti-0.8.8a
2.
service mysqld start
chkconfig mysqld on
#import Cacti SQL
mysqladmin -u root -p mypassword create cacti
mysql -u root -pmypassword cacti < cacti.sql
mysql -u root -pmypassword
# MySQL command
mysql> GRANT ALL ON cacti.* TO admin@localhost IDENTIFIED BY 'adminpassword';
mysql> flush privileges;
3.
更改config.php成我們MySQL的username, password與url path,如下:
vi include/config.php
$database_username = "admin";
$database_password = "adminpassword";
$url_path = "/cacti/";
4.
更改目錄權限
chown -R apache:apache /var/www/html/cacti
chown -R admin /var/www/html/cacti/rra/ /var/www/html/cacti/log/
5.
crontab -e
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
service crond restart
service httpd start
chkconfig httpd on
chkconfig httpd on
2012/07/10
CentOS 6.2同一張網卡綁兩個IP
cp /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/network-scripts/ifcfg-em1:1
vi /etc/sysconfig/network-scripts/ifcfg-em1:1
DEVICE="em1:1"
HWADDR="D4:AE:52:B8:5D:95"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR="第二個IP"
NETMASK="255.255.255.0"
GATEWAY="192.168.0.1"
BOOTPROTO="static"
IPV6INIT="no"
ifup ifcfg-em1:1
如發生斷線
用新增的IP連入後啟動原先IP
ifcfg-em1
2012/04/30
Centos + httpd
yum -y install httpd
iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
service iptables save
vi /etc/httpd/conf/httpd.conf
/ Listen
add
--
Listen *:443
--
netstat -tlunp | grep httpd
關於SSL部分設定參閱
http://www.twisu.com.tw/5/linset/www1.htm
http://docdb.fnal.gov/doc/sslconf.html
http://www.twbsd.org/cht/book/ch14.htm
http://www.apache-ssl.org/httpd.conf.example
關於SSL部分設定參閱
http://www.twisu.com.tw/5/linset/www1.htm
http://docdb.fnal.gov/doc/sslconf.html
http://www.twbsd.org/cht/book/ch14.htm
http://www.apache-ssl.org/httpd.conf.example
2012/04/27
Linux 變更 Hostname
uname -a (VIEW HOSTNAME now)
hostname newname
vi /etc/sysconfig/network
HOSTNAME=newname
vi etc/hosts
127.0.0.1 localhost newname
uname -a (VIEW HOSTNAME now)
hostname newname
vi /etc/sysconfig/network
HOSTNAME=newname
vi etc/hosts
127.0.0.1 localhost newname
uname -a (VIEW HOSTNAME now)
2012/04/09
Spamassassin
vi /etc/mail/spamassassin/local.cf
# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)
# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.
required_hits 5
report_safe 0
rewrite_header Subject [SPAM]
whitelist_from *@watchdata.com
whitelist_from *@watchdata.com.cn
#whitelist_from *@gmail.com
header LOCAL_RCVD From =~ /(119.255.1.60|watchdata|.watchdata\.com.cn)/(mail.domain.com|ip address)/
describe LOCAL_RCVD Received from local machine
score LOCAL_RCVD -1000
service spamassassin restart
service postfix restart
2012/04/03
traceroute (centos)
yum -y install
traceroute
~
traceroute 192.168.0.1
traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 60 byte packets
1 router.corp.*.* (192.168.0.1) 0.673 ms 0.697 ms 0.785 ms
2012/02/14
2012/02/13
2012/01/18
Client host [209.85.214.172] blocked using bl.spamcop.net; Blocked
vi /etc/postfix/main.cf:
/
reject_rbl_client
remove list
/
reject_rbl_client
remove list
2011/12/29
Samba : Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
if
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
tree connect failed
vi /etc/samba/smb.conf
[global]
client lanman auth = yes
2011/12/13
LDAP start WARNING
[root@dogcage var]# service ldap start
/var/lib/ldap/ou.bdb is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.006 is not owned by "ldap" [WARNING]
/var/lib/ldap/log.0000000001 is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.003 is not owned by "ldap" [WARNING]
/var/lib/ldap/objectClass.bdb is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.002 is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.001 is not owned by "ldap" [WARNING]
/var/lib/ldap/alock is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.005 is not owned by "ldap" [WARNING]
/var/lib/ldap/__db.004 is not owned by "ldap" [WARNING]
/var/lib/ldap/dn2id.bdb is not owned by "ldap" [WARNING]
/var/lib/ldap/id2entry.bdb is not owned by "ldap" [WARNING]
Checking configuration files for slapd: [FAILED]
bdb_db_open: database "dc=ikala,dc=tv": alock package is unstable.
backend_startup_one: bi_db_open failed! (-1)
slap_startup failed (test would succeed using the -u switch)
stale lock files may be present in /var/lib/ldap [WARNING]
[root@dogcage var]# service ldap status
slapd is stopped
chown ldap:ldap -R /var/lib/ldap/
[root@dogcage var]# service ldap restart
Stopping slapd: [FAILED]
Checking configuration files for slapd: [WARNING]
bdb_db_open: database "dc=ikala,dc=tv": unclean shutdown detected; attempting recovery.
bdb_db_open: database "dc=ikala,dc=tv": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
config file testing succeeded
Starting slapd: [ OK ]
[root@dogcage var]# service ldap status
slapd (pid 9048) is running...
[root@dogcage var]#
2011/10/25
Linux add user userdel
useradd -s /sbin/nologin username
passwd username
userdel -r username
find / -user username
https://sites.google.com/site/hcsvieken/fedora-xue-xi/usermod
2011/10/24
Centos 5.5 install MySQL
Centos 5.5 install MySQL
yum -y install mysql-server
vi /etc/my.cnf
--
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set = utf8
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
default-character-set = utf8
--
chkconfig mysqld on
chkconfig --list mysqld
2-5 開啟
/etc/rc.d/init.d/mysqld start
--
正在初始化 MySQL 資料庫: Neither host 'ip位置' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
--
vi /etc/hosts
--
# Do not remove the following line, or various programs
# that require network functionality will fail.
#::1 localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
--
/etc/rc.d/init.d/mysqld start
mysqladmin -u root password 'Your Password'
yum -y install mysql-server
vi /etc/my.cnf
--
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set = utf8
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
default-character-set = utf8
--
chkconfig mysqld on
chkconfig --list mysqld
2-5 開啟
/etc/rc.d/init.d/mysqld start
--
正在初始化 MySQL 資料庫: Neither host 'ip位置' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
--
vi /etc/hosts
--
# Do not remove the following line, or various programs
# that require network functionality will fail.
#::1 localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
--
/etc/rc.d/init.d/mysqld start
mysqladmin -u root password 'Your Password'
2011/10/19
rename
rename ooxxooxx.ooxx oo.ooxx *
aba.xxx rename as aba
rename aba.xxx " " *
find . -name '*,v' -exec sh -c 'mv "$0" "${0%,v}"' {} \;
aba.xxx rename as aba
rename aba.xxx " " *
find . -name '*,v' -exec sh -c 'mv "$0" "${0%,v}"' {} \;
2011/10/18
cvs2git
這是在本地端的方法
需事先安裝cvs2git
cvs2git \
--blobfile=user/user-blob.dat \
--dumpfile=user/user-dump.dat \
--username=cvs2git \
/mnt/HDD/jspspace/user/ --fallback-encoding=big5
--
cvs2git \
--blobfile=原專案名稱/原專案名稱-blob.dat \
--dumpfile=原專案名稱/原專案名稱-dump.dat \
--username=cvs2git \
/mnt/HDD/原專案名稱/
Subscribe to:
Posts (Atom)