Sunday, November 12, 2006

Convert from VCD to mp4

first, i got sony ericsson m600i, and sony psp, that able to play movies, and is support mp4. and, i got many vcd that i have not whatched, because i dont have a lot of time to stay in front of my home theatre (i mean, tv + vcd player ... :D). so, i only have time when i'm boring in the middle of meeting, or in the middle of seminar, or when in the train. then my m600i and psp helps alot. so, if you want to convert your vcd to mp4, you are on the right place. but, i only do it from vcd to mp4. and using VLC Media player, and 3gp converter. 3gp converter is the gui of ffmpeg.

first, open VLC Media Player,
from menu -> file -> open file
choose the vcd file (ex: avseq01.dat)
above the "OK" butten, check "Stream output" then click "Settings..."
in the "output methods" section,
check "File", then click "Browse..." and select the destination you wish to save the output file.
ex: file1.mpg
in the "transcoding options" section,
check "Video codec", choose: mp4v, 1024, 1
check "Audio codec", choose: mp4a, 192, 2
then click "OK"
and then click "OK" again

this time, vlc will convert the file, from vcd, to mp4.
you will see the progress bar and timer is moving fast.

after it finished creating file1.mpg, open the 3gp converter
select the output format, for m600i or psp, i'm using QVGA/15fps/216kbps Stereo/96kbps
and select the output destination, and then, drag the file1.mpg and drop it to the 3gp_converter.
if everything ok, it should be automaticaly working on converting the file1.mpg to your destination directory, you will find file1.mp4 and file1.thm. if you would like to play it from your m600i, you only need to copy file1.mp4 to the video directory, but if you would like to play it from psp, you must rename the file1.mp4 and file1.thm to M4Vxxxxx.MP4 and M4Vxxxxx.THM and copy it to MP_ROOT/100MNV01/ in the psp. xxxxx -> sequence number, ex: M4V00001.MP4 and M4V00001.THM

now, you can play your vcd anytime you have the time ....

salaam

Wednesday, November 08, 2006

microsoft exchange: add email (part 2)

ok, i have the solution for both creating email adress and reset the password at once.
and still using that csvde and net user command line interface. in this page, you will also find dsrm command line to delete an email address. and for the script, i'm using PHP, and some pear packages. so, it will be a script to create an email address and reset the password on microsoft exchange 2003 using PHP.

the file you should find on this page is:
  • email.add.php -> php script to create email and reset the password on microsoft exchange server
  • email.del.php -> php script to delete email from microsoft exchange server
  • do.email.add.php -> interface to add an email address using email.add.php
  • do.email.del.php -> interface to delete an email address using email.del.php
first, you must have PHP installed on your microsoft exchange server, it is up to you, using MS IIS, or Apache as the web server, but i recomend you to use Apache as it is easy to maintain. and if you using Apache, i recomend you to install the web service on port 8080. and then make sure that there is nobody can access that web service on port 8080 is only your server that will integrate the microsoft exchange email provisioning application.

ok, this is the php script to create and reset the password
<?
//--[create email and reset password]-----------------------------------------------
$dc1 = $_POST["dc1"];
$dc2 = $_POST["dc2"];
$un = $_POST["un"];
$gn = $_POST["gn"];
$fn = $_POST["fn"];
$ln = $_POST["ln"];

