Tuesday, March 25, 2014

XP අලුත්වැඩියා කරමු

XP අලුත්වැඩියා කරමු

windows cd එකත් එක්ක තියෙන recovery console එකෙන් වැඩ ගන්න හැටි ගොඩක් අය දන්නෑ වගේ. ඒ හින්ද කස්ටියටම දැන ගන්නත් එක්ක කියල දෙන්න හිතුන..windows වලට එන ලෙඩ ගොඩත් මේකෙන් හොද කරන්න පුලුවන්.විශේෂයෙන්ම Boot වෙන්නෙ නැති ලෙඩ වලට මේක කියාපු බඩ්ඩ..xp cd එකෙන් කොහොමද මේ වගේ ලෙඩ හදන්නෙ කියල කියල දෙන්නම්..

මේකෙන් අර safe mode screen එක ගාවට ගිහින් restart වෙන එක ntldr missing වගේ එව හදාගත්තහැකි..

මුලින්ම xp cd එක දාල computer එක Boot කරන්න මුලින්ම එන මෙනුවෙන් දෙවෙනි විධානය තෝරන්න ඕනෙ.. මේ තියෙන්නෙ screen shot එක..



ඊලගට එනව ඔයාගෙ මෙහෙයුම් පද්ධතිය තෝරන්න තැනක්..ප්‍රශ්නෙ තියෙන මෙහෙයුමු පද්ධතියෙ අංකය ගහල එන්ටර් කරන්න..ඊලගට admin පාස්වර්ඩ් දාල තියෙනවනම් එක දෙන්න..ඊට පස්සෙ එනව command prompt එකේ වගේ text command වලින් වැඩ ගන්න තැනකට මෙතන තමා සිද්ධිය තියෙන්නෙ..ඹයාගෙ තියෙන ප්‍රශ්ණෙට අනුව මෙතන ගහන Command එක වෙනස් වෙනව...



ඔය තියෙන්නෙ Boot sector හදන හැටි machine එක restart වෙනව නම් මෙතන chkdsk<space>/r ගහන්න <space> තියෙන තැනට ස්පේස් බාර් එක එකපාරක් ඔබන්න..ඔය Command එකෙන් වෙන්නෙ xp වල Files වලට හානි වෙලා තියෙනවනම් hard disk එකේ bad sectors නිසා ඒව හදන එක පහලින් තිවයනව ඔතන ගහන්න පුලුවන් code සේරම..

ආ මේ code වලට තව කෑලි එකතු කරන්න පුලුවන්....උදාහරණයක් විදිහට HDD එක analyze කරන chkdsk විධානයටම /r කියල ගැහුවම ප්‍රශ්ණ තියෙනවනම් repair කරනව..ඕනම command එකක් ඉදිරියෙන් ? ලකුණ හරි help කියල හඑි ගහල බලන්න command එකේ වැඩි විස්කර බලාගන්න....


Attrib 
Changes the attributes of a file or directory.
Batch 
Executes the commands specified in the text file.
Bootcfg 
Boot file (boot.ini) configuration and recovery.
ChDir (Cd) 
Displays the name of the current directory or changes the current directory.
Chkdsk 
Checks a disk and displays a status report.
Cls 
Clears the screen.
Copy 
Copies a single file to another location.
Delete (Del) 
Deletes one or more files.
Dir 
Displays a list of files and subdirectories in a directory.
Disable 
Disables a system service or a device driver
Diskpart 
Manages partitions on your hard drives.
Enable 
Starts or enables a system service or a device driver.
Exit 
Exits the Recovery Console and restarts your computer.
Expand 
Extracts a file from a compressed file.
Fixboot 
Writes a new partition boot sector onto the specified partition.
Fixmbr 
Repairs the master boot record of the specified disk.
Format 
Formats a disk.
Help 
Displays a list of the commands you can use in the Recovery Console.
Listsvc 
Lists the services and drivers available on the computer.
Logon 
Logs on to a Windows installation.
Map 
Displays the drive letter mappings.
Mkdir (Md) 
Creates a directory.
More 
Displays a text file.
Net Use 
Connects a network share to a drive letter.
Rename (Ren) 
Renames a single file.
Rmdir (Rd) 
Deletes a directory.
Set 
Displays and sets environment variables.
Systemroot 
Sets the current directory to the systemroot directory of the system you are currently logged on to.
Type 
Displays a text file.

Monday, March 24, 2014

Google Chrome Extension එකක් හදමු.

Google Chrome Extension එකක් හදමු.


