วันอังคารที่ 28 สิงหาคม พ.ศ. 2555
Acronis True Image Home 2012
Serial: AKH7K4E3-XXN4H5BQ-CYP64NAA-WF98JT7T-CLFS3BBM-LKUMEJU4-N78YSFZ8-VZZEYMXW
Registry file to block checking for updates:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREAcronisTrueImageHomeSettings]
"AutocheckUpdates"=dword:00000000
Not sure if it still works beyond that however.
Also have user's help guide.
วันพุธที่ 22 สิงหาคม พ.ศ. 2555
แนะนำ โปรแกรม Zabbix
http://sourceforge.net/projects/zabbix/
วันพุธที่ 18 กรกฎาคม พ.ศ. 2555
การติดตั้ง bind 9 บน ClearOS 5.2
เกมส์ audition อัพแพทช์ผ่าน frox ชื่อโฮส auto3.asiasoft.co.th ซึ่งจะมี IP หลาย IP เช่น
122.155.11.6
203.144.132.4
203.144.132.118
203.144.132.119
203.144.132.120
ซึ่งต้องแก้ไขด้วยการติดตั้ง bind9 ซึ่งในขณะนี้คือรุ่น 9.3.6
bind-utils-9.3.6-4.P1.el5_5.3.i386.rpm
bind-chroot-9.3.6-4.P1.el5_5.3.i386.rpm
bind-libs-9.3.6-4.P1.el5_5.3.i386.rpm
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
ln -s ../../ chroot
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.root /var/named/chroot/var/named/named.root
หากมี bind รุ่นใหม่มาอาจต้องแก้ไปตามรุ่นที่ติดตั้ง /usr/share/doc/bind-9.x.x
touch /var/named/chroot/etc/named.conf
ตั้งค่า service bind ทุกครั้งหลัง restart server
chkconfig --levels 235 named on
สั้งให้ service bind ทำงาน
/etc/init.d/named start
จากนั้นเป็นการแก้ไขค่า config โดย
จากนั้น
nano rndc.key
algorithm hmac-md5;
secret "7gfPMW2w6DPngANRu2qQww4Cg59utJ2k";
};
จากนั้น แก้ไข file rndc.key ให้เหลือคล้ายๆแบบนี้ บรรทัดอื่นลบไปให้หมด
หมดขั้นตอนนี้ bind9 ก็ใช้งานได้
include "/var/named/chroot/etc/rndc.key";
controls {
inet 127.0.0.1 allow { 127.0.0.1; } keys { "rndckey"; };
inet 192.168.xx.x allow { 192.168.xx.0/24; } keys { "rndckey"; };
};
directory "/var/named";
pid-file "/var/run/named/named.pid";
127.0.0.1;
192.168.xx.0/24;
};
forwarders {
8.8.8.8;
202.69.137.137;
202.69.137.138;
203.121.130.39;
};
127.0.0.1;
192.168.xx.x;
};
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
#query-source address * port 53;
version "REFUSED";
127.0.0.1;
192.168.xx.0/24;
};
};
keys { rndckey; };
};
nameserver 127.0.0.1
include "/var/named/chroot/etc/audition.zone";
type master;
file "/var/named/chroot/etc/audition1.zone";
};
type master;
file "/var/named/chroot/etc/audition2.zone";
};
type master;
file "/var/named/chroot/etc/audition3.zone";
};
type master;
file "/var/named/chroot/etc/audition4.zone";
};
และไฟล์ audition2.zone ตั้งค่า auto2.asiasoft.co.th ไอพี 122.155.11.7 เป็นต้น
2003052800 86400 300 604800 3600 )
@ IN A 122.155.11.8
* IN A 122.155.11.8
2003052800 86400 300 604800 3600 )
@ IN A 122.155.11.4
* IN A 122.155.11.4
2003052800 86400 300 604800 3600 )
@ IN A 122.155.11.6
* IN A 122.155.11.6
2003052800 86400 300 604800 3600 )
@ IN A 122.155.11.5
* IN A 122.155.11.5
# service named restart
include "/var/named/chroot/etc/xshot.zone";
type master;
file "/var/named/chroot/etc/xshot2.zone";
};
@ IN SOA localhost. root.localhost. (
2003052800 86400 300 604800 3600 )
@ IN A 202.43.35.174
* IN A 202.43.35.174
วิธีติดตั้ง Bind9 บน ClearOS
วิธีติดตั้ง Bind9 บน ClearOS
chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf
chkconfig --levels 235 named on
service named start
cd /var/named/chroot/etc
rndc-confgen > rndc.key
chown root:named rndc.key
vi /var/named/chroot/etc/named.conf (แก้ไข หรือ Copy ให้ได้ตามตัวอย่างครับ และเปลี่ยน IP 192.168.1.0 ให้ ตรงกับ SERVER เราด้วย)
###############################################################
// we include the rndckey (copy-paste from rndc.key created earlier)
include "/var/named/chroot/etc/rndc.key";
// assume our server has the IP 192.168.1.254 serving the 192.168.1.0/24 subnet
controls {
inet 192.168.1.254 allow { 192.168.1.0/24; } keys { "rndckey"; };
inet 127.0.0.1 allow { 127.0.0.1; } keys { "rndckey"; };
};
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
recursion yes;
allow-recursion {
192.168.1.0/24;
127.0.0.1;
};
// these are the opendns servers (optional)
forwarders {
8.8.8.8;
208.67.222.222;
202.69.137.137;
202.69.137.138;
203.121.130.39;
};
listen-on {
192.168.1.254;
127.0.0.1;
};
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
#query-source address * port 53;
// so people can't try to guess what version you're running
version "REFUSED";
allow-query {
192.168.1.0/24;
127.0.0.1;
};
};
server 192.168.1.254 {
keys { rndckey; };
};
###########################################################
service named start
เครติดคุณ Ton-Or
วันอังคารที่ 15 พฤษภาคม พ.ศ. 2555
เทคนิคการดู พื้นที่ในแต่ละ Folder ของ Linux
เทคนิคการดู พื้นที่ในแต่ละ Folder ของ Linux
$ du / -h | grep "[0-9]G"
grep "[0-9]G" คือให้หยิบมาเฉพาะบรรทัดที่มี ตัวเลขตามด้วยอักษร G
ผลที่ได้จะออกมาประมาณนี้
7.6G /home/xxx/.VirtualBox/HardDisks
7.7G /home/xxx/.VirtualBox
18G /home/xxx
20G /home
พอลอง search เพิ่มเติม ก็พบว่ามันสามารถ sort ได้ด้วย
$du -h | grep "[0-9]G" | sort -n -r > du.txt
$du -h | grep "[0-9]G" | sort -n -r | less
วันอังคารที่ 8 พฤษภาคม พ.ศ. 2555
วันอาทิตย์ที่ 6 พฤษภาคม พ.ศ. 2555
block virus
มาปรับจูน DNS Server
วันพุธที่ 29 กุมภาพันธ์ พ.ศ. 2555
ข้อดีของการเช่าในระบบ Cloud Computing
Server แรง : SML ลงทุนเครื่อง Server ขนาดใหญ่ และหลายเครื่อง เพื่อให้งานของผู้ใช้ ทำงานรวดเร็ว ไม่สดุด แม้มีจำนวนผู้ใช้มาก
ใช้ได้ตลอดเวลา : ใช้งานได้ตลอด 24 ชม. แม้หน้าร้านปิดไปแล้ว ก็สามารถตรวจสอบข้อมูลที่บ้านได้
ลดการลงทุน : ท่านไม่ต้องซื้อ Server หลายหมื่นบาท และไม่ต้องจ้างพนักงานดูแลระบบ
ประหยัดค่าใช้จ่าย : ไม่ต้องเช่า Internet ความเร็วสูง หรือทำ Fixed IP สำหรับ Server ของท่าน เพราะ Cloud สามารถรองรับการใช้งานพร้อมกันได้ปริมาณมาก และที่สาขาสามารถใช้ Net อะไรก็ได้ เพื่อเข้าใช้ระบบ เช่น 3BB Hotsport ก็แค่เดือนละ 100 แค่นี้ก็เชื่อมสาขาได้ทุกที่
ปลอดภัย : เข้ารหัสถึงสองชั้น เพื่อป้องกันข้อมูลรั่วไหล
รวดเร็ว : ท่านสามารถขึ้นระบบได้ทันที และเชื่อมต่อสาขาได้ทันที
มั่นคง : มีระบบการสำรองข้อมูลให้ทุกเวลา โดยท่านสามารถ Backup ข้อมูลไปเก็บไว้ได้เอง
วันอาทิตย์ที่ 26 กุมภาพันธ์ พ.ศ. 2555
Percona XtraDB Cluster
http://www.percona.com/doc/percona-xtradb-cluster/index.html#
innotop The best top clone for MySQL, with special attention paid to InnoDB
innotop
The best top clone for MySQL, with special attention paid to InnoDB
[[Multi-Master Replication Manager for MySQL]]
http://mysql-mmm.org/
วันเสาร์ที่ 18 กุมภาพันธ์ พ.ศ. 2555
เทคนิคพิเศษ..ติดตั้ง Windows 7 ภายใน 15 นาที โดยใช้ USB
http://notebookspec.com/web/?p=6570
วันพุธที่ 30 พฤศจิกายน พ.ศ. 2554
Oracle 11g R2 64bits + Linux MINT 64bits
$ cd
$ sudo aptitude install unzip build-essential x11-utils rpm ksh lsb-rpm libaio1
$ wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3....
$ dpkg-deb -x libstdc++5_3.3.6-17ubuntu1_amd64.deb ia64-libs
$ sudo cp ia64-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib64/
$ cd /usr/lib64/
$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
$ cd
$ wget http://security.ubuntu.com/ubuntu/pool/universe/i/ia32-libs/ia32-libs_2....
$ dpkg-deb -x ia32-libs_2.7ubuntu6.1_amd64.deb ia32-libs
$ ls -l /usr |grep lib32
(ถ้าไม่ขึ้นอะไรมาให้ $sudo mkdir /usr/lib32)
$ sudo cp ia32-libs/usr/lib32/libstdc++.so.5.0.7 /usr/lib32/
$ cd /usr/lib32
$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
$ sudo su -
# addgroup oinstall
# addgroup dba
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
# mkdir /home/oracle
# chown -R oracle:dba /home/oracle
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/basename /bin/basename
# mkdir /etc/rc.d
# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done (ทำ debian ให้คล้าย redhat)
# mkdir -p /u01/app/oracle
# chown -R oracle:dba /u01
# passwd oracle
# echo "#">> /etc/sysctl.conf
# echo "# Oracle 11gR2 entries">> /etc/sysctl.conf
# echo "fs.aio-max-nr=1048576" >> /etc/sysctl.conf
# echo "fs.file-max=6815744" >> /etc/sysctl.conf
# echo "kernel.shmall=2097152" >> /etc/sysctl.conf
# echo "kernel.shmmni=4096" >> /etc/sysctl.conf
# echo "kernel.sem=250 32000 100 128" >> /etc/sysctl.conf
# echo "net.ipv4.ip_local_port_range=9000 65500" >> /etc/sysctl.conf
# echo "net.core.rmem_default=262144" >> /etc/sysctl.conf
# echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf
# echo "net.core.wmem_default=262144" >> /etc/sysctl.conf
# echo "net.core.wmem_max=1048586" >> /etc/sysctl.conf
# echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf
# echo "#Oracle 11gR2 shell limits:">>/etc/security/limits.conf
# echo "oracle soft nproc 2048">>/etc/security/limits.conf
# echo "oracle hard nproc 16384">>/etc/security/limits.conf
# echo "oracle soft nofile 1024">>/etc/security/limits.conf
# echo "oracle hard nofile 65536">>/etc/security/limits.conf
# sysctl -p
หลังจากนั้นให้ logout แล้ว login ด้วย user oracle
$ cp linux.x64_11gR2_database_* /tmp
$ cd /tmp
$ unzip linux.x64_11gR2_database_1of2.zip
$ unzip linux.x64_11gR2_database_2of2.zip
$ cd database
$ ./runInstaller
ตอนมันแสดงว่า Fail.... ให้ติ๊ก Ignore all (ถ้าติดตั้งใน redhat จะไม่เจอ)
ก่อนจะติดตั้งเสร็จ มันจะถามให้ run script ก็เปิด terminal ขึ้นมาอีกอันนึง
$ su - (user ที่ใช้งานปรกติ)
$ sudo su -
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
# nano /etc/oratab
orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N <------ เปลี่ยน "N" เป็น "Y"
ทดสอบ
https://localhost:1158/em
เกือบละ... อีกนิด
ทำให้ oracle start อัตโนมัติเมื่อเปิดเครื่อง
# nano /etc/profile
------------- เพิ่มท้ายไฟล์ ------------------
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin
export ORACLE_SID=orcl <---ถ้าตั้งไว้ชื่ออื่นก็เปลี่ยนด้วย
--------------------------------------------------
# nano /etc/init.d/oracledb
----------------- ก๊อปวางไปตามนี้ ------------------------------------
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/dbhome_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=orcl
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
touch /var/lock/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
--------------------------------------------------------------
# chmod a+x /etc/init.d/oracledb
# update-rc.d oracledb defaults 99
จบ
ปล. สามารถ start dbconsole (เข้า https://localhost:1158/em ได้) แบบ manual ได้โดย
$ su - oracle
$ emctl start dbconsole
ปิดโดย
$ emctl stop dbconsole
ที่มา
http://forums.oracle.com/forums/thread.jspa?threadID=1115155
http://www.pythian.com/news/13291/installing-oracle-11gr2-enterprise-edi...
http://www.pythian.com/news/968/installing-oracle-11g-on-ubuntu-804-lts-...
http://www.stefanocislaghi.eu/2009/12/28/unable-to-run-dbconsole-oc4j-co...
Linux HugeTLBfs: Improve MySQL Database Application Performance
Linux HugeTLBfs: Improve MySQL Database Application Performance
by VIVEK GITE on MAY 20, 2009 · 10 COMMENTS
Applications that perform a lot of memory accesses (several GBs) may obtain performance improvements by using large pages due to reduced Translation Lookaside Buffer (TLB) misses. HugeTLBfs is memory management feature offered in Linux kernel, which is valuable for applications that use a large virtual address space. It is especially useful for database applications such as MySQL, Oracle and others. Other server software that uses the prefork or similar (e.g. Apache web server) model will also benefit.
The CPU's Translation Lookaside Buffer (TLB) is a small cache used for storing virtual-to-physical mapping information. By using the TLB, a translation can be performed without referencing the in-memory page table entry that maps the virtual address. However, to keep translations as fast as possible, the TLB is usually small. It is not uncommon for large memory applications to exceed the mapping capacity of the TLB. Users can use the huge page support in Linux kernel by either using the mmap system call or standard SYSv shared memory system calls (shmget, shmat).
Only selected hardware and operating system support memory pages greater than the default 4KB. The following configuration tested on RHEL 5.3 64 bit using a stock kernel with tons of RAM and multiple CPUs.
How do I verify that my kernel supports hugepage?
Type the following command:$ grep -i huge /proc/meminfo
Sample output:
HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB
The kernel built with hugepage support should show the number of configured hugepages in the system. Otherwise, you need to be built Linux kernel with the CONFIG_HUGETLBFS option.
How do I configure HugeTLBfs?
The HugeTLBfs feature permits an application to use a much larger page size than normal, so that a single TLB entry can map a larger address space. A HugeTLB entry can vary in size. For example, i386 architecture supports 4K and 4M (2M in PAE mode) page sizes, ia64 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, 256M and ppc64 supports 4K and 16M. To allocate hugepage, you can define the number of hugepages by configuring value at /proc/sys/vm/nr_hugepages, enter:# sysctl -w vm.nr_hugepages=40
Above command will try to configure 40 hugepages in the system. Now, run the following again:# grep -i huge /proc/meminfo
Sample output:
HugePages_Total: 40 HugePages_Free: 40 HugePages_Rsvd: 0 Hugepagesize: 2048 kB
Where,
- HugePages_Total: 40 - The size of the pool of hugepages. On busy server with 16/32GB RAM, you can set this to 512 or higher value.
- HugePages_Free: 40 - The number of hugepages in the pool that are not yet allocated.
- HugePages_Rsvd: 0 - The number of hugepages for which a commitment to allocate from the pool has been made, but no allocation has yet been made.
- Hugepagesize: 2048 kB -
Configure MySQL to use HugeTLBfs
In MySQL, large pages can be used by InnoDB, to allocate memory for its buffer pool and additional memory pool. Find mysql user id:# id mysql
Sample output:
uid=27(mysql) gid=27(mysql) groups=27(mysql)Open /etc/sysctl.conf:
# vi /etc/sysctl.confAdd the following configuration:
# Set the number of pages to be used. # Each page is normally 2MB, so a value of 40 = 80MB. # Set it 512 or higher if you have lots of memory vm.nr_hugepages=40 # Set the group number (mysql group number is 27) that is allowed to access this memory. The mysql user must be a member of this group. vm.hugetlb_shm_group=27 # Increase the amount of shmem allowed per segment # This depends upon your memory, remember your kernel.shmmax = 68719476736 # Increase total amount of shared memory. kernel.shmall = 4294967296
Save and close the file. Reload settings:# systclt -p
Open /etc/my.cnf:# vi /etc/my.cnf
Add large-pages options
[mysqld] large-pages datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # rest of config...
Save and close the file. Open /etc/security/limits.conf, enter:# vi /etc/security/limits.conf
Append the following line to set max locked-in-memory address space to unlimited:
@mysql soft memlock unlimited @mysql hard memlock unlimited
Save and close the file. Finally, restart the mysql server:# /etc/init.d/mysqld restart
A note about mount command option
If your application uses huge pages through the mmap() system call, you have to mount a file system of type hugetlbfs like this:# mount -t hugetlbfs none /myapp
Another example, with more control over uid, gid and other options:
# mount -t hugetlbfs -o uid={value},gid={value},mode={value},size={value},nr_inodes={value} none /myappFurther readings:
- Please refer to kernel documentation in Documentation /vm/hugetlbpage.txt for more information. MySQL large memory support help page.
- man page - mount

