Thursday, January 28, 2010


   UPDATE customer_address SET default_address =1 WHERE address_id = ( 
   SELECT MIN(address_id) FROM (SELECT * FROM customer_address) AS temp
   WHERE customer_id =5 )    

Posted by Posted by WL at 3:21 PM
Categories:

0 comments  

Monday, January 25, 2010


ps -ef | grep -i {process-name} | grep -iv grep | head -1 | awk '{print $2} | xargs kill -9

Posted by Posted by WL at 12:31 PM
Categories:

0 comments  

mount -t iso9660 -o loop disk1.iso /mnt/disk

Posted by Posted by WL at 12:24 PM
Categories:

0 comments  

Add a user :

create user 'user'@'%' identified by 'pass';

Grant privileges :
grant all privileges on *.* to 'user'@'localhost' with grant option;
flush privileges

Set root password for the first time :
mysqladmin -u root password NEWPASSWORD

Posted by Posted by WL at 12:23 PM
Categories:

0 comments  

1. modify XF86Config and load module "vnc"
2. copy over vnc.so to /usr/X11R6/lib/modules/extensions/
3. add Option "SecurityTypes" "None" to Screens section to disable authentication

Posted by Posted by WL at 12:21 PM
Categories:

0 comments  

xargs:
find / -iname "*.mp3" -type f | xargs -I '{}' mv {} /mnt/mp3
find . -name C*.log | grep -e str1 -e str2 | grep -v str3 | xargs /usr/xpg4/bin/grep -e "35=D"


exec:
find / -iname "*.mp3" -exec mv {} /mnt/mp3 \;

Posted by Posted by WL at 11:41 AM
Categories:

0 comments  

Monday, January 18, 2010


Use a proxy.pac for automatic proxy configuration. Here is my file.

function FindProxyForURL(url, host) {
if(isInNet(host, "192.168.*.*", "255.255.0.0")) {
return "DIRECT";
} else if (host == "localhost") {
return "DIRECT";
} else {
return "PROXY localhost:9000";
}
}

This does following :
a. For all requests to ip address 192.168.*.* do not use a proxy and return DIRECT connection
b. For all requests to local webserver do not use proxy and return DIRECT connection
c. For any other requests use proxy server running at localhost:9000

Notes:
* host is NOT the machine requesting a page. Host is the name/ip of remote server
* url is the full url
* alert statement can be used to debug this function. This behaves just like a normal JS function

Posted by Posted by WL at 8:56 AM
Categories:

0 comments  

 
>