කාලයකට පස්සේ බ්ලොග් එක පැත්තට එන්න හිතුනේ අලුත් නොවෙන පොඩි දෙයක් කියලා යන්න. Google Chrome වෙබ් ගවේශකය ගැන අහලා ඇතිනේ . අන්න ඒකට අලුත් උපාංගයක් ඇතුලත් කරන්න , ඒ කියන්නේ Chrome ට Extension එකක් හදන හැටි කියාදෙන එක තමයි තමයි මේ ලිපියේ අරමුණ . Google Chrome වෙබ් ගවේශකය ගත්තොතින් භාවිතයට පහසු Google සමාගමේ තාක්ෂණ හා පහසුවෙන් Integrate වෙන වෙබ් ගවේශකයක්. හරි වැඩි කතාබහ ඕන නැහැ බලමු Extension එකකින් වෙබ් ගවේශකයට ඇති ප්‍රයෝජනය මොකක්ද කියලා. සාමාන්‍යයෙන් Extension එකකින් කරන්නේ වෙබ් ගවේශකයට අමතර පහසුකම් එකතු කරන එක . උදාහරණයක් විදිහට ඔබ ඔබගේ email ගිණුමට log වෙලා ඉන්න කොට එයට පැමිණි email සංඛ්‍යාව වෙබ් ගවේශකයේ පැත්තකින් දක්වනවනම් ඒක ඔබට පහසුවක් වේවි. නැද්ද මං කියන්නේ :-) . ඔව් ඒක පහසුවක් . Google Chrome වගේ tab ගනනාවකින් ප්‍රයෝජන ලබාගැනීමේ පහසුකම තියෙන වෙබ් ගවේශකයක email ගිනුම විවෘත වෙලා තියෙන tab එකට නිතර නිතර යන්න කම්මැලි වගේ නම් email notify extension එකකින් email එකක් ලැබුනා කියලා පෙන්නනව නම් (දැනටමත් මේවා නම් තියෙනවා gmail,yahoomail වගේ සේවා වලට) ඔබ කැමති ඇති. Google Chrome වෙබ් ගවේශකයේ නිර්මාපකයන්ට පිංසිද්ද වෙන්න ඔවුන් මෙම extension සෑදීම ඉතා පහසුවෙන් කීරීමට සුදුසු API එකක් හදලා තියෙනවා . එම නිසාවෙන්ම  ඔබට extension එකක් සෑදීම ඉතා පහසුවෙන් කල හැකියි. මෙම ලිපියෙන් කියල දෙන්නේ සරලම extension එකක් හදන හැටි (තව දෙයක් මේකේ unicode ගතියකුත් තියෙනවා).එහෙනම් වැඩේට බහිමුකෝ.
හරි මේ extension එක හදන්න මොනවද ඕන, හරිම සරලයි html ,json හා පොඩි පිංතූර කෑල්ලක් , ඒ කිව්වේ icon  එකක් ( 16*16 px png කෑල්ලක් වැඩිය හොඳයි  :-) ) . html ,png නම් අවුලක් නැහැ ඒත් json . ලොකු දෙයක් නෙවෙයි  ඔබ ajax, web developing කරල තියෙනවනම් මේ තාක්ෂණය ගැන අහලා ඇති .json කියන්නේ javascript object notaion කියන එක . වැඩි විස්තර ඕනනම්  json.org ගිහින් බලන්න. පළමුව කරන්න තියෙන්නේ මේවා එක තැනකට ගන්න එක . පහසුවට folder එකකට දාගමු. ඒ folder එක my_extension කියලා නම් කරගන්න . (පළමු රූප සටහන බලන්න .)
ඊට පස්සේ notepad එකක් අරගෙන ඒකේ පහත දැක්වෙන html coding ටික දාගන්න.(දෙවන රූප සටහන බලන්න.)
මෙම html ගොනුව save කරන්න ඕන "popup.html" all files  "encoding UTF-8" විදිහට. "ANSI"  විදිහට නම් එපා.(තුන්වන රූපසටහන බලන්න.)
ඊට පස්සෙ තමා ලොකුම වැඩේ json file එක සෑදීම . ඒකේ පහත දැක්වෙන පිළිවෙලට name,version, description ... පිළිවෙලට සටහන් කරගන්න . save කරද්දී manifest.json ලෙස නම් කරන්න අමතක කරන්න එපා .type "all files" ලෙස දෙන්න.
manifest.json ගොනුව තමයි ගොඩක් Google Chrome extension වල හදවත වෙන්නේ.
තව පොඩි දෙයක් අර png කෑල්ල :-) . මේකට නම් 16*16 px ඕනම පොඩි චිත්‍රකයක් (graphic) එකක් හරියනවා . අන්තර්ජාලය පිරික්සුවෝතින් නම් ඕනා  තරම් තියෙනවා.ඒක අනිවාර්යයෙන් icon.png විදිහට my_extension folder එකේ save කරගන්න.දැන් ඔබ my_extension folder  එක නැවත බැලුවොතින් ඒකේ popup.html , manifest.json හා icon.png ගොනු තුන දැකගන්න පුළුවන්.
 හරි දැන් ගොඩක් දුරට අපේ වැඩේ ඉවරයි .දැන් තියෙන්නේ මේ extension  එක  pack කරන එක . ඒකත් පහසු වැඩක් . Google Chrome open  කරගන්න .ඊට පස්සේ දකුණු කෙලවරේ ඉහලම තියෙන "දඬු-අඬු" icon එක click කරලා tools යටතේ ඇති extensions click  කරන්න.
  එවිට ලැබෙන extensions page  එකේ developer mode tick කරන්න.
ඉන්පසු එහි ඇති Load unpacked extention click කර ලැබෙන dailog box එකෙන් my_extension folder එක ‍තෝරා දෙන්න . එතකොට ඉබේටම වගේ my_extension නමින් extension එකක් extensions page  එකට එකතු වෙලා  තියෙයි .
පොඩ්ඩක් ඉන්න  තවම වැඩේ ඉවර නැහැ,extension එක pack කරන්නත් ඕනනේ. ඒකට pack extension click කරලා Extension root directory එකට my_extension folder එක ‍තෝරා දෙන්න. එතකොට ඔබට පෙනෙයි my_extension folder එකට පිටින් "my_extension.crx" හා "my_extension.pem" යනුවෙන් ගොනු දෙකක් තිබෙන වග. මෙයින් "my_extension.crx" කියන්නේ Google Chrome extension එක "my_extension.pem" කියන්නේ key file එක . මේ key file එක ඕන වෙන්නේ extension එකේ ඉදිරි සංස්කරණ වලට .
සෑදුනු extension මත click  කල විට ලැබෙන ප්‍රතිඵලය .
හරි එහෙනම් වැඩේ ඉවරයි , සටහන ටිකක් කලබලයෙන් ලිව්වේ , අඩුපාඩු ඇති , කමෙන්‍ටුවක් දාන්න අමතක කරන්න