Archive for the ‘ linux ’ Category

nginx wpmu lowendscript

server {
index index.html index.php;

    root /var/www/www.abc.com;

    rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;
    include /etc/nginx/fastcgi_php;
    location / {
    try_files $uri $uri/ /index.php?q=$uri;
    if (!-e $request_filename) {
    rewrite ^.+/?(/wp-.*) $1 last;
    rewrite ^.+/?(/.*.php)$ $1 last;
    rewrite . /index.php last;
         }
    }
}
เลียนแบบมาจาก articles.modoeye.com

memory – mtuser

1 blog mtuser.com
vps 128mb
root@vz2:~# free
total used free shared buffers cached
Mem: 262144 79296 182848 0 0 0
-/+ buffers/cache: 79296 182848
Swap: 0 0 0
root@vz2:~#

VPS 128MB

ย้ายอีกแล้ว
VPS 128/256Burst ราคา 15$/ปี ประมาณ 460 บาทต่อปี ไม่เปลือง ไม่มีสาระ เวบไม่ทำเงิน จ่ายแพงไปทำไม!!

เพิ่งทราบ buyvm.net ฮอทมาก 15$ ไม่ถึงวันหมด limit 300 slot 128MB/week เช็ค stock ได้ที่นี่
ตื่นมาสั่งซื้อ กลับมาเช็คอีกที out of stock buyvm ใช้เวลา setup 2 ชั่วโมงครึ่ง ใช้เวลาลองสคริป หลายชั่วโมง ลงๆลบๆ -*-
สคริปของ lowendbox รันบน server office เร็วปานจรวด
เอามาวาง buyvm แล้ว ใช้เน็ตทรูช้าตามอัตภาพ putty ไปตัวหนังสือขึ้นช้า ลบทีต้องรอ เซ็ง
ข้อเสียของสคริป
- web config เก็บไว้ใน site-enabled เลย (โดยปรกติจะอยู่ใน available แล้ว link มาใน enabled)
- ถ้าสั่งสร้าง vhost ใหม่ จะได้ dbuser เดิมแต่รหัสใหม่ (ถ้าใช้เวบเดียวไม่มีปัญหาอะไร ถ้าหลายเวบก็ลงเอง)
- ผลพวงจากการลองสั่งหลายเวบ dbuserเดิมรหัสใหม่ เวบเก่าเลยเดี้ยงเพราะรหัส วิธีแก้ไข pass user mysql จดไว้
update user set password=PASSWORD(“รหัสผ่าน”) where User=’userที่สร้างให้’;
- ไร้ innodb (wordpress ไม่ได้ใช้มั้ง)

mono 2.10.2

ลงเครื่องมือ

apt-get install build-essential pkg-config libglib2.0-dev bison libcairo2-dev libungif4-dev libjpeg62-dev libtiff4-dev gettext

ติดตั้ง mono 2.10.2,xsp 2.10,libgdiplus ติดตั้งไว้ที่ /opt/mono
Read more

how to config network in virtualbox

ทำการ set network เป็นแบบ bridge = เสมือนอยู่ใน network เดียวกันกับ  Host แล้ว

แก้ไข IP address เป็น fix ip วงเดียวกัน

จุดประสงค์เพื่อใช้ทดสอบ ออกภายนอกได้ forward port เข้ามาได้

 

 

 

 

 

 

munin-node Mysql5 Centos5

# yum install perl-Cache perl-Cache-Cache
# yum install perl-IPC-ShareLite perl-DBD-MySQL

cat /usr/local/directadmin/conf/mysql.conf
user=user
passwd=removed

nano /etc/munin/plugin-conf.d/munin-node
env.mysqlopts -u user -ppassword

ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugin/

สั่งรันใหม่ แล้วยังมี error

error Name "main::field" used only once: possible typo at /etc/munin/plugins/mysql_isam_space_ line 216
Plugin "exim_mailstats" exited with status 1024. --received.value 0

ตามไปลบ link plug in ที่มีปัญหา ออกจาก /etc/munin/plugins


แหล่งลอก 1 2 3

How to use Rtorrent

เข้า screen ไปสั่งรัน rtorrent

คำสั่งเบื้องต้น

screen –S xx1 สั่ง screen เปิด session ชื่อคำว่า xx1 ต่อท้าย

screen ctrl a d ออกจาก screenและ detached ไว้

screen –ls list ดู session

screen –r xx1.yyy resume session

screen –D xxx สั่งให้ session attached เป็น detached

เริ่ม

:~$ screen -ls
No Sockets found in /var/run/screen/S-web13_b.

เช็คว่า มี screen ที่ทำทิ้งไว้หรือเปล่า

หรือ :~$netstat -anp | grep 51005

51005 เป็นพอร์ตที่เซตไว้ เพื่อเช็คว่า ได้รันโปรแกรมทิ้งไว้หรือเปล่า

:~$screen –S 123

จะเปิดหน้าต่างหน้าว่าง (ขณะนี้อยู่บน screen 123 แล้ว)

web13_b@X:~$rtorrent

สั่งเปิดโปรแกรม rtorrent

กด ctrl a d เพื่อค้างหน้าทำงานหน้านี้ และออกไปหน้าแรก

เช็คพื้นที่

1:~$quota กด enter

Filesystem blocks quota        limit grace   files   quota   limit   grace
/dev/sda1 18970360 35840000 35841024             103       0       0

blocks size ปัจจุบัน

quota ที่จำกัดไว้

grace คือไรไม่รู้ ..

2:~$ du –hs กด enter
19G     .

FireSSH

สะดวกดี แก้ไขกับ nano บางครั้งเละเทะให้สับสนบ้าง

เวลากด copy/paste ให้กด shift ร่วมด้วย

เจ้าของเดียวกับ fireftp p p p p :P

Move torrent when job done

เพิ่ม

system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/ที่เก็บไฟล์/download/;d.set_directory=~/ที่เก็บไฟล์/download/"

 

โหลดเสร็จแล้วย้าย ไฟล์ยังทำงานอยู่ ใช้งานได้ จบ

DA – Your ip is blacklisted

DA already counts the number of login attempts from a certain IP.
This feature will simply block that IP if the number of attempts exceeds a certain threshold. (number is settable, default 100 and feature off). When the IP is added to the file (/usr/local/directadmin/data/admin/ip_blacklist, root ownership) the counter is also reset to 0, so if you remove the IP from the blaclist file, that IP will be able to make X number of attempts again.

สาเหตุจริงๆไม่รู้ จำรหัสไว้ใน Firefox แต่ดันเข้าไม่ได้ โดน block

The ip ’110.168.109.49′ has been added to the /usr/local/directadmin/data/admin/ip_blacklist file for having too many repeated failed login attempts into the ” account.

วิธีแก้

แก้ไข /usr/local/directadmin/data/admin/ip_blacklist เอา IP ออก