Monday, September 10, 2012

Installing cpanm in ubuntu

Installing cpanm in ubuntu



sudo apt-get install cpanminus


and then install module  by module via cpanm


cpanm Time::Local


Thursday, September 6, 2012

Working with rpm files in ubuntu


Install alien in Ubuntu
sudo apt-get install alien
This will install all the required packages.Now you can start converting your .rpm files to .deb packages.
Available Options for alien
Convert the package.rpm into a package.deb
sudo alien -d package-name.rpm
Convert the package.rpm into a package.deb, and install the generated package.
sudo alien -i package-name.rpm
If you want to keeps alien from changing the version number use the following command
sudo alien -k rpm-package-file.rpm
Example
Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file
To convert .rpm to debian
sudo alien -k avg71lms-r30-a0782.i386.rpm
Now you should be having avg71lms-r30-a0782.i386.deb file
To install .deb file
sudo dpkg -i avg71lms-r30-a0782.i386.deb
If you don't use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

memcached starting option

To Overcome with connection failour error from cache client. ether client is in Java or any other language......you should start your memcached with sufficient memory space and with connection indicator....


memcached -m 18000 -l xxx.xxx.xxx.xxx -p 11211 -c 2048

For viewing about indicators like -m, -p....etc. please view my previous post....

Wednesday, September 5, 2012

memcached Optimization


Name

memcached - high-performance memory object caching system

Options

These programs follow the usual GNU command line syntax. A summary of options is included below.
-s <file>
Unix socket path to listen on (disables network support).
-a <perms>
Permissions (in octal format) for Unix socket created with -s option.
-l <ip_addr>
Listen on <ip_addr>; default to INADDR_ANY. This is an important option to consider as there is no other way to secure the installation. Binding to an internal or firewalled network interface is suggested.
-d
Run memcached as a daemon.
-u <username>
Assume the identity of <username> (only when run as root).
-m <num>
Use <num> MB memory max to use for object storage; the default is 64 megabytes.
-c <num>
Use <num> max simultaneous connections; the default is 1024.
-R <num>
This option seeks to prevent client starvation by setting a limit to the number of sequential requests the server will process from an individual client connection. Once a connection has exceeded this value, the server will attempt to process I/O on other connections before handling any further request from this connection. The default value for this option is 20.
-k
Lock down all paged memory. This is a somewhat dangerous option with large caches, so consult the README and memcached homepage for configuration suggestions.
-p <num>
Listen on TCP port <num>, the default is port 11211.
-U <num>
Listen on UDP port <num>, the default is port 11211, 0 is off.
-M
Disable automatic removal of items from the cache when out of memory. Additions will not be possible until adequate space is freed up.
-r
Raise the core file size limit to the maximum allowable.
-f <factor>
Use <factor> as the multiplier for computing the sizes of memory chunks that items are stored in. A lower value may result in less wasted memory depending on the total amount of memory available and the distribution of item sizes. The default is 1.25.
-n <size>
Allocate a minimum of <size> bytes for the item key, value, and flags. The default is 48. If you have a lot of small keys and values, you can get a significant memory efficiency gain with a lower value. If you use a high chunk growth factor (-f option), on the other hand, you may want to increase the size to allow a bigger percentage of your items to fit in the most densely packed (smallest) chunks.
-C
Disable the use of CAS (and reduce the per-item size by 8 bytes).
-h
Show the version of memcached and a summary of options.
-v
Be verbose during the event loop; print out errors and warnings.
-vv
Be even more verbose; same as -v but also print client commands and responses.
-i
Print memcached and libevent licenses.
-P <filename>
Print pidfile to <filename>, only used under -d option.
-t <threads>
Number of threads to use to process incoming requests. This option is only meaningful if memcached was compiled with thread support enabled. It is typically not useful to set this higher than the number of CPU cores on the memcached server. The default is 4.
-D <char>
Use <char> as the delimiter between key prefixes and IDs. This is used for per-prefix stats reporting. The default is ":" (colon). If this option is specified, stats collection is turned on automatically; if not, then it may be turned on by sending the "stats detail on" command to the server.
-L
Try to use large memory pages (if available). Increasing the memory page size could reduce the number of TLB misses and improve the performance. In order to get large pages from the OS, memcached will allocate the total item-cache in one large chunk. Only available if supported on your OS.
-B <proto>
Specify the binding protocol to use. By default, the server will autonegotiate client connections. By using this option, you can specify the protocol clients must speak. Possible options are "auto" (the default, autonegotiation behavior), "ascii" and "binary".
-I <size>
Override the default size of each slab page. Default is 1mb. Default is 1m, minimum is 1k, max is 128m. Adjusting this value changes the item size limit. Beware that this also increases the number of slabs (use -v to view), and the overal memory usage of memcached

