Recently in OpenSource Category
Type Information
----------------------------------------
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
Instead of type_id, you can also pass the keyword to the -t option of the dmidecode command. Following are the available keywords.
Keyword Types
------------------------------
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9
# dmidecode -t 16
#dmidecode -t 17
or
#dmidecode -t memory
[2hei.net]# ipmitool
No command provided!
Commands:
raw Send a RAW IPMI request and print response
i2c Send an I2C Master Write-Read command and print response
spd Print SPD info from remote I2C device
lan Configure LAN Channels
chassis Get chassis status and set power state
power Shortcut to chassis power commands
event Send pre-defined events to MC
mc Management Controller status and global enables
sdr Print Sensor Data Repository entries and readings
sensor Print detailed sensor information
fru Print built-in FRU and scan SDR for FRU locators
gendev Read/Write Device associated with Generic Device locators sdr
sel Print System Event Log (SEL)
pef Configure Platform Event Filtering (PEF)
sol Configure and connect IPMIv2.0 Serial-over-LAN
tsol Configure and connect with Tyan IPMIv1.5 Serial-over-LAN
isol Configure IPMIv1.5 Serial-over-LAN
user Configure Management Controller users
channel Configure Management Controller channels
session Print session information
sunoem OEM Commands for Sun servers
kontronoem OEM Commands for Kontron devices
picmg Run a PICMG/ATCA extended cmd
fwum Update IPMC using Kontron OEM Firmware Update Manager
firewall Configure Firmware Firewall
shell Launch interactive IPMI shell
exec Run list of commands from file
set Set runtime variable for shell and exec
hpm Update HPM components using PICMG HPM.1 file
ekanalyzer run FRU-Ekeying analyzer using FRU files
[2hei.net]# ipmitool event 3
Sending SAMPLE event: Memory - Correctable ECC
0 | Pre-Init Time-stamp | Memory #0x53 | Correctable ECC | Asserted
[2hei.net]# ipmitool sdr elist
CPU0 below Tmax | 7Bh | ok | 3.0 | 47 degrees C
CPU1 below Tmax | 7Ah | ok | 3.1 | 39 degrees C
DIMM0 Area(RT3) | 7Eh | ok | 7.0 | 30 degrees C
PCI Area(RT2) | 7Fh | ok | 7.0 | 36 degrees C
CPU0 VCORE | 71h | ok | 3.0 | 0.90 Volts
[2hei.net~]#mcelog --cpu nehalem --dmi < /var/log/mcelog >> /home/2hei.net/mcelog.dmi
CPU1 VCORE | 70h | ok | 3.1 | 1.02 Volts
3.3V | 75h | ok | 7.0 | 3.30 Volts
+12V | 76h | ok | 7.0 | 11.81 Volts
VBAT | 79h | ok | 7.0 | 3.12 Volts
5V | 77h | ok | 7.0 | 4.90 Volts
Sys.1(CPU 1) | 80h | ns | 7.0 | No Reading
Sys.2(CPU 0) | 81h | ok | 7.0 | 6720 RPM
Sys.3(Front 1) | 82h | ok | 7.0 | 4080 RPM
Sys.4(Front 2) | 83h | ok | 7.0 | 3840 RPM
Sys.5(Rear 1) | 84h | ok | 7.0 | 4200 RPM
Sys.6 | 85h | ns | 7.0 | No Reading
Sys.7 | 86h | ns | 7.0 | No Reading
Sys.8 | 87h | ns | 7.0 | No Reading
Sys.9 | 88h | ns | 7.0 | No Reading
Sys.10 | 89h | ns | 7.0 | No Reading
另外openssh-server也木有安装好,只能通过console手工安装。
cat ubuntu_ks.cfg
#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone --utc America/New_York
#Root password
rootpw --iscrypted $1$dIx6XYId$Grao2hlnjSQCXCbmdShWW1
#Initial user
user fisher --fullname "2hei" --iscrypted --password $1$yFK9gVs1$L9RHTs7B6oClIC4fonT.s/
#Reboot after installation
reboot
#Use text mode install
#text
graphical
#Install OS instead of upgrade
install
#Use Web installation
url --url http://2hei.net/install/ubuntu/9.10/
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
bootloader --location=mbr
#Disk partitioning information
#part raid.11 --size 20480 --asprimary --ondisk sda
#part raid.12 --size 100 --asprimary --ondisk sda
#part raid.13 --size 8192 --ondisk sda
#part raid.14 --size 1 --grow --ondisk sda
#part raid.21 --size 20480 --asprimary --ondisk sdb
#part raid.22 --size 100 --asprimary --ondisk sdb
#part raid.23 --size 8192 --ondisk sdb
#part raid.24 --size 1 --grow --ondisk sdb
#raid / --level=1 --device=md1 raid.11 raid.21
#raid /boot --level=1 --device=md0 raid.12 raid.22
#raid swap --level=1 --device=md2 raid.13 raid.23
#raid --level=1 --device=md3 raid.14 raid.24
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=static --ip=192.168.100.2 --netmask=255.255.255.0 --gateway=192.168.100.1 --nameserver=192.168.100.1 --device=eth0
#Firewall configuration
firewall --disabled --http --ssh
#X Window System configuration information
xconfig --depth=32 --resolution=800x600 --defaultdesktop=GNOME --startxonboot
%packages
@Ubuntu-desktop
openssh-server
$ ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
目标版本:
openssh-5.8p2.tar.gz
openssl-0.9.8r.tar.gz
compile and upgrade openssl-0.9.8r
wget http://www.openssl.org/source/openssl-0.9.8r.tar.gz
tar zxvf openssl-0.9.8r.tar.gz
mkdir -p /usr/src/redhat/SPECS/
mkdir -p /usr/src/redhat/SOURCES/
cp openssl-0.9.8r/openssl.spec /usr/src/redhat/SPECS/
cp openssl-0.9.8r.tar.gz /usr/src/redhat/SOURCES/
cd /usr/src/redhat/SPECS
#源码自带的SPEC文件有点问题,需要替换一下关键字License
perl -i.bak -pe 's/^Copyright: Freely distributable$/License: Freely distributable/' openssl.spec
[2hei.net ~]#rpmbuild -bb openssl.spec
#如果系统找不到rpmbuild,需要先安装
yum install rpm-build
yum install redhat-rpm-config
yum install pam-devel
#安装结束:
---
Wrote: /usr/src/redhat/RPMS/i386/openssl-0.9.8r-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/openssl-devel-0.9.8r-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/openssl-doc-0.9.8r-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/openssl-debuginfo-0.9.8r-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.36929
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd openssl-0.9.8r
+ rm -rf /var/tmp/openssl-0.9.8r-root
+ exit 0
---
[2hei.net ~]#cd /usr/src/redhat/RPMS/i386/
ls -l
-rw-r--r-- 1 root root 1198354 Jul 22 15:31 openssl-0.9.8r-1.i386.rpm
-rw-r--r-- 1 root root 117348 Jul 22 15:31 openssl-debuginfo-0.9.8r-1.i386.rpm
-rw-r--r-- 1 root root 2149166 Jul 22 15:31 openssl-devel-0.9.8r-1.i386.rpm
-rw-r--r-- 1 root root 596803 Jul 22 15:31 openssl-doc-0.9.8r-1.i386.rpm
rpm -Uvh openssl*.rpm
error: Failed dependencies:
libcrypto.so.6 is needed by (installed) python-2.4.3-27.el5.i386
libcrypto.so.6 is needed by (installed) openldap-2.3.43-12.el5.i386
libcrypto.so.6 is needed by (installed) curl-7.15.5-9.el5.i386
libcrypto.so.6 is needed by (installed) net-snmp-libs-5.3.2.2-9.el5.i386
...
libssl.so.6 is needed by (installed) python-2.4.3-27.el5.i386
libssl.so.6 is needed by (installed) openldap-2.3.43-12.el5.i386
libssl.so.6 is needed by (installed) curl-7.15.5-9.el5.i386
...
use --nodeps force install
rpm --nodeps -Uvh openssl-*.rpm
Preparing... ########################################### [100%]
1:openssl ########################################### [ 25%]
2:openssl-debuginfo ########################################### [ 50%]
3:openssl-devel ########################################### [ 75%]
4:openssl-doc ########################################### [100%]
#添加旧的链接库链接,使之支持已安装的其他软件的依赖:
[2hei.net ~]#cd /usr/lib
ln -s libcrypto.so.0.9.8 libcrypto.so.6
ln -s libssl.so.0.9.8 libssl.so.6
openssh的编译寄安装过程类似,不过要比openssl的简单一些,因为依赖关系少了很多,在此略去。。。
#重启sshd服务:
service sshd restart
#检查版本:
[root@test-test01 ~]# ssh -V
OpenSSH_5.8p2, OpenSSL 0.9.8r 8 Feb 2011
至此大功告成,不过升级openssl要谨慎,有可能影响其他服务,如httpd,openvpn等等,本文在vm上测试通过,权作记录备忘~
http://labs.renren.com/apache-mirror/cassandra/0.7.6-2/apache-cassandra-0.7.6-2-bin.tar.gz(apache官网推荐人人的mirror,不过link有问题 ^_^)
* tar -zxvf apache-cassandra-$VERSION.tar.gz
* cd apache-cassandra-$VERSION
* sudo mkdir -p /var/log/cassandra
* sudo chown -R `whoami` /var/log/cassandra
* sudo mkdir -p /var/lib/cassandra
* sudo chown -R `whoami` /var/lib/cassandra
Note: The sample configuration files in conf/ determine the file-system
locations Cassandra uses for logging and data storage. You are free to
change these to suit your own environment and adjust the path names
used here accordingly.
Now that we're ready, let's start it up!
#start up front
* bin/cassandra -f
2) two nodes configuration:
node1:192.168.46.155
node2:192.168.46.179
[2hei.net conf]$ cat cassandra.yaml
cluster_name: 'Test Cluster'
initial_token:
auto_bootstrap: false
hinted_handoff_enabled: true
max_hint_window_in_ms: 3600000 # one hour
hinted_handoff_throttle_delay_in_ms: 50
authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
authority: org.apache.cassandra.auth.AllowAllAuthority
partitioner: org.apache.cassandra.dht.RandomPartitioner
data_file_directories:
- /var/lib/cassandra/data
commitlog_directory: /var/lib/cassandra/commitlog
saved_caches_directory: /var/lib/cassandra/saved_caches
commitlog_rotation_threshold_in_mb: 128
commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000
flush_largest_memtables_at: 0.75
reduce_cache_sizes_at: 0.85
reduce_cache_capacity_to: 0.6
seeds:
- node2
concurrent_reads: 32
concurrent_writes: 32
memtable_flush_queue_size: 4
sliced_buffer_size_in_kb: 64
storage_port: 7000
listen_address: 192.168.46.155
rpc_address: 0.0.0.0
rpc_port: 9160
rpc_keepalive: true
thrift_framed_transport_size_in_mb: 15
thrift_max_message_length_in_mb: 16
incremental_backups: false
snapshot_before_compaction: false
column_index_size_in_kb: 64
in_memory_compaction_limit_in_mb: 64
compaction_preheat_key_cache: true
rpc_timeout_in_ms: 10000
endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch
dynamic_snitch: true
dynamic_snitch_update_interval_in_ms: 100
dynamic_snitch_reset_interval_in_ms: 600000
dynamic_snitch_badness_threshold: 0.0
request_scheduler: org.apache.cassandra.scheduler.NoScheduler
index_interval: 128
the same as node2,just need change
seeds:
- node1
cat /etc/hosts
192.168.46.155 node1
192.168.46.179 node2
Logs
#node1:
INFO 10:23:46,151 Listening for thrift clients...
INFO 10:23:46,315 Compacted to /var/lib/cassandra/data/system/LocationInfo-tmp-f-33-Data.db. 942 to 536 (~56% of original) bytes for 4 keys. Time: 178ms.
INFO 10:23:52,089 Node /192.168.46.179 has restarted, now UP again
INFO 10:23:52,095 Node /192.168.46.179 state jump to normal
INFO 10:24:02,177 Deleted /var/lib/cassandra/data/system/LocationInfo-f-32
INFO 10:24:02,179 Deleted /var/lib/cassandra/data/system/LocationInfo-f-31
INFO 10:24:52,097 Started hinted handoff for endpoint /192.168.46.179
INFO 10:24:52,100 Finished hinted handoff of 0 rows to endpoint /192.168.46.179
#node2:
INFO 10:23:51,930 Binding thrift service to /0.0.0.0:9160
INFO 10:23:51,939 Using TFastFramedTransport with a max frame size of 15728640 bytes.
INFO 10:23:51,988 Listening for thrift clients...
INFO 10:23:52,133 Node /192.168.46.155 has restarted, now UP again
INFO 10:23:52,137 Node /192.168.46.155 state jump to normal
INFO 10:23:53,548 InetAddress /192.168.46.155 is now dead.
INFO 10:23:53,646 InetAddress /192.168.46.155 is now UP
INFO 10:24:33,362 Started hinted handoff for endpoint /192.168.46.155
INFO 10:24:33,365 Finished hinted handoff of 0 rows to endpoint /192.168.46.155
3) use cassandra:
#check cluster:
[2hei.net apache-cassandra-0.7.6-2]$ bin/nodetool -host localhost ring
Address Status State Load Owns Token
168969914150282478893277211064871807700
192.168.46.155 Up Normal 53.28 KB 42.38% 70927753273796620281025030712152398970
192.168.46.179 Up Normal 45.16 KB 57.62% 168969914150282478893277211064871807700
#use cassandra-cli:
[2hei.net apache-cassandra-0.7.6-2]$bin/cassandra-cli --host localhost
[default@unknown] create keyspace FisherKeyspace;
2b1e86b8-ac65-11e0-9677-2edcd0f45bc6
Waiting for schema agreement...
... schemas agree across the cluster
[default@unknown] use FisherKeyspace;
Authenticated to keyspace: FisherKeyspace
[default@FisherKeyspace] create column family 2hei with comparator=UTF8Type and default_validation_class=UTF8Type;
3a0e8809-ac65-11e0-9677-2edcd0f45bc6
Waiting for schema agreement...
... schemas agree across the cluster
[default@FisherKeyspace] set Users[2hei][first] = 'Fisher';
Users not found in current keyspace.
[default@FisherKeyspace] set 2hei[2hei][first] = 'Fisher';
Value inserted.
[default@FisherKeyspace] set 2hei[2hei][last] = 'fishman';
Value inserted.
[default@FisherKeyspace] set 2hei[2hei][age] = long(42);
Value inserted.
[default@FisherKeyspace] get 2hei[2hei];
=> (column=age, value=42, timestamp=1310461245929000)
=> (column=first, value=Fisher, timestamp=1310461237981000)
=> (column=last, value=fishman, timestamp=1310461242014000)
Returned 3 results.
[default@unknown] show keyspaces;
Keyspace: FisherKeyspace:
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Factor: 1
Column Families:
ColumnFamily: 2hei
default_validation_class: org.apache.cassandra.db.marshal.UTF8Type
Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type
Row cache size / save period in seconds: 0.0/0
Key cache size / save period in seconds: 200000.0/14400
Memtable thresholds: 0.0234375/5/1440 (millions of ops/minutes/MB)
GC grace seconds: 864000
Compaction min/max thresholds: 4/32
Read repair chance: 1.0
Built indexes: []
#other useful command of nodetool
bin/nodetool -host localhost ring
bin/nodetool -host localhost info
[2hei.net apache-cassandra-0.7.6-2]$ bin/nodetool -host localhost info
70927753273796620281025030712152398970
Gossip active : true
Load : 57.4 KB
Generation No : 1310523824
Uptime (seconds) : 645
Heap Memory (MB) : 25.27 / 183.31
[2hei.net apache-cassandra-0.7.6-2]$ bin/nodetool -host localhost cfstats
Keyspace: FisherKeyspace
Read Count: 0
Read Latency: NaN ms.
Write Count: 0
Write Latency: NaN ms.
Pending Tasks: 0
Column Family: 2hei
SSTable count: 0
Space used (live): 0
Space used (total): 0
Memtable Columns Count: 0
Memtable Data Size: 0
Memtable Switch Count: 0
Read Count: 0
Read Latency: NaN ms.
Write Count: 0
Write Latency: NaN ms.
Pending Tasks: 0
Key cache capacity: 200000
Key cache size: 0
Key cache hit rate: NaN
Row cache: disabled
Compacted row minimum size: 0
Compacted row maximum size: 0
Compacted row mean size: 0
--------------------------------
接下来会继续完善cassandra的应用及api。
compile:
make sense
gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
gcc -DHAVE_LASTLOG_H -o chkwtmp chkwtmp.c
chkwtmp.c: In function ?.ain?.
chkwtmp.c:95: warning: incompatible implicit declaration of built-in function ?.xit?
gcc -DHAVE_LASTLOG_H -D_FILE_OFFSET_BITS=64 -o ifpromisc ifpromisc.c
gcc -o chkproc chkproc.c
gcc -o chkdirs chkdirs.c
gcc -o check_wtmpx check_wtmpx.c
gcc -static -o strings-static strings.c
gcc -o chkutmp chkutmp.c
Usage: ./chkrootkit [options] [testname ...]
Options:
-h show this help and exit
-V show version information and exit
-l show available tests
-d debug
-q quiet mode
-x expert mode
-r dir use dir as the root directory
-p dir1:dir2:dirN path for the external commands used by chkrootkit
-n skip NFS mounted dirs
sudo ./chkrootkit
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not found
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `crontab'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
Checking `echo'... not infected
Checking `egrep'... not infected
Checking `env'... not infected
Checking `find'... not infected
Checking `fingerd'... not found
Checking `gpm'... not infected
Checking `grep'... not infected
Checking `hdparm'... not infected
Checking `su'... not infected
Checking `ifconfig'... not infected
Checking `inetd'... not tested
Checking `inetdconf'... not found
Checking `identd'... not found
Checking `init'... not infected
Checking `killall'... not infected
Checking `ldsopreload'... not infected
Checking `login'... not infected
Checking `ls'... not infected
Checking `lsof'... not infected
Checking `mail'... not infected
Checking `mingetty'... not infected
Checking `netstat'... not infected
Checking `named'... not infected
Checking `passwd'... not infected
Checking `pidof'... not infected
Checking `pop2'... not found
Checking `pop3'... not found
Checking `ps'... not infected
Checking `pstree'... not infected
Checking `rpcinfo'... not infected
Checking `rlogind'... not found
Checking `rshd'... not found
Checking `slogin'... not infected
Checking `sendmail'... not infected
Checking `sshd'... not infected
Checking `syslogd'... not infected
Checking `tar'... not infected
Checking `tcpd'... not infected
Checking `tcpdump'... not infected
Checking `top'... not infected
Checking `telnetd'... not found
Checking `timed'... not found
Checking `traceroute'... not infected
Checking `vdir'... not infected
Checking `w'... not infected
Checking `write'... not infected
Checking `aliens'... no suspect files
Searching for sniffer's logs, it may take a while... nothing found
Searching for HiDrootkit's default dir... nothing found
Searching for t0rn's default files and dirs... nothing found
Searching for t0rn's v8 defaults... nothing found
Searching for Lion Worm default files and dirs... nothing found
Searching for RSHA's default files and dir... nothing found
Searching for RH-Sharpe's default files... nothing found
Searching for Ambient's rootkit (ark) default files and dirs... nothing found
Searching for suspicious files and dirs, it may take a while...
/usr/lib/gtk-2.0/immodules/.relocation-tag /lib/.libssl.so.0.9.8e.hmac /lib/.libcrypto.so.6.hmac /lib/.libcrypto.so.0.9.8e.hmac /lib/.libssl.so.6.hmac
Searching for LPD Worm files and dirs... nothing found
Searching for Ramen Worm files and dirs... nothing found
Searching for Maniac files and dirs... nothing found
Searching for RK17 files and dirs... nothing found
Searching for Ducoci rootkit... nothing found
Searching for Adore Worm... nothing found
Searching for ShitC Worm... nothing found
Searching for Omega Worm... nothing found
Searching for Sadmind/IIS Worm... nothing found
Searching for MonKit... nothing found
Searching for Showtee... nothing found
Searching for OpticKit... nothing found
Searching for T.R.K... nothing found
Searching for Mithra... nothing found
Searching for LOC rootkit... nothing found
Searching for Romanian rootkit... nothing found
Searching for HKRK rootkit... nothing found
Searching for Suckit rootkit... nothing found
Searching for Volc rootkit... nothing found
Searching for Gold2 rootkit... nothing found
Searching for TC2 Worm default files and dirs... nothing found
Searching for Anonoying rootkit default files and dirs... nothing found
Searching for ZK rootkit default files and dirs... nothing found
Searching for ShKit rootkit default files and dirs... nothing found
Searching for AjaKit rootkit default files and dirs... nothing found
Searching for zaRwT rootkit default files and dirs... nothing found
Searching for Madalin rootkit default files... nothing found
Searching for Fu rootkit default files... nothing found
Searching for ESRK rootkit default files... nothing found
Searching for rootedoor... nothing found
Searching for ENYELKM rootkit default files... nothing found
Searching for common ssh-scanners default files... nothing found
Searching for suspect PHP files... nothing found
Searching for anomalies in shell history files... nothing found
Checking `asp'... not infected
Checking `bindshell'... not infected
Checking `lkm'... chkproc: nothing detected
chkdirs: nothing detected
Checking `rexedcs'... not found
Checking `sniffer'... eth0: not promisc and no PF_PACKET sockets
eth0: not promisc and no PF_PACKET sockets
eth1: PF_PACKET(/usr/sbin/dhcpd)
Checking `w55808'... not infected
Checking `wted'... chkwtmp: nothing deleted
Checking `scalper'... not infected
Checking `slapper'... not infected
Checking `z2'... chklastlog: nothing deleted
Checking `chkutmp'... chkutmp: nothing deleted
Checking `OSX_RSPLUG'... not infected
1. yum install openvpn
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install epel-release-5-4.noarch.rpm
yum intall openvpn
vnp configs: 2hei.net.ovpn
add:
--script-security 2
up "/etc/openvpn/update-resolv-conf up"
down "/etc/openvpn/update-resolv-conf down"
script: update-resolv-conf
#!/bin/bash
case "$1" in
up)
mv /etc/resolv.conf /etc/resolv.conf.openvpn
echo "# Generated by OpenVPN Client UP Script" > /etc/resolv.conf
echo "search 2hei.net" > /etc/resolv.conf
for opt in ${!foreign_option_*};
do
#echo ${!opt} | sed -e 's/dhcp-option DOMAIN/domain/g' -e 's/dhcp-option DNS/nameserver/g' >> /etc/resolv.conf
echo ${!opt} | sed -e 's/dhcp-option DNS/nameserver/g' >> /etc/resolv.conf
done
#add orig nameserver
grep nameserver /etc/resolv.conf.openvpn >> /etc/resolv.conf
;;
down)
mv /etc/resolv.conf.openvpn /etc/resolv.conf
;;
*)
echo "Pass either UP or DOWN"
;;
esac
cat start_client_dc1.sh
#!/bin/sh
/usr/sbin/openvpn /etc/openvpn/2hei.net.ovpn
2. update firefox on centos
down load new version of firfox
ln -s /usr/local/firefox/firefox /usr/bin
3. use java web start on firefox
download new version of jre
sh ./jre-6u25-linux-x64-rpm.bin
alternatives --install /usr/bin/java java /usr/java/jre1.6.0_25/bin/java 2
alternatives --config java # pick 1 or 2 or 3
java -version
cd /usr/lib/mozilla/plugins
ln -s /usr/java/jre1.6.0_25/lib/amd64/libnpjp2.so
4. vnc
[2hei.net# .vnc]$ cat xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
start vncserver
vncserver
service nginx start
error.log:
2011/01/07 05:39:49 [emerg] 7180#0: eventfd() failed (38: Function not implemented)
2011/01/07 05:39:49 [alert] 7179#0: worker process 7180 exited with fatal code 2 and can not be respawn
2011/01/07 05:43:01 [emerg] 7296#0: eventfd() failed (38: Function not implemented)
2011/01/07 05:43:01 [alert] 7295#0: worker process 7296 exited with fatal code 2 and can not be respawn
[root@2hei.net /etc/nginx]# /usr/sbin/nginx -V
nginx version: nginx/0.8.53
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
TLS SNI support disabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-file-aio --with-mail_ssl_module --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
we can see --with-file-aio is been compiled at yum.
[root@2hei.net /etc/nginx]# yum list | grep aio
libaio.i386 0.3.106-3.2 installed
libaio.x86_64 0.3.106-3.2 installed
libsane-hpaio.x86_64 1.6.7-4.1.el5.4 installed
libaio-devel.x86_64 0.3.106-3.2 base
libaio-devel.i386 0.3.106-3.2 base
yum install libaio-devel
restart nginx still has such error.
Got a new stable version of nginx
nginx version: nginx/0.8.54
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
TLS SNI support disabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --add-module=/builddir/build/BUILD/nginx-0.8.54/nginx-upstream-fair
download link: nginx-stable-0.8.54-1.el5.x86_64.rpm
useful link:
http://forum.nginx.org/read.php?2,23577,153119#msg-153119
http://forum.nginx.org/read.php?2,150853,150853
wp-settings.php
change
define('WP_MEMORY_LIMIT', '32M');
to:
define('WP_MEMORY_LIMIT', '64M');
wordpress3.0
wp-config.php
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
add:
//allow memory size
define('WP_MEMORY_LIMIT', '64M');
#install openvpn and resovconf
$sudo apt-get install openvpn
$sudo apt-get install resovconf
$sudo cat client.conf.mytest
client
;dev tap
dev tun
;dev-node MyTap
proto tcp
;proto udp
remote your-vpn-domain 1001
remote your-vpn-domain 1002
remote-random
resolv-retry infinite
nobind
;user nobody
;group nogroup
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
ca /home/2hei.net/.vpn/ca.crt
cert /home/2hei.net/.vpn/client.crt
key /home/2hei.net/.vpn/client.key
ns-cert-type server
;tls-auth ta.key 1
;cipher x
comp-lzo
verb 3
;mute 20
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
#start openvpn
$sudo openvpn --script-security 3 --config /home/2hei.net/.vpn/client.conf.mytest




