knowhow

วิธีป้องกัน Malware สำหรับ Postfix

ขั้นตอนการทำ

1.) ดาว์โหลดไฟล์ Blacklist มาไว้บนเครื่อง

#wget -O - http://www.malware.com.br/cgi/submit?action=list_postfix > /etc/postfix/mbl-body-deny

2.) เปิดไฟล์ /etc/postfix/main.cf แล้วแก้ไขบรรทัดต่อไปนี้

body_checks = regexp:/etc/postfix/mbl-body-deny

หากไม่มีบรรทัด body_checks พิมพ์เข้าไปเองน่ะครับ

3.) สั่งให้ postfix โหลด /etc/postfix/mbl-body-deny เข้าทำงาน

อยากรู้ไหม เวลาดู apache status แล้ว งงๆ แต่ละอันมันคื

0-14

Srv
The ID of the child process and its generation. The generation increases each time a child process is restarted, whether due to a server-restart or a limit placed on the number of processes a child is allowed to handle. See the MaxRequestsPerChild directive.

29987

PID
The child's process ID.

Facebook challenge

 

From Jeff Rothschild, VP of technology, Facebook

  1. The power of connectedness
  2. Impact on the database
  3. Our challenge 
  • The power of connectedness
    • photo tagging
    • getting an email that someone tagged a photo in Facebook
    • inter tagging between friends and it continues as a network
    • outstanding growth because of the photo tagging
    • 26B photos in archive now
    • Most trafficked photos applications than anybody else
    • events, invites impact on social graph
    • Opening up the social graph to outside and create a platform and API, so other developers can make use of it (28K applications so far)
    • Hypergrowth because of the platform (1M users in four days)
    • 200 applications that has over million users
    • circle of connectivity can make the globe (with positive feedback, performance etc)
    • the social graph links everything
    • and that means lot of work for database
  • Impact on the database
    • user -> connections -> objects
    • interact with people, people has lot of data
    • 100 friends, 100 friends will have 100’s of objects/friend…10’s of thousands of possible objects
    • Horizontal partitioning supports parallel queries
    • 50K+ requests per second now
    • memcached can match speeds with the application
    • multi-threading with multi-core to take advantage with 1G cards
    • New C client which enhances run-time performance for PHP
    • New binary protocol for efficiency both ends (app and memcached)
    • Introduced memcached proxy to purge dirty records
    • MySQL replication to replicate data between data centers
    • Proxy is not a solution here due to replication
    • Changed Insert statements with MEMCACHE_DIRTY key1, keys …
    • Put more RAM in cache (95% hit rate is in cache)
    • 20M requests and only 500K requests goes to MySQL server
  • Optimizations
    • memory + servers (reduce to save $$$)
    • Tuning (moderate query scope, aggregate related data)
    • Partitioning (selective caching, archiving stale data)
  • Our Challenge
    • MySQL and memcached is a powerful combination
    • MySQL at the speed of memcached
    • memcache performance for simple tables
    • flash memory storage
    • dramatic improvement in I/O
    • supports higher miss rate
    • allows higher data/ram ratio
    • persistent “Cache”
      • flash for memcache
      • persistent distributed hash table could be a good fit
    • structured storage
      • not all data benefits
      • integrated cache and persistent replication
      • unmanaged distribution
    • A strong community is our challenge

แล้วเราจะปรับตัวไงบ้าง ช่วงนี้มีแต่คำว่า memcache

flickr architecture

วันนี้ไปเจอ เรื่องน่าสนใจมากจากเวปนี้เลย เอามาทิ้งๆ ไว้เผื่อใครสนใจอ่าน

http://www.highscalability.com/flickr-architecture

Flickr is both my favorite bird and the web's leading photo sharing site. Flickr has an amazing challenge, they must handle a vast sea of ever expanding new content, ever increasing legions of users, and a constant stream of new features, all while providing excellent performance. How do they do it?

Site: http://www.flickr.com/

subversion on ubuntu

To install subversion, open a terminal and run the following command:

sudo apt-get install subversion libapache2-svn

We're going to create the subversion repository in /svn, although you should choose a location that has a good amount of space.

sudo svnadmin create /svn

Next we'll need to edit the configuration file for the subversion webdav module. You can use a different editor if you'd like.

sudo gedit /etc/apache2/mods-enabled/dav_svn.conf

The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn

OCI8 PHP5 Ubuntu

OCI8 is an extension for providing APIs to Oracle database management system. However, installing OCI8 is not just easy like apt-get since it requires SDK offered by Oracle and its distribution license prohibits the inclusion to linux distribution. That means we have to download and compile it by ourselves. Fortunately, it is a little bit easy for Ubuntu.

Install PEAR and PECL

sudo apt-get install php-pear
Download Oracle Instant Client. You need at least Basic and SDK.

Extract the archives.

sudo mkdir -p /opt/oracle
cd /opt/oracle
sudo unzip instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip

Install NFS Server in Ubuntu

Install NFS Server in Ubuntu

sudo apt-get install nfs-kernel-server nfs-common portmap

When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap using the following

sudo vi /etc/default/portmap

or use the following command

sudo dpkg-reconfigure portmap

Restart Portmap using the following command

sudo /etc/init.d/portmap restart

NFS Server Configuration

NFS exports from a server are controlled by the file /etc/exports. Each line begins with the absolute path of a directory to be exported, followed by a space-seperated list of allowed clients.

Calculate mySQL memory

MySQL memory = key_buffer + max_connections * (join_buffer + record_buffer + sort_buffer + thread_stack + tmp_table_size)

OPTIMISING MYSQL

To obtain the stat of your mysql server since it has been loaded, run mysqladmin processlist extended-status as mentionned above.

1 - The two most important variables : Table_cache and Key_buffer_size

* If Opened_tables is big, then your table_cache variable is probably
too small.
table_cache 64
Open_tables 64
Opened_tables 544468

This is the first serious problem. "The table_cache is the number of open
tables for all threads. MySQL, being multi-threaded, may be running many

install new harddisk on ubuntu box

yesterday i got the problem after install new harddisk on ubuntu box and how to make filesystem and mount point on exinting system

my friend introduce me for step to fdisk and make.ext3 on new device

1. to fdisk the partiion of new device use follow this step

fdisk /dev/sdb
n
p
1
enter
enter
w

2. to make ext3 filesystem
mkfs.ext3 /dev/sdb1

and after step 2 new device is ready to mount

ps. don't forget edit /etc/fstab to add mount point after restart machine

Turn on hyperthreading on FreeBSD

to turn on this option follow this

www03# sysctl machdep.hyperthreading_allowed=1
machdep.hyperthreading_allowed: 0 -> 1

use top command and see multiple cpu was use

Syndicate content