===========================================================================

Storage Commands

set

Most common command. Store this data, possibly overwriting any existing data. New items are at the top of the LRU.

add

Store this data, only if it does not already exist. New items are at the top of the LRU. If an item already exists and an add fails, it promotes the item to the front of the LRU anyway.

replace

Store this data, but only if the data already exists. Almost never used, and exists for protocol completeness (set, add, replace, etc)

append

Add this data after the last byte in an existing item. This does not allow you to extend past the item limit. Useful for managing lists.

prepend

Same as append, but adding new data before existing data.

cas

Check And Set (or Compare And Swap). An operation that stores data, but only if no one else has updated the data since you read it last. Useful for resolving race conditions on updating cache data.

Retrieval Commands

get

Command for retrieving data. Takes one or more keys and returns all found items.

gets

An alternative get command for using with CAS. Returns a CAS identifier (a unique 64bit number) with the item. Return this value with the cascommand. If the item's CAS value has changed since you gets'ed it, it will not be stored.

delete

Removes an item from the cache, if it exists.

incr/decr

Increment and Decrement. If an item stored is the string representation of a 64bit integer, you may run incr or decr commands to modify that number. You may only incr by positive values, or decr by positive values. They does not accept negative values.
If a value does not already exist, incr/decr will fail.

Statistics

There're a handful of commands that return counters and settings of the memcached server. These can be inspected via a large array of tools or simply by telnet or netcat. These are further explained in the protocol docs.

stats

ye 'ole basic stats command.

stats items

Returns some information, broken down by slab, about items stored in memcached.

stats slabs

Returns more information, broken down by slab, about items stored in memcached. More centered to performance of a slab rather than counts of particular items.

stats sizes

A special command that shows you how items would be distributed if slabs were broken into 32byte buckets instead of your current number of slabs. Useful for determining how efficient your slab sizing is.
WARNING this is a development command. As of 1.4 it is still the only command which will lock your memcached instance for some time. If you have many millions of stored items, it can become unresponsive for several minutes. Run this at your own risk. It is roadmapped to either make this feature optional or at least speed it up.

flush_all

Invalidate all existing cache items. Optionally takes a parameter, which means to invalidate all items after N seconds have passed.
This command does not pause the server, as it returns immediately. It does not free up or flush memory at all, it just causes all items to expire.

Thursday, August 30, 2012

sums v/s iphone

 Tell me who is best one & way ????

MySql Permission for external client


GRANT SELECT ON `mysql`.`proc` TO root@192.168.10.209;
GRANT SELECT ON `mysql`.`proc` TO root@192.168.10.208;
GRANT SELECT ON `mysql`.`proc` TO root@192.168.10.207;

Grant All on ABC.* to root@192.168.10.209;
Grant All on ABC.* to root@192.168.10.208;
Grant All on ABC.* to root@192.168.10.207;

grant CREATE ROUTINE on ABC.* to root@192.168.10.209;
grant CREATE ROUTINE on ABC.* to root@192.168.10.208;
grant CREATE ROUTINE on ABC.* to root@192.168.10.207;

Log4j Layout Pattern


log4j.appender.R=org.apache.log4j.ConsoleAppender^M
log4j.appender.R.layout=org.apache.log4j.PatternLayout^M
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MMM-dd HH:mm:ss}-%t-%x-%-5p %-30.30c{1} %x - %m%n