Aug 28, 2011

My VPS server can't send a mail... How to recover


My VPS server can't send a mail... How to recover

Status

1. "The last will keeping place" was not send me a mail.

2. I can't see reCAPTCHA's image at the login screen of "The last will keeping place".

Why? Checking my VPS server and ...

1. change reCAPTCHA public/private-key.

- no good. no effect.

2. change an access-method to reCAPTCHA, from "https" to "http".

- I can see reCAPTCHA's image, but...

- reCAPTCHA verify server doesn't reply. "Can't open socket"

- replace "recaptchalib.php" to the newest version.
- reset from "http" to "https" is going well, but..
- still, reCAPTCHA verify server doesn't reply.
- assign "reCAPTCHA verify server" as IP-address directly, not as an host name.
It's going well.

- And, I think the the DNS service has something wrong,

At this point, reCAPTCHA is well.
3. I check to send a mail from root-user to my gmail account.

- My VPS server can't send a mail. Why ???
- check nslookup, but there isn't "nslookup" in the server! so, I use "ping".
- "mail" command end successfully, but nothing is happen.
4. See many man pages... And check /var/log, /etc files, plesk-control-panel, ...

- restart sendmail, "/etc/init.d/"
That's it. Queuing old mails are flushed!

Result.

Why? - I don't know?
But, DNS and sendmail has something wrong.
I needed restart "sendmail".

Jan 28, 2011

Google translation from a server side.

I want to use the Google translation from a server side.
My Ideas are 1. run javascript on a server or 2. Direct http call to Google from server with PHP.

RESULT:

I selected "#2 Direct http call".

DETAIL:


1. run javascript on a server

I found "V8 JavaScript Engine".

"V8 JavaScript Engine" is a very good Engine,
but for me, it will take much time to make goolge objects in the V8.

How to install memo.

DOWNLOAD scons-2.0.1.tar.gz
# tar xzf scons-2.0.1.tar.gz
# cd scons-2.0.1
# python setup.py install --prefix=$HOME

# svn co http://google..... V8
# tar xzf scons-2.0.1.tar.gz
# cd v8
# scon
# cd samples
# g++ -I../include shell.cc -o shellv8 ../libv8.a -lpthread -m32

Test run javascript.

#./shellv8  test.js

test.js is:

print ('Hello' + ', World');
var x = 100;
var y = 200;
print ("x * y = " + (x * y));


Some objects, window and google, not implemented in shell.
It will take much time to make these objects.

2. Direct http call to Google from server PHP.

I re-read "Google Translate API Version 2".
it's is in Labs, but it has REST API.
REST is "Representational State Transfer".

like.
https://www.googleapis.com/language/translate/v2?key=AIzaSdkdN4TfYc0&q=flowers&source=en&target=fr&callback=handleResponse&prettyprint=true

Jan 5, 2011

How to quickly, randomly select and sort using MySQL?

(ENGLISH)
How to quickly, randomly select and sort a specified number of records from a table under some conditions using MySQL?
I think that it is very difficult.
My solution has an almost randomness.
Here, "much_more_number" is about twice or greater than "specified_number".
SQL likes...
"SELECT * (SELECT *, RAND() as random FROM (SELECT * FROM table WHERE conditions LIMIT much_more_number) as x ORDER random LIMIT specified_number) as y ORDER sort_conditions"

(JAPANESE)
MySQLを用いて、一定の検索条件に該当するレコードを指定された数だけランダムに抽出しそれをソートすることを高速に行う方法とは、
これを実現することはとても難しいと思われる。
私の解答は、まあまたランダムというものです。
ここで、"much_more_number"というのは、"specified_number"の二倍とかもっと大きな数です。
SQLは、こんな感じです。
"SELECT * (SELECT *, RAND() as random FROM (SELECT * FROM table WHERE conditions LIMIT much_more_number) as x ORDER random LIMIT specified_number) as y ORDER sort_conditions"

Dec 30, 2010

Oh My God! SSL Certs automatically renewed

My SSL certificate is automatically renewed !

They said,
"We just want to let you know we've automatically
renewed the following items according to our agreement:"

$49.99
$199.99

Wooooops!

Dec 15, 2010

How to get "set A - set B" in MySQL

How to get "set A - set B" in MySQL.

A is a table. Like a group of members.
B is a table. Like a woman list of people.

A has fields. "name, role, ...".
B has fields. "name, sex (= only woman), age, ...".

We want to get "set A - set B".
This is, in set operation, "A inter (not B)".
Also, this is "Not woman subet of A".

And the SQL is:
"SELECT * FROM A LEFT JOIN B ON A.name = B.name WHERE B.name is null;"

Dec 13, 2010

Our new SSL Certificate

Our new SSL Certificate

1. serached a cheaper SSL certs seller on Google.

2. found "CheapSSLs.com" and went there.

3. thought which is better "Geotrust Rapid SSL 9.95/yr" OR "Comodo PositiveSSL $8.95 ?"

  I selected Rapid SSL. becuase PositiveSSL is 1024 bit, it's samll.

4. thought which is better 1 year or 3 years or more?

 I choosed 1 year. bacause in the next year, it'll be more chaaper.
 and I'll be able to try it again.

5. Buy, it is very easy.

6. Next I must activate it. but my old SSL is not still expired,

   It'll be expired After Dec 17 16:07:40 2010 GMT.
  
   to be continued.

Dec 9, 2010

improved PHP mathpublisher

I improved "PHP mathpublisher 0.3".

- new features


"sqrt()" "blace" sizes are optimized.

mp : minus plus mark
$  : use NON-Italic font for a word


(Japanese font) : support Japanese font
(You must need IPA font http://ossipedia.ipa.go.jp/ipafont/index.html)

- Download

You can get it from

http://www.mylovewill.com/ya/phpmathpublisher-0.3-yaruben.tar.gz