$csv_user = <<<CSV
DN,objectClass,name,homeMDB,cn,displayName,mail,givenName,proxyAddresses,sAMAccountName,sn,userAccountControl,userPrincipalName,homeMTA,msExchHomeServerName,mailNickname,countryCode,c,l,homePhone,mobile,telephoneNumber,co,wWWHomePage
"CN=$gn,CN=Users,DC=$dc1,DC=$dc2",user,$gn,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=$dc1,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=$dc1,DC=$dc2",$gn,$gn,$un@$dc1.$dc2,$fn,SMTP:$un@$dc1.$dc2;X400:c=us\;a= \;p=$dc1\;o=Exchange\;s=$ln\;g=$fn\;,$un,$ln,512,$un@$dc1.$dc2,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=Imofis,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=$dc1,DC=$dc2",/o=$dc1/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,$un,376,ID,Jakarta,,,,Indonesia,
CSV;
$csv_file = "tmpdir\\".date("Y.m.d.h.m.i.")."$un.csv";
$file_handler = fopen($csv_file, "w");
$ok = true;
if (fwrite($file_handler, $csv_user) === false) {
$ok = false;
$err = 1;
$msg = "can not create user file";
$ret = "<?xml version='1.0'?>".
"<response>".
"<code>$err</code>".
"<description>$msg</description>".
"</response>";
fclose($file_handler);
echo $ret;
}
if ($ok) {
$dump = `csvde -i -f $csv_file`;
if (eregi("The specified user already exists.", $dump)) {
$err = 1;
$msg = "The specified user already exists.";
$ret = "<?xml version='1.0'?>".
"<response>".
"<code>$err</code>".
"<description>$msg</description>".
"</response>";
echo $ret;
} else {
$ret1 = "<pre>$dump</pre>";
$dump = `net user $un Pa$$w0rd`;
$ret2 = "<pre>$dump</pre>";
$dump = `del $csv_file`;
$err = 0;
$msg = $ret1.$ret2;
$ret = "<?xml version='1.0'?>".
"<response>".
"<code>$err</code>".
"<description>$msg</description>".
"</response>";
echo $ret;
}
unlink($csv_file);
}

//-----------------------------------------------[create email and reset password]--
?>

save the file in the webroot of Apache as email.add.php
now, you only need an interface to create an email address using that script from other server, or from that server it self. the script must post these parameters:
  • first name (fn)
  • last name (ln)
  • given name (gn)
  • user name (un)
  • domain (dc1)
  • domain prefix (dc2)
here is a sample of an interface that create an email address using email.add.php
<--[interface create email]----------------------------------------------->
<html>
<body>
<form method="POST" action="">
email: <input type="text" name="email" value="<?= $_POST["email"] ?>"><br>
name: <input type="text" name="name" value="<?= $_POST["name"] ?>"><br>
<input type="submit" name="action" value="Add">
</form>
</body></html>
<?
require_once 'HTTP/Client.php';
$client =& new HTTP_Client();
//--[fetch and submit email creation]-----------------------------------------------
$email = $_POST["email"];
$name = $_POST["name"];
$x = split("@", $email);
$un = $x[0];
$d = split("\.", $x[1]);
$dc1 = $d[0];
$dc2 = $d[1];
$n = split(" ", $name);
$fn = $n[0];
$ln = $n[count($n) - 1];
$x = $client->post("http://the.server.name:8080/email.add.php",
array(
"dc1" => $dc1,
"dc2" => $dc2,
"un" => $un,
"gn" => $name,
"fn" => $fn,
"ln" => $ln
));

echo "<pre>";
print_r($client->currentResponse());
echo "</pre>";
//-----------------------------------------------[fetch and submit email creation]--
?>
<--[interface create email]----------------------------------------------->
save it to your apache webserver directory, name it do.email.add.php
yes, you only need to fill the name and email address in the form, and submit it.

and this is the script to delete an account using php
<?
//--[delete email]-----------------------------------------------
$dc1 = $_POST["dc1"];
$dc2 = $_POST["dc2"];
$un = $_POST["un"];
$gn = $_POST["gn"];
$cmd = "dsrm -subtree -noprompt -c \"cn=$gn,cn=Users,dc=$dc1,dc=$dc2\"";
$dump = `$cmd`;
$err = 0;
$msg = $dump;
$ret = "<?xml version='1.0'?>".
"<response>".
"<code>$err</code>".
"<description>$msg</description>".
"</response>";
echo $ret;
//-----------------------------------------------[delete email]--
?>
and save it to email.del.php
and this is the sample of the interface
<--[interface drop email]----------------------------------------------->
<html>
<body>
<form method="POST" action="">
email: <input type="text" name="email" value="<?= $_POST["email"] ?>"><br>
name: <input type="text" name="name" value="<?= $_POST["name"] ?>"><br>
<input type="submit" name="action" value="Drop">
</form>
</body></html>
<?
require_once 'HTTP/Client.php';
$client =& new HTTP_Client();
//--[fetch and submit email deletion]-----------------------------------------------
$email = $_POST["email"];
$name = $_POST["name"];
$x = split("@", $email);
$un = $x[0];
$d = split("\.", $x[1]);
$dc1 = $d[0];
$dc2 = $d[1];
$n = split(" ", $name);
$fn = $n[0];
$ln = $n[count($n) - 1];
$x = $client->post("http://the.server.name:8080/email.del.php",
array(
"dc1" => $dc1,
"dc2" => $dc2,
"un" => $un,
"gn" => $name,
"fn" => $fn,
"ln" => $ln
));

