Dec 19, 2011

Reading comics books & mangas in Ubuntu

Normally, comic books & manags are shared on the net in archive formats, like zip or rar, which contain (jpeg, png) images. Reading those images with an image viewer is the most irksome reading experience you can ever have. So, normally you may want to convert those images into a common document format, like pdf.

Since evince is the default and most widely used document reader in Ubuntu, there are two ways to convert those piles of images into evince-readable format.

The first one is to use our favourite ImageMagick's convert command. Go to the directory which contains those images in terminal, and run this command, which will produce a comic-book.pdf with jpg files in current directory.
convert *.jpg comic-book.pdf

If you have downloaded lots of comics books and you might find it tedious to go into each book's folder and run the above command. Rest assured, you don't need to. You can use for loop in bash to automate this.

In the above example, we have 3 series of Rurouni Kenshin mangas in current folder. After runing the command, we have 3 pdf files with corresponding names.

An alternative way is to use cbz format, which is also supported by evince reader.

7z a comic-book.cbz *.{jpg,png}
This command will produce a comic-book.cbz with jpg or png images in current directory.

for file in *;do 7z a "$file".cbz "$file"/*.png ;done
This command will read png images in each directory of current folder, and produce cbz files with corresponding names.

မြန်မာ​ပြည်​တွင်း​မှ Github ကို အသုံးပြု​ပုံ

၁။ Github ကို သွား​ပြီး အကောင့်​တစ်​ခု ပြုလုပ်​ပါ။အွန်​လိုင်း​အကောင့် ပြုလုပ်​ပုံ​များ​ကို အားလုံး​ပဲ အကျွမ်းတဝင်​ရှိ​ပြီး​သား​ဟု ယူဆ​၍ အကျယ်​တစ်​ဝင့် မ​ရှင်း​တော့​ပါ။

၂။ မိမိ​ပြုလုပ်​ထား​သော အကောင့်​နှင့် ဝင်​လိုက်​ပါ။

၃။ ဤ​စာ​မျက်နှာ​သို့ သို့ သွား​၍ ပ​ရော​ဂျက်​ရီ​ပို အသစ်​တစ်​ခု ပြုလုပ်​ပါ။

၄။ မိမိ​စက်​တွင်း git ကို မ​သွင်း​ရ​သေး​ပါ​က သွင်း​ပါ။
sudo apt-get install git-core
၅။ git အတွက် မိမိ​နာမည်​နှင့် အီး​မေးလ်​များ သတ်​မှတ်​ပါ။
git config --global user.name "Thura Hlaing"
git config --global user.email trhura@gmail.com
၆။ git တွင် github ၏ တို​ကင်​ကို Github >> Account Admin >> API Token ယူ၍ သတ်​မှတ်​ပေး​ပါ။
git config --global github.token 04cbd8b4a896947c58144923de69c3c7

၇။ မိမိ​ပ​ရော​ဂျက်​အတွက် စက်​တွင်း​တွင် ဒါ​ရိုက်​ထ​ရီ​တစ်​ခု ပြုလုပ်​လိုက်​ပါ။ ထို​နောက် ၎င်း​ဒါ​ရိုက်​ထ​ရီ​အတွင်း ဝင်​လိုက်​ပါ။
mkdir -p ~/github/test-project && cd ~/github/test-project
၈။ ပ​ရော​ဂျက်​အတွက် README ဖိုင် ဖန်တီး​လိုက်​ပါ။
echo "This is a README file for test-project" > README
၉။ လက်​ရှိ​ဒါ​ရိုက်​ထ​ရီ​တွင် ရီ​ပို​တစ်​ခု အစပြု​ရန် git ကို အောက်​ပါ​ကွန်​မန်း​သုံး​၍ ညွှန်​ကြားလိုက်​ပါ။
git init
၁၀။ ခု​န​က ပြုလုပ်​ထား​သော README ဖိုင်​ကို မိမိ​ပ​ရော​ဂျက်​ရီ​ပို​ထဲ ထည့်​ပါ။
git add README
၁​၁။ ရီ​ပို​အတွင်း မိမိ လုပ်​ထား​သည့် အပြောင်း​အလဲ​များ သိမ်း​ပါ။
git commit -m "Added README file"
၁​၂။ မိမိ​ရီ​ပို​အား သိမ်း​မည့် github လိပ်စာ ထည့်​ပေး​ပါ။ (test ကို မိမိ​နှစ်သက်​ရာ အမည်​တစ်​ခု၊ trhura ကို မိမိ​၏ github အသုံးပြု​သူ​အမည်၊ test-project.git အား မိမိ​ပ​ရော​ဂျက်​၏​အမည် အသီး​သီး​ပြောင်း​၍ ရိုက်​ပါ)
git remote add test https://trhura@github.com/trhura/test-project.git
၁၃။ မိမိ​ပ​ရော​ဂျက်​အား github ပေါ်​တင်​၍ ရ​ပါ​ပြီ။
git push -u test master

Dec 14, 2011

aptitude မိတ်​ဆက်


ကျနော် ဦး​ဘွန်​တု​ကို စ​သုံး​ကတည်းက ရီ​ပို​ဆာ​ဗာ​ထဲ​မှ ဆော့ဖ်​ဝဲ​များ သွင်း​ဖို့ ကွန်​မန်း​လိုင်း​က​ဆို​ရင် “apt-get”, ဂျီ​ယူ​အိုင်​ဆို​ရင်​တော့ “synaptic” ကို​ပဲ စွဲ​စွဲမြဲ​မြဲ သုံး​ခဲ့​ပါ​တယ်။ ရီ​ပို​ထဲ​က မဟုတ်​ပဲ တစ်​ခြား​က ကူး​ဆွဲထား​တဲ့ deb ပက်​ကေ့​တွေ သွင်း​ချင်​ရင်​တော့ ကွန်​မန်း​လိုင်း​က​ဆို​ရင် “dpkg”, ဂျီ​ယူ​အိုင်​က​ဆို​ရင် “gdebi” ကို သုံး​ပါ​တယ်။ ဦး​ဘွန်​တု ဆော့ဖ်​ဝဲ​စင်​တာ​ကို​တော့ အရမ်း​နှေး​တာ​က​တစ်​ကြောင်း၊ အချက်အလက်​တွေ စုံ​စုံလင်​လင် မ​မြင်​ရ​တာ​တစ်​ကြောင်း လုံး​ဝ မ​သုံး​ဖြစ်​ပါ။

ခုနောက်ပိုင်းမှာ ဆာ​ဗာ​တွေ​ကို sshနဲ့ ဝင်​ပြီး စီမံ​ထိန်းသိမ်း​လာ​ရ​တဲ့​အခါ ကွန်​ဆိုး(console) က​ဖြစ်​တဲ့​အတွက် ဆော့ဖ်​ဝဲ​တွေ သွင်း, ထုတ်​လုပ်​ဖို့ အရင်​က​လို “synaptic” ကို သုံး​လို့ မ​ရ​တော့​ပါ။ “apt-get” က ကိုယ့်​သွင်း​မယ့် ပက်​ကေ့​နာမည်​တွေ သိ​ရင် သွင်း​ရ လွယ်​ပေ​မဲ့ နာမည်​အတိ​အကျ မ​သိ​တဲ့ ပက်​ကေ့​တွေ အများ​ကြီး တစ်​ခု​ချင်း ရှာ​လိုက်, သွင်း​လိုက်​လုပ်​ရ​တော့​မယ်​ဆို​ရင် မ​သက်သာ​ပါ။

ဒါ​ကြောင့် အရင်​က စမ်း​ဖူး​ပေ​မဲ့ သေချာ မ​သုံး​ဖြစ်​ခဲ့​တဲ့ “aptitude” ကို ပြန်​သုံး​ဖြစ်​ပါ​တယ်။ သုံး​ရင်း​နဲ့ နည်း​နည်း အသား​ကျ​သွား​တော့ ဂျီ​ယူ​အိုင်​မှာ​တောင် “synaptic” ကို ပြန်​မ​သုံး​ချင်​တော့​ပါ။ “aptitude” ရဲ့ အဓိက အား​သာ​ချက်​တွေ​ကတော့-
  • ကွန်​မန်း​လိုင်း အခြေ​ခံ ယူ​အိုင်​ဖြစ်​တဲ့​အတွက် ဂျီ​ယူ​အိုင်​က မဟုတ်​လည်း သုံး​လို့​ရ​ပါ​တယ်။ အပေါ်​မှာ ပြော​ခဲ့​သ​လို ဆာ​ဗာ​ကို “ssh” နဲ့ ဝင်​သုံး​နေ​တဲ့​အခါ​မျိုး, “synaptic” ကို သုံး​မ​ရ​တဲ့​အခါ​မှာ အတော်​အသုံးဝင်​ပါ​တယ်။
  • ယူ​အိုင်​က ဂီး(geek)တွေ အကြိုက် ဖြစ်​ပါ​တယ်။ ကျနော်​တော့ သူ့​ယူ​အိုင်​က “synaptic”, “software-center” တို့​ထက် ပို​ပြီး သုံး​ရ ချော​ချောမွေ့​မွေ့ ရှိ​တယ်​လို့ ဂီး​ဆန်​တယ်​လို့ ခံစား​မိ​ပါ​တယ်။ :D
  • “synaptic” မှာ ဆော့ဖ်​ဝဲ​တွေ အများ​ကြီး မှတ်ထား​ပြီး သွင်း​နေ​တုန်း အကြောင်း​တစ်​ခု⁠ခု​ကြောင့် ရပ်​ပြီး ပိတ်​လိုက်​ရ​တာ​မျိုး ဖြစ်​ဖူး​မှာ​ပါ။ “synaptic” မှာ ပိတ်​ပြီး ပြန်​စ​ရင် သွင်း,ထုတ်​ဖို့ မှတ်ထား​တဲ့ ပက်​ကေ့​တွေ အကုန် ပြန်​မှတ်​ရ​ပါ​လိမ့်​မယ်။ “aptitude” ကတော့ ကိုယ် သွင်း/ထုတ်​ဖို့ မှတ်ထား​တဲ့ ပက်​ကေ့​တွေ​ကို ကရှ်(cache) ထဲ​မှာ သိမ်းထား​တာ​မို့ ပိတ်​ပြီး ပြန်ဖွင့်​လည်း မှတ်ထား​တာ​တွေ မ​ပျက်​သွား​ပါ​ဘူး။

    ကဲ... အသုံးပြု​ပုံ အခြေ​ခံ​ကို နည်း​နည်း လေ့​လာ​ကြည့်​ကြ​ရအောင်…

ဒါ​က စ​ဝင်⁠ဝင်​ချင်း မြင်​ရ​မယ့် မြင်​ကွင်း​ပါ။ အပေါ်, အောက်​သွား​ချင်​ရင် မြှား​ခ​လုပ်​တွေ​အပြင် vim, gmail တို့​က အတိုင်း j, k ကို သုံး​ပြီး သွား​နိုင်​ပါ​တယ်။ အပေါ်​ဆုံး, အောက်​ဆုံး​ကို​တော့ <Ctrl>+a, <Ctrl>+e အသီး​သီး သုံး​ပြီး သွား​နိုင်​ပါ​တယ်။ စာ​မျက်နှာ​အလိုက် အပေါ်, အောက် လှိမ့်​ဆင်း​တက်​လုပ်​ချင်​ရင် <Ctrl>+f, <Ctrl>b ကို သုံး​နိုင်​ပါ​တယ်။

ဝင်⁠ဝင်​ချင်း​မှာ သွင်း​ပြီး​သား, မ​သွင်း​ရ​သေး​တဲ့, အပ်​ဒိတ်​လုပ်​လို့​ရ​နိုင်​တဲ့ စ​သ​ဖြင့် ပက်​ကေ့​တွေ​ကို အုပ်စု​ခွဲ​ပြီး ပြ​ပေး​ထား​ပါ​တယ်။ အဲ​ဒီ​အုပ်စု​တွေ​ကို ဖြန့်​ချ​ချင်​ရင် [ ကို သုံး​ပါ။ ပြန်​လိပ်​ထား​ချင်​ရင် ] ကို သုံး​ပါ။

ပက်​ကေ့​ကို အသေး​စိတ် ကြည့်​ချင်​ရင် Enter နှိပ်​ပါ။ နောက်ပြန်​သွား​ချင်​ရင် q သုံး​ပါ။

ကိုယ်​သွင်း​ချင်​တဲ့ ပက်​ကေ့​ကို နာမည်​နဲ့ ရှာ​ချင်​ရင် / ကို သုံး​ပါ။ ရှာ​လိုက်​လို့ ရ​လာ​တဲ့ ပက်​ကေ့​တွေ​ကို သူ​က “synaptic” လို သီး​သန့်​ခွဲ မ​ပြ​ပေး​ပါ။ တစ်​ခု​ချင်း အရှေ့, နောက် n, N ကို သုံး​ပြီး ကြည့်​ရ​ပါ​တယ်။

ကိုယ်​ရှာ​တဲ့ ပက်​ကေ့​ကို တွေ့​ရင် သွင်း​ဖို့​ဆို​ရင် +, ထုတ်​ဖို့​ဆို​ရင် - ကို သုံး​ပြီး မှတ်​နိုင်​ပါ​တယ်။ သွင်း​ချင်, ထုတ်​ချင်​တာ​တွေ အကုန် မှတ်​ပြီး​ရင် g ကို​နှိပ်​ပြီး သွင်း, ထုတ်​နိုင်​ပါ​တယ်။

အပ်​ဒိတ်​လုပ်​ဖို့, မှတ်ထား​တာ​တွေ မေ့​ပစ်​ဖို့ အစ​ရှိ​တဲ့ အခြား​ဖန်​ရှင်​တွေ​ကို သုံး​ချင်​ရင်​တော့ <Ctrl>+t ကို​နှိပ် မီ​နူး​ကို ခေါ်​သုံး​နိုင်​ပါ​တယ်။

မီ​နူး​မှာ မြင်​ရ​တဲ့​အတိုင်း “aptitude” က ထွက်​တော့​မယ်​ဆို​ရင်​တော့ q နှိပ် ထွက်​နိုင်​ပါ​တယ်။ “aptitude” အသုံးပြု​ပုံ​နဲ့ ပတ်သက်​ပြီး ပြော​ချင်​တာ​ကတော့ ဒီ​လောက်​ပါ​ပဲ။ ပို​ပြီး အသေး​စိတ် သိ​ချင်​ရင်​တော့ ? နှိပ်​ပြီး အသုံးပြု​ပုံ အသေး​စိတ်​ကို ကြည့်​နိုင်​ပါ​တယ်။

“aptitude” က ကွန်​မန်း​လိုင်း အက်​ပလီ​ကေး​ရှင်း​ပီပီ စ​သုံး​ကာ​စ​မှာ သုံး​ရ​ခက်, သင်​ရ​ခက်​ပေ​မဲ့ လင်း​နက်စ်​ဆာ​ဗာ​များ​ကို စီမံ​ထိန်းသိမ်း​နေ​ရ​တဲ့​သူ​များ, လင်း​နက်စ်​ဂီး​လောင်း​များ လေ့​လာ​ထား​သင့်​တဲ့ အက်​ပလီ​ကေး​ရှင်း​တစ်​ခု​ဖြစ်​ကြောင်း ပြော​ကြား​ရင်း ဒီ​ပိုစ့်​လေး​ကို ဒီ​မှာ​ပဲ ရပ်နား​ခွင့်​ပြု​ပါ​ခင်ဗျာ။

Dec 7, 2011

Repair GRUB without using LiveCD

  1. Search root disk.
    grub> search -f /vmlinuz -s root

  2. Set root disk.
    grub> root ($root)

  3. Use these commands to find out root disk's information.
    grub> ls -l ($root)

  4. Set linux kernel. There are three ways to do it.

    1. Change the red number with your root disk number. If your root disk is (hd0, msdos1), then use /dev/sda1.
      grub> linux /vmlinuz root=/dev/sda1
    2. Change red text with your disk label, which can get by using ls -l ($root).
      grub> linux /vmlinuz root=LABEL=LABEL
    3. Change red text with your disk uuid, which can also get by using ls ($root).
      grub> linux /vmlinuz root=UUID=UUID
  5. Set ramdisk.
    grub> initrd /initrd.img

  6. Now, you can boot your system.
    grub> boot

  7. When you are logged in, type this command from terminal to fix your grub menu.
    $ sudo update-grub

Setting up Huawei c8600 mobile phone as modem on Ubuntu

Although I have tested only on ubuntu 10.10 with Huawei C8600, it might also work for Huawei C8500 and other Ubuntu versions.

1) Connect your Huawei c8600 mobile phone to your computer.

2) Open Terminal. Make sure your device is detected. Type "lsusb".



3) Load Modem with VendorID (12d1 for Huawei) and ProductID you get above. Type "sudo modprobe usbserial vendor=0x12d1 product=0xYourProductIDHere".




4) It takes a while for the network manager to detect your newly acquired modem. Sit back and relax. After several seconds, you should see CDMA Mobile Broadband Connection in your connections. Select and click on it.




6) Configure the wizard dialogs according to your provider settings. For MPT EVDO CMDA Broadband Internet, follow these steps.





7) That's it. ;)

ဦး​ဘွန်​တု​၌ မြန်မာ​လို​ကေး သတ်​မှတ်​အသုံးပြု​ပုံ

လိုကေး(Locale) ဆိုတာ  အကြမ်းဖျင်းအားဖြင့် ကွန်ပျူတာ စီမံစနစ် (OS) ကို မိမိရဲ့ ဒေသသုံး ဘာသာစကားနဲ့ စာရေးထုံးတွေအကြောင်း ပြောပြတာလို့ ဆိုနိုင်ပါတယ်။ လိုကေးထဲမှာ သက်ဆိုင်ရာ ဒေသဘာသာစကားရဲ့ စာလုံးစဉ်ပုံ၊ နာမည်, လိပ်စာ, ဖုန်း, အချိန်,နေ့စွဲ, နံပါတ် တွေကို ရေးသားပုံ၊ ဒေသတွင်း အသုံးပြုသော ငွေကြေးစနစ် အစရှိတာတွေကို ရေးမှတ်ထားပါတယ်။

ဦးဘွန်တုအတွက် မြန်မာလိုကေးကို မကြာသေးမီက ဆုံးပါးသွားတဲ့ သန်လွင်ဆောဖ့်မှ ကိတ် (Keith) က ​ရေးသားထားပြီးဖြစ်လို့ အင်္ဂလိပ်လိုကေးမှ မြန်မာလိုကေးကို အောက်မှာ ဖော်ပြထားသည့်အတိုင်း လွယ်ကူစွာ ပြောင်းလဲအသုံးပြုနိုင်ပါတယ်။

ပထမဆုံး မိမိရဲ့ ကွန်ပျူတာတွင်း လက်ရှိလိုကေးကို "locale" ဆိုတဲ့ ကွန်မန်းကို အသုံးပြုပြီး စစ်လိုက်ပါ။



ထွက်လာတဲ့ စာသားတွေကို အကြမ်းဖျင်းရှင်းရရင် LANG နဲ့ LANGUAUGE က လက်ရှိလိုကေးနဲ့ ဘာသာစကားကိုပြောတာပါ။ ကျန်တဲ့ LC_* တွေက နာမည်၊ လိပ်စာ၊ ဖုန်းနံပါတ် အစရှိတာတွေကို  အသုံးပြုရေးသားမဲ့ ရေးထုံးတွေကိုပြောတာပါ။ လိုကေးအမည်တွေမှာ ရှေ့ဆုံး စာလုံးနှစ်လုံးက ဘာသာစကားကိုနဲ့ နောက်နှစ်လုံးက အရပ်ဒေသကို အသီးသီး ရည်ညွှန်းပါတယ်။ နောက်ဆုံးပိုင်းကတော့ လိုကေးမှာ အသုံးပြုထားတဲ့ encoding ကို ပြောတာပါ။ ဥပမာ - “en_US.utf8” က utf-8 encoding ကို အသုံးပြုရေးသားထားတဲ့ အမေရိကန်နိုင်ငံသုံး အင်္ဂလိပ်ဘာသာလိုကေးလို့ ဆိုလိုတာပါ။

လိုကေးဖိုင်တွေက ဖိုင်ဆိုက် ၅၀မီဂါဘိုက်လောက် ရှိတတ်တာမို့ ဟာဒ်ဒစ်နေရာ သက်သာစေဖို့ ဦးဘွန်တုထဲမှာ နေရာဒေသ နိုင်ငံအသီးသီးအတွက် ဆိုင်ရာ လိုကေးအားလုံး မထည့်ထားပါ။ မိမိ အလိုရှိရာ ဒေသဘာသာစကားအတွက် လိုကေးကို “locale-gen” ဆိုတဲ့ ကွန်မန်းကို အသုံးပြုပြီး ဖန်တီးနိုင်ပါတယ်။



မြန်မာစာလိုကေးအမည်ကို my_MM(.utf-8) လို့ သုံးပါတယ်။ my က မြန်မာ(ဗမာ)ဘာသာစကားကို ရည်ညွှန်းတာဖြစ်ပြီး MM က မြန်မာနိုင်ငံကို ရည်ညွှန်းတာပါ။ နောက်က encoding က မထည့်လည်း ရပါတယ်။

ဒါဆို မြန်မာစာလိုကေးကို ဖန်တီးပြီးပြီဖြစ်တဲ့အတွက် System >> Administration >> Language Support >> Text ကနေ Burmese ကို ရွေးချယ်သတ်မှတ်ပြီး မြန်မာစာလိုကေးကို အသုံးပြုနိုင်ပါပြီ။ ဒါမှမဟုတ် logout ပြန်ထွက်ပြီး GDM  Login Screen ဘယ်ဘက်အောက်ခြေနားက ဘာသာစကားမှာ ဗမာ(Burmese) ကို ရွေးပြီးလည်း အသုံးပြုနိုင်ပါတယ်။

အောက်က မြန်မာလိုကေးပြောင်းပြီး နေ့စွဲရက်စွဲတွေ မြန်မာလိုပြောင်းလဲ မြင်ရပုံပါ။



လိုကေးကို မြန်မာပြောင်းထားပြီးရင် မြန်မာဘာသာပြန်ပြီးသားရှိတဲ့ အက်ပလီကေးရှင်းတစ်ချို့ကိုလည်း  မြန်မာလို အသုံးပြုနိုင်ပါလိမ့်မယ်။