echo "<pre>";
print_r($client->currentResponse());
echo "</pre>";
//-----------------------------------------------[fetch and submit email deletion]--
?>
<--[interface drop email]----------------------------------------------->
and save it to your apache web root directory, name it do.email.del.php
ok, thats all i have got to share to you.

but, if you have better solution, i would be very happy if you share your solution to me.

salaam

Tuesday, November 07, 2006

microsoft exchange: add email

afaik, microsoft exchange server 2003 does not have any utility to add email from other computer. it will make an email administrator confused if he was asked by their boss to add email address for the new employee that has just joined. or if you work on an internet service provider, and your company using microsft exchange server as the email server for the customer, every new customer register the account, you must go to the server, remote the server, and open the active directory users and computers window, to add a new user. imagine if there are more than 250 customer waiting for the email address that they have subscribed for. you will get 'ngelu bin pusing tujuh keliling' handling those email creation manualy.

microsoft active directory, has some command line interface to import or export active directory objects. it called csvde. with csvde, we can import/export from/to a bulk of csv file.

ok, lets make it quick, create a csv file like this:

DN,objectClass,name,homeMDB,cn,displayName,mail,givenName,proxyAddresses,sAMAccountName,sn,userAccountControl,userPrincipalName,homeMTA,msExchHomeServerName,mailNickname,countryCode,c,l,homePhone,mobile,telephoneNumber,co,wWWHomePage
"CN=kang parmin,OU=Users,DC=kucing,DC=net",user,kang parmin,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",kang parmin,kang parmin,kangl@kucing.net,kang,SMTP:kangl@kucing.net;X400:c=us\;a= \;p=kucing\;o=Exchange\;s=parmin\;g=kang\;,kangl,parmin,512,kangl@kucing.net,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",/o=kucing/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,kangl,376,ID,Jakarta,62-214534545,62-21345345,62-214534545,INDONESIA,www.kucing.net
"CN=mang parmin,OU=Users,DC=kucing,DC=net",user,mang parmin,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",mang parmin,mang parmin,mangl@kucing.net,mang,SMTP:mangl@kucing.net;X400:c=us\;a= \;p=kucing\;o=Exchange\;s=parmin\;g=mang\;,mangl,parmin,512,mangl@kucing.net,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",/o=kucing/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,mangl,376,ID,Jakarta,62-219879878,62-21878345,62-219879878,INDONESIA,www.msn.co.il
"CN=lek parmin,OU=Users,DC=kucing,DC=net",user,lek parmin,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",lek parmin,lek parmin,lekl@kucing.net,lek,SMTP:lekl@kucing.net;X400:c=us\;a= \;p=kucing\;o=Exchange\;s=parmin\;g=lek\;,lekl,parmin,512,lekl@kucing.net,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",/o=kucing/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,lekl,21,ID,Jakarta,376-212424478,62-21654654,62-212424878,INDONESIA,www.cnn.com
"CN=pakde parmin,OU=Users,DC=kucing,DC=net",user,pakde parmin,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",pakde parmin,pakde parmin,pakdel@kucing.net,pakde,SMTP:pakdel@kucing.net;X400:c=us\;a= \;p=kucing\;o=Exchange\;s=parmin\;g=pakde\;,pakdel,parmin,512,pakdel@kucing.net,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",/o=kucing/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,pakdel,376,ID,Jakarta,62-218768767,62-21456658,62-218768767,INDONESIA,www.cnn.com
"CN=mbah parmin,OU=Users,DC=kucing,DC=net",user,mbah parmin,"CN=Mailbox Store (SERVER100),CN=First Storage Group,CN=InformationStore,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",mbah parmin,mbah parmin,mbahl@kucing.net,mbah,SMTP:mbahl@kucing.net;X400:c=us\;a= \;p=kucing\;o=Exchange\;s=parmin\;g=mbah\;,mbahl,parmin,512,mbahl@kucing.net,"CN=Microsoft MTA,CN=SERVER100,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=kucing,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=kucing,DC=net",/o=kucing/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=SERVER100,mbahl,376,ID,Jakarta,62-215645446,62-21978879,62-215645446,INDONESIA,www.disney.com

and save it to test1.csv

from the command line, go to the directory that you save test1.csv, and run

csvde -i -f test1.csv

this command, will create all that 5 users in the active directory in the csv file, as well as the email address.

oops, i forgot to tell you, you must disable the password requirements in windows domain security policy. (open domain security policy -> account policies -> password policy, set Minimum password length = 0, and set Password must meet complexity requirements to Disabled). and run again

csvde -i -f test1.csv

ok, now that 5 users and email address already created, but, with no password.
to set the password, you can use net command:

net user mbah1 Pa$$w0rd

this command will set the user and email password for user mbah1 to Pa$$w0rd.

and if on the csv file is containing 5 users, you must type that command 5 times.
yes, it is not effective, but this is the only way .... sorry.

but, don't wory, i will give you the solution of this f***ing hell problem.
ofcourse not in this page, i will write it later.

salaam

./learn.to.type

belajar mengetik,
learn to type,

menggunakan 10 jari kita untuk mengetik memanglah tidak susah, jika memang kita sudah pernah belajar mengetik 10 jari menggunakan mesin ketik yang sangat keras dan licin pijakanya.
using our 10 finger to type is not dificult if we have learnt typing using our 10 finger on the hard and slippery type writter.

tips mengetik 10 jari menurut saya:
tips typing using 10 finger from me:
  • pastikan 2 jari telunjuk pada huruf 'F' untuk tangan kiri, dan huruf 'J' pada tangan kanan dan pada tombol space untuk kedua ibu jari.
  • make sure 2 of our index finger is on letter 'F' for the left side, and letter 'J' for the right side, on on the space bar for both of thumb.
  • untuk tangan kiri, dari kelingking - telunjuk, pastikan selalu standby di atas huruf 'A', 'S', 'D', 'F'
  • for the left hand, from litle finger to index finger, make sure always standby on key 'A', 'S', 'D', 'F'
  • untuk tangan kanan, dari telunjuk - kelingking, pastikan selalu standby di atas huruf 'J', 'K', 'L', ';'
  • for the right hand, from index to litle finger, make sure always standby on key 'J', 'K', 'L', ';'
  • wilayah untuk kelingking kiri: [1/!],[Q],[A],[Z],[Caps Lock],[Left Shift]
  • left litle finger area is [1/!],[Q],[A],[Z],[Caps Lock],[Left Shift]
  • wilayah untuk jari manis kiri: [2/@],[W],[S],[X]
  • left ring finger area is [2/@],[W],[S],[X]
  • wilayah untuk jari tengah kiri: [3/#],[E],[D],[C]
  • left middle finger area is [3/#],[E],[D],[C]
  • wilayah untuk jari telunjuk kiri: [4/$],[5/%],[R],[F],[V],[5/%],[T],[G],[B]
  • left index finger area is [4/$],[5/%],[R],[F],[V],[5/%],[T],[G],[B]
  • wilayah untuk jari telunjuk kanan: [6/^],[7/&],[Y],[H],[B],[U],[J],[N],[M],[8/*]
  • right index finger area is [6/^],[7/&],[Y],[H],[B],[U],[J],[N],[M],[8/*]
  • wilayah untuk jari tengah kanan: [9/(],[I],[K],[,/<]
  • right middle finger area is [9/(],[I],[K],[,/<]
  • wilayah untuk jari manis kanan: [0/)],[O],[L],[./>]
  • right ring finger area is [0/)],[O],[L],[./>]
  • wilayah untuk jari kelingking kanan: [-/_],[P],[;/:],[//?],[=/+],[[/{],['/"],[]/}],[\/|],[Enter]
  • right litle finger area is [-/_],[P],[;/:],[//?],[=/+],[[/{],['/"],[]/}],[\/|],[Enter]
nah, dengan membiasakan diri menempatkan jari2 kita di tombol2 tsb, dengan sendirinya akan memudahkan kita untuk menggunakan 10 jari kita untuk mengetik, bukan dengan 11 jari.
so, with getting familiar placing our fingers on those keys, it will make us typing using 10 fingers easier, not with 11 finger.

salaam