Today, I wrote a small python script to discover Ubiquiti Nanostation devices on the network using pacpy and dpkt. Since it is listening CDP packets, I guess it can also discover other kinds of devices, though not tested.
Jul 12, 2013
Jul 11, 2013
Limiting the active users/sessions in freeRADIUS
Here is how to limit the number of concurrent users/sessions in freeRADIUS. Let's say, you want to reject auth requests if there are already more than 50 active accounting sessions.
- Add the following policy in your policy.conf
- Add check_active_users policy in your sites-enabled/default auth section.
- Test it using radclient.
maximum_active_users = 50
check_active_users {
if ("%{sql: SELECT COUNT (*) FROM radacct WHERE acctstoptime IS NULL}" >= "%{config:policy.maximum_active_users}") {
update reply {
Reply-Message := "Too many users logged into the system. Please try again later."
}
reject
}
}
root @ ~ $ echo "User-Name=t1,User-Password=1234" | radclient -x -d /etc/freeradius/ 192.168.100.108 auth testing123
Sending Access-Request of id 124 to 192.168.100.108 port 1812
User-Name = "t1"
User-Password = "1234"
rad_recv: Access-Reject packet from host 192.168.100.108 port 1812, id=124, length=84
Reply-Message = "Too many users logged into the system. Please try again later."
Jun 20, 2013
Simple Data Compression Algorithms in Common Lisp
Common Lisp implementation of some data compression algorithms — Run-Length, Huffman, and Shannon–Fano Encodings — that I have written during my graduate course "Data Compression".
Internet connection sharing using iptables
Scenario ― I have several virtualbox GUEST machines, using an internal network on my PC. Now, I wanted to share host machine's internet connection to guest machines. I searched on the web how to do it using iptables. Most of the solutions seem too complex. Here is a working simple solution (found on centos documentation)
On Host Machine — type these commands in Terminal.
That's it. Now you can access the external network of host machine from guest machines. To access Internet, you may need to edit /etc/resolve.conf in your guest machine.
On Host Machine — type these commands in Terminal.
thura @ ~ $ sudo iptables -A FORWARD -i vboxnet0 -j ACCEPT thura @ ~ $ sudo iptables -A FORWARD -o eth1 -j ACCEPT thura @ ~ $ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
That's it. Now you can access the external network of host machine from guest machines. To access Internet, you may need to edit /etc/resolve.conf in your guest machine.
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 8.8.8.8
Jun 19, 2013
if_nametoindex, if_indextoname functions for python using ctypes
I needed to use if_nametoindex, if_indextoname functions for one of my packet capturing programs. So, here is my python wrapper for those functions using ctypes.
PS: You will need this only for python2.x. Those functions are available in socket module starting since python 3.3.
Jun 13, 2013
Using Prolink Wireless Nano USB Adapter on Ubuntu
Recently, I purchased a prolink nano usb wireless adapter WN2001. However, when I tried to plug it into my ubuntu box, I am getting "hardware disabled errors".
This can be fixed by reloading the wireless module with swenc option.
trhura @ ~ $ sudo rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yesThis can be fixed by reloading the wireless module with swenc option.
trhura @ ~ $ sudo rmmod -f rtl8192cu; sudo modprobe rtl8192cu swenc=1 debug=5
Apr 6, 2012
Python Module for Myanmar Language Processing
I am writing a crawler, to crawl Burmese phrases from the Web, in python currently. Since non-unicode encodings — such as wininnwa and zawgyi — are also used commonly in Myanmar websites, I needed to convert those texts into unicode.
So, I ported Thanlwinsoft's Myanmar converter, written in javascript, to python. Since, converting those encodings is a common task in Myanmar language processing, I am releasing it here.
I have also written a python script, which can be used to convert those encodings from command line.
Please note that I haven't tested it throughly, and this is an alpha release. So, don't use it without backing up first.
For debian/ubuntu users, you can just grab the deb package and install. For other platforms, download the archive and run this command in extracted folder.
Using myanmar python module
Using myanmar-converter script
So, I ported Thanlwinsoft's Myanmar converter, written in javascript, to python. Since, converting those encodings is a common task in Myanmar language processing, I am releasing it here.
I have also written a python script, which can be used to convert those encodings from command line.
Please note that I haven't tested it throughly, and this is an alpha release. So, don't use it without backing up first.
Install
For debian/ubuntu users, you can just grab the deb package and install. For other platforms, download the archive and run this command in extracted folder.
python setup.py install
Usage
Using myanmar python module
>>> import myanmar.converter as converter
>>> converter.get_available_encodings ()
['zawgyi', 'wwin_burmese', 'wininnwa', 'unicode']
>>> print converter.convert (u'ydkifoGefy½dk*&rfrif;', 'wininnwa', 'unicode')
ပိုင်သွန်ပရိုဂရမ်မင်း
Using myanmar-converter script
trhura @ ~ $ myanmar-converter -h
Usage: myanmar-converter [OPTIONS...] [FILE...]
Convert between Myanmar legacy encodings and unicode.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-l, --list List supported encodings.
-f ENCODING, --from=ENCODING
Convert characters from ENCODING
-t ENCODING, --to=ENCODING
Convert characters to ENCODING
-o FILE, --output=FILE
Write output to FILE
trhura @ ~ $ echo 'wmrDe,frStokH;ðyykH' | \
myanmar-converter -f 'wwin_burmese' -t 'unicode'
တာမီနယ်မှအသုံးပြုပုံ
Mar 6, 2012
Unicode Character Boundary Segmentation for Burmese
Character boundary segmentation for
Burmese is still not working properly in all platforms supporting
Myanmar unicode (Windows , OS X, ICU, Pango). Although the default
character segmentation specification, described in Unicode Standard
Annex #29, works well for most Burmese text, there are, however,
still some cases, where it needs to be tailored be work properly for
Burmese.
Normally, Burmese (user-perceived)
characters are a combination for consonants + marks (medials, vowel,
tones). However, this simple rule doesn't work when final
(devowelized) consonants are involved. Final consonants are
consonants with their inherent vowel killed. There are three ways
final consonants appear in Burmese –
- Followed by U103A (ASAT SIGN) (က်)
- Stacked together with succeeding consonants (က္က)
- As Kinzi (င်္)
Two separate rules for segmentation of
those final consonants need to be considered.
1. When followed by ASAT — (က်,
မ်, င်,
ည် …)
They are segmented as separate
characters in all platforms currently supporting Myanmar unicode
(ICU, Windows8, pango). For example, မောင်
is segmented into two separate characters – မော
and င်.
Although they seem visually separate, မောင်
is considered as one character in Burmese. Let's say —
we want to display “ဒိန်ချဉ်ဆိုင်”
vertically, as in a signboard. This will be displayed
as:
where it should be displayed as:ဒိန်ချဉ်ဆိုင်,
ဒိန်ချဉ်ဆိုင်
2.
Kinzi and Stacked Consonants — (အင်္ဂါ,
အက္ခရာ…)
The default unicode algorithm
segments each consonant + mark combination as a character. However,
since two consonants are conjoined in kinzis and stacked consonants,
“one consonant, one character” rule makes it confusing for
selecting text and cursor movement. Currently, pango and ICU segment those conjoined consonants as two separate characters.
အင်္ဂါ = အ + င်္ + ဂါ
အက္ခရာ = အ + က ္ + ခ + ရာ
Windows 8 segments those conjoined characters as
one character – which is the proper approach in my opinion.
အင်္ဂါ = အ + င်္ဂါ
အက္ခရာ = အ + က္ခ + ရာ
There is another issue regarding U104E (၎). Myanmar symbol ၎ (U104E), unlike other symbols, is not an independent symbol. It is always written together with Nga, Asat, Visarga. So, ၎င်း should be counted as one character, rather two characters (၎ + င်း).
Jan 13, 2012
tic-tac-toe AI with two-ply minmax in scheme
Today, while I am reorganizing my old programming source code files, I stumbled upon this old gem — an implementation of tic-tac-toe AI using two-ply min-max in scheme — which is my project for AI course in university.
Although it was only a half and a year ago, I have already forgot how it works. Besides at that time, I wrote it using plt-scheme, which has become racket now. So, I decided to find out whether the program still works under racket and went through this unbearable pang of downloading racket — a familiar emotion for Internet users inside Myanmar. After waiting for a few hours, I was ready to animate my old friend.
Please, note that the evaluation function is too complex and poorly written that I even myself had a hard time understanding. So, you might want to rework that one.
To try out this program, just install racket & run.
Although it was only a half and a year ago, I have already forgot how it works. Besides at that time, I wrote it using plt-scheme, which has become racket now. So, I decided to find out whether the program still works under racket and went through this unbearable pang of downloading racket — a familiar emotion for Internet users inside Myanmar. After waiting for a few hours, I was ready to animate my old friend.
Yeah, it still works, and as far as I tested, the AI is unbeatable. Since this kind of projects are common in university AI courses, I decided to post it online to help some pour souls trying to meet his assignment deadline — that I was once.
Please, note that the evaluation function is too complex and poorly written that I even myself had a hard time understanding. So, you might want to rework that one.
To try out this program, just install racket & run.
sudo apt-get install racket
racket ttc.scm
racket ttc.scm
Jan 11, 2012
nautilus-renamer 3.0 released
Highlights
The main change is that now nautilus-renamer uses PyGobject, instead of static pygtk bindings. In other words, it uses gtk3 now. The other big change is radio buttons in previous versions are replaced with buttons, so that patterns, substitutions and case can be applied simultaneously. Nautilus extension is also added by Amr Osman. Debian packages are also available now.
Download
Downloads are available here. If you want to install as a nautilus script for a single user, download source package, extract and type "make localinstall" in terminal to install. Download the deb package to install as nautilus extension. After installation, "Mass Rename" will appear in nautilus context menu, if you have selected more than 2 files.
Screenshots
The main change is that now nautilus-renamer uses PyGobject, instead of static pygtk bindings. In other words, it uses gtk3 now. The other big change is radio buttons in previous versions are replaced with buttons, so that patterns, substitutions and case can be applied simultaneously. Nautilus extension is also added by Amr Osman. Debian packages are also available now.
Download
Downloads are available here. If you want to install as a nautilus script for a single user, download source package, extract and type "make localinstall" in terminal to install. Download the deb package to install as nautilus extension. After installation, "Mass Rename" will appear in nautilus context menu, if you have selected more than 2 files.
Screenshots
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.
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.
An alternative way is to use cbz format, which is also supported by evince reader.
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 ကို မသွင်းရသေးပါက သွင်းပါ။
git config --global github.token 04cbd8b4a896947c58144923de69c3c7
၇။ မိမိပရောဂျက်အတွက် စက်တွင်းတွင် ဒါရိုက်ထရီတစ်ခု ပြုလုပ်လိုက်ပါ။ ထိုနောက် ၎င်းဒါရိုက်ထရီအတွင်း ဝင်လိုက်ပါ။
၂။ မိမိပြုလုပ်ထားသော အကောင့်နှင့် ဝင်လိုက်ပါ။
၃။ ဤစာမျက်နှာသို့ သို့ သွား၍ ပရောဂျက်ရီပို အသစ်တစ်ခု ပြုလုပ်ပါ။
၄။ မိမိစက်တွင်း 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 user.email trhura@gmail.com
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
- Search root disk.grub> search -f /vmlinuz -s root
- Set root disk. grub> root ($root)
- Use these commands to find out root disk's information. grub> ls -l ($root)
- Set linux kernel. There are three ways to do it.
- 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
- Change red text with your disk label, which can get by using ls -l ($root). grub> linux /vmlinuz root=LABEL=LABEL
- Change red text with your disk uuid, which can also get by using ls ($root).grub> linux /vmlinuz root=UUID=UUID
- Change the red number with your root disk number. If your root disk is (hd0, msdos1), then use /dev/sda1.
- Set ramdisk. grub> initrd /initrd.img
- Now, you can boot your system. grub> boot
- 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. ;)

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) ကို ရွေးပြီးလည်း အသုံးပြုနိုင်ပါတယ်။
အောက်က မြန်မာလိုကေးပြောင်းပြီး နေ့စွဲရက်စွဲတွေ မြန်မာလိုပြောင်းလဲ မြင်ရပုံပါ။

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

ဦးဘွန်တုအတွက် မြန်မာလိုကေးကို မကြာသေးမီက ဆုံးပါးသွားတဲ့ သန်လွင်ဆောဖ့်မှ ကိတ် (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) ကို ရွေးပြီးလည်း အသုံးပြုနိုင်ပါတယ်။
အောက်က မြန်မာလိုကေးပြောင်းပြီး နေ့စွဲရက်စွဲတွေ မြန်မာလိုပြောင်းလဲ မြင်ရပုံပါ။
လိုကေးကို မြန်မာပြောင်းထားပြီးရင် မြန်မာဘာသာပြန်ပြီးသားရှိတဲ့ အက်ပလီကေးရှင်းတစ်ချို့ကိုလည်း မြန်မာလို အသုံးပြုနိုင်ပါလိမ့်မယ်။
Mar 8, 2011
Simple Burmese OCR
As my graduation project, I am working on a simple Burmese OCR (only alphabets & digits) using ANN. I have already finished the demo program. Here are some screenshots for the curious.







Feb 7, 2011
ဦးဘွန်တုမှ ယူနီကုတ်မှတ်စုများ
မှတ်ချက်။ ။ ဦးဘွန်းတုလို့ ဆိုထားပေမဲ့ အခြား လင်းနက်-distros တွေအတွက်လဲ အကျုံးဝင်ပါလိမ့်မယ်။ ဦးဘွန်တု-သီးသန့်မဟုတ်ပေမဲ့ တစ်ချို့အချက်အလက်တွေက GNOME-သီးသန့်ပါ။ ကျွန်တော် GNOME မှာပဲ စမ်းထားပါတယ်။ အခြား Desktop Enviroment တွေအတွက် (ဥပမာ။ KDE) အကျုံးဝင်ချင်မှ ဝင်ပါလိမ့်မယ်။
၁။ ယူနီကုတ်ပြောင်းပြောင်းချင်း မြင်သာတဲ့ အကျိုးက မြန်မာစာစီစနစ် (sorting) ကို သုံးလို့ ရလာတာပါ။ အရင်တုန်းက ကျွန်တော် ဇော်ဂျီကို သုံးစဥ်တုန်းက ဖိုင်မန်နေဂျာ(file manager)တွေမှာ မြန်မာ ဖိုင်နာမည်တွေကို နာမည်အလိုက် စီလို့ မရပါဘူး။ ကျွန်တော်စက်ထဲမှာ ဖိုင်နာမည် အတော်များများကို မြန်မာလိုသိမ်းထားတဲ့အခါ နာမည်အလိုက် စီထားတော့ ရှာရဖွေရ ပိုလွယ်လာပါတယ်။ ဖိုင်မန်နေဂျာတွေမှ မဟုတ်ပါ။ အခြား ယူနီကုဒ်ကို အသုံးပြုတဲ့ ပရိုဂရမ်အတော်တော်များများမှာ မြန်မာစာတွေကို အဆင်ချောချော သုံးလို့ရလာပါတယ်။ ဥပမာ - မြန်မာစာတွေကို စီချင်ရင် တစ်ခြားမည်သည့်ဆော့ဖ်ဝဲမှ မလိုပဲ ကွန်မန်းလိုင်းက sort ကို သုံးပြီး စီနိုင်ပါတယ်။


ဒီအတွက် လင်းနက်အတွက် မြန်မာ locale ဖန်တီးရေးသားပေးထားတဲ့သူတွေကို ကျေးဇူးတင်ကြောင်း ပြောလိုပါတယ်။
၂။ ကျွန်တော် စမ်းသပ်မိသလောက် လက်ရှိ ယူနီကုတ်ဖောင့်တွေထဲမှာ ပိတောက်တစ်ခုပဲ ပြည့်ပြည့်ဝဝ မှန်မှန်ကန်ကန် render လုပ်နိုင်ပါတယ်။ ဒါကြောင့် ပိတောက်ကိုပဲ အမြင် သိပ်မလှပေမဲ့ သုံးဖြစ်ပါတယ်။
၃။ ယူနီကုတ် ကီးဘုတ်ကို ဦးဘွန်တုမှာ သုံးချင်ရင် နည်းလမ်း အတော်များများ ရှိပါတယ်။ ပထမတစ်ခုက ကိုစေတန်၊ ကိုဘောက်တူး တို့လုပ်ထားတဲ့ ကီးဘုတ်ကို သုံးတာပါ။ ကွန်မန်းလိုင်းကနေ dpkg -i --force-all zg-mm3-kb.deb ဆိုပြီး သွင်းဖို့ လိုပါမယ်။ နောက်တစ်ခုက ကျနော် အရင်က ရေးထားတဲ့ ibus ကို သုံးပြီး ရိုက်နည်းပါ။ ဇော်ဂျီကီးဘုတ်က သိပ်အဆင်မချောပေမဲ့ ယူနီကုတ် ကီးဘုတ်က ကျနော် စမ်းထားသလောက် အဆင်ပြေပါတယ်။ ဒါမှမဟုတ် ibus မှာပဲ ကိုအိမောင် ရေးထားတဲ့နည်းကို သုံးပြီးလည်း ရိုက်နိုင်ပါတယ်။ ဒါကိုတော့ ကျနော် သေချာ မစမ်းဖြစ်သေးပါ။
၄။ ကျွန်တော် သုံးဖူးသလောက် ဝင်းဒိုး ပရိုဂရမ်တွေမှာ မြန်မာဖောင့်သုံးချင်ရင် သက်ဆိုင်ရာ ပရိုဂရမ်ရဲ့ ဆက်တင်မှာ ဖောင့်ကို မိမိ နှစ်လိုသော မြန်မာဖောင့် ပြောင်းလဲသတ်မှတ် ပေးဖို့လိုပါတယ်။ (ဥပမာ — ဂျီတော့မှာ ဖောင့်မပြောင်းထားရင် မြန်မာစာတွေကို လေးထောင့်အကွက်လေးတွေပဲ မြင်နေရတာမျိုးပါ။) အဲဒီလို ဖောင့်ပြောင်းတာရဲ့ ပြဿနာက မြန်မာဖောင့် အတော်များများရဲ့ အင်ဂလိပ်စာ စာလုံးတွေက မလှတာပါ။ ကံကောင်းတာက ဦးဘွန်းတု ပရိုဂရမ်တွေမှာ အဲလို ဖောင့်ကို တိုက်ရိုက်ကြီး သတ်မှတ်ပေးစရာမလိုပါဘူး။ ဦးဘွန်းတုမှာ သက်ဆိုင်ရာ ဘာသာစကား(စာသား)ကို default ဖောင့်က render မလုပ်နိုင်ဘူးဆိုရင် fontconfig ဆိုတဲ့ library ကို သုံးပြီး အခြား သင့်တော်ရာ ဖောင့်ကို ရွေးချယ် render လုပ်ပေးပါတယ်။ ဒီမှာ ပြဿနာတစ်ခုက ကိုယ့်စက်ထဲမှာ မြန်မာဖောင့်တစ်ခုထက် ပိုရှိနေရင် fontconfig က ဘယ်ဖောင့်ကို ရွေးမလဲဆိုတာပါ။
မိမိ စက်ထဲမှာ မြန်မာဖောင့် တစ်ခုထက် ပိုရှိနေရင် ဘယ်ဖောင့်ကိုရွေးသလဲဆိုတာကို အောက်ပါ ကွန်မန်းကို အသုံးပြုပြီး သိရှိနိူင်ပါတယ်။
ဆိုပါစို့ — စက်ထဲမှာ ဇော်ဂျီကော တစ်ခြားယူနီကုတ်ဖောင့်တွေပါ ရှိရင် ပုံမှန်အားဖြင့် fontconfig က ဇော်ဂျီကို ရွေးပါလိမ့်မယ်။ (ဇော်ဂျီက ယူနီကုတ်ဖောင့်တွေထက် code point ပိုများများပါလို့ နေပါလိမ့်မယ်။) ဒါကို မိမိရဲ့ home ဖိုလ်ဒါအောက်မှာ ".fonts.conf" ဆိုတဲ့ ဖိုင်ကို အောက်မှာပြထားသလို ပြင်ပေးဖို့ လိုပါမယ်။ (padauk နေရာမှာ အခြားမိမိနှစ်လိုရာ ဖောင့်နာမည်ကို ပြောင်းပါ။)
၅။ နောက်ပြဿနာ တစ်ခုက ဖောင့်အကြီးအသေးပါ။ မြန်မာဖောင့်တွေကြီးလွန်းတာ သေးလွန်းတာ ချိန်ချင်ရင် fontconfig ကိုပဲ သုံးပြီး ပြင်နိုင်ပါတယ်။
၆။ နံပါတ် (၁) မှာ ဆိုထားတဲ့အတိုင်း ကျနော်စက်မှာ ယူနီကုတ်ဖောင့်တွေထဲက ပိတောက်တစ်ခုပဲ အဆင်ချောချော render လုပ်နိုင်ပါသေးတယ်။ ဒါပေမဲ့ အွန်လိုင်းပေါ်က တစ်ချို့ ဆိုက်တွေက (ဥပမာ-MITP) မြန်မာသရီးကို default လုပ်ထားတတ်ပါတယ်။ ဒါကြောင့် - မြန်မာသရီး ဖောင့်နဲ့ render လုပ်ရမဲ့ စာသားတွေကို padauk နဲ့ ပြောင်းပြီး render လုပ်ချင်တယ် ဆိုပါစို့။ " .fonts.conf" ဖိုင်ကို အောက်မှာ ပြထားသည့်အတိုင်း ထပ်မံ ပြင်ဆင်ပေးဖို့ လိုပါလိမ့်မယ်။
၁။ ယူနီကုတ်ပြောင်းပြောင်းချင်း မြင်သာတဲ့ အကျိုးက မြန်မာစာစီစနစ် (sorting) ကို သုံးလို့ ရလာတာပါ။ အရင်တုန်းက ကျွန်တော် ဇော်ဂျီကို သုံးစဥ်တုန်းက ဖိုင်မန်နေဂျာ(file manager)တွေမှာ မြန်မာ ဖိုင်နာမည်တွေကို နာမည်အလိုက် စီလို့ မရပါဘူး။ ကျွန်တော်စက်ထဲမှာ ဖိုင်နာမည် အတော်များများကို မြန်မာလိုသိမ်းထားတဲ့အခါ နာမည်အလိုက် စီထားတော့ ရှာရဖွေရ ပိုလွယ်လာပါတယ်။ ဖိုင်မန်နေဂျာတွေမှ မဟုတ်ပါ။ အခြား ယူနီကုဒ်ကို အသုံးပြုတဲ့ ပရိုဂရမ်အတော်တော်များများမှာ မြန်မာစာတွေကို အဆင်ချောချော သုံးလို့ရလာပါတယ်။ ဥပမာ - မြန်မာစာတွေကို စီချင်ရင် တစ်ခြားမည်သည့်ဆော့ဖ်ဝဲမှ မလိုပဲ ကွန်မန်းလိုင်းက sort ကို သုံးပြီး စီနိုင်ပါတယ်။
ဒီအတွက် လင်းနက်အတွက် မြန်မာ locale ဖန်တီးရေးသားပေးထားတဲ့သူတွေကို ကျေးဇူးတင်ကြောင်း ပြောလိုပါတယ်။
၂။ ကျွန်တော် စမ်းသပ်မိသလောက် လက်ရှိ ယူနီကုတ်ဖောင့်တွေထဲမှာ ပိတောက်တစ်ခုပဲ ပြည့်ပြည့်ဝဝ မှန်မှန်ကန်ကန် render လုပ်နိုင်ပါတယ်။ ဒါကြောင့် ပိတောက်ကိုပဲ အမြင် သိပ်မလှပေမဲ့ သုံးဖြစ်ပါတယ်။
၃။ ယူနီကုတ် ကီးဘုတ်ကို ဦးဘွန်တုမှာ သုံးချင်ရင် နည်းလမ်း အတော်များများ ရှိပါတယ်။ ပထမတစ်ခုက ကိုစေတန်၊ ကိုဘောက်တူး တို့လုပ်ထားတဲ့ ကီးဘုတ်ကို သုံးတာပါ။ ကွန်မန်းလိုင်းကနေ dpkg -i --force-all zg-mm3-kb.deb ဆိုပြီး သွင်းဖို့ လိုပါမယ်။ နောက်တစ်ခုက ကျနော် အရင်က ရေးထားတဲ့ ibus ကို သုံးပြီး ရိုက်နည်းပါ။ ဇော်ဂျီကီးဘုတ်က သိပ်အဆင်မချောပေမဲ့ ယူနီကုတ် ကီးဘုတ်က ကျနော် စမ်းထားသလောက် အဆင်ပြေပါတယ်။ ဒါမှမဟုတ် ibus မှာပဲ ကိုအိမောင် ရေးထားတဲ့နည်းကို သုံးပြီးလည်း ရိုက်နိုင်ပါတယ်။ ဒါကိုတော့ ကျနော် သေချာ မစမ်းဖြစ်သေးပါ။
၄။ ကျွန်တော် သုံးဖူးသလောက် ဝင်းဒိုး ပရိုဂရမ်တွေမှာ မြန်မာဖောင့်သုံးချင်ရင် သက်ဆိုင်ရာ ပရိုဂရမ်ရဲ့ ဆက်တင်မှာ ဖောင့်ကို မိမိ နှစ်လိုသော မြန်မာဖောင့် ပြောင်းလဲသတ်မှတ် ပေးဖို့လိုပါတယ်။ (ဥပမာ — ဂျီတော့မှာ ဖောင့်မပြောင်းထားရင် မြန်မာစာတွေကို လေးထောင့်အကွက်လေးတွေပဲ မြင်နေရတာမျိုးပါ။) အဲဒီလို ဖောင့်ပြောင်းတာရဲ့ ပြဿနာက မြန်မာဖောင့် အတော်များများရဲ့ အင်ဂလိပ်စာ စာလုံးတွေက မလှတာပါ။ ကံကောင်းတာက ဦးဘွန်းတု ပရိုဂရမ်တွေမှာ အဲလို ဖောင့်ကို တိုက်ရိုက်ကြီး သတ်မှတ်ပေးစရာမလိုပါဘူး။ ဦးဘွန်းတုမှာ သက်ဆိုင်ရာ ဘာသာစကား(စာသား)ကို default ဖောင့်က render မလုပ်နိုင်ဘူးဆိုရင် fontconfig ဆိုတဲ့ library ကို သုံးပြီး အခြား သင့်တော်ရာ ဖောင့်ကို ရွေးချယ် render လုပ်ပေးပါတယ်။ ဒီမှာ ပြဿနာတစ်ခုက ကိုယ့်စက်ထဲမှာ မြန်မာဖောင့်တစ်ခုထက် ပိုရှိနေရင် fontconfig က ဘယ်ဖောင့်ကို ရွေးမလဲဆိုတာပါ။
မိမိ စက်ထဲမှာ မြန်မာဖောင့် တစ်ခုထက် ပိုရှိနေရင် ဘယ်ဖောင့်ကိုရွေးသလဲဆိုတာကို အောက်ပါ ကွန်မန်းကို အသုံးပြုပြီး သိရှိနိူင်ပါတယ်။
fc-match ":lany=my"
ဆိုပါစို့ — စက်ထဲမှာ ဇော်ဂျီကော တစ်ခြားယူနီကုတ်ဖောင့်တွေပါ ရှိရင် ပုံမှန်အားဖြင့် fontconfig က ဇော်ဂျီကို ရွေးပါလိမ့်မယ်။ (ဇော်ဂျီက ယူနီကုတ်ဖောင့်တွေထက် code point ပိုများများပါလို့ နေပါလိမ့်မယ်။) ဒါကို မိမိရဲ့ home ဖိုလ်ဒါအောက်မှာ ".fonts.conf" ဆိုတဲ့ ဖိုင်ကို အောက်မှာပြထားသလို ပြင်ပေးဖို့ လိုပါမယ်။ (padauk နေရာမှာ အခြားမိမိနှစ်လိုရာ ဖောင့်နာမည်ကို ပြောင်းပါ။)
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!--- Use padauk as Default Fallback Font --> <match targe="pattern"> <test qual="any" name="lang" compare="eq"><string>my</string></test> <edit mode="assign" name="family"> <string>padauk</string> </edit> </match> </fontconfig>
၅။ နောက်ပြဿနာ တစ်ခုက ဖောင့်အကြီးအသေးပါ။ မြန်မာဖောင့်တွေကြီးလွန်းတာ သေးလွန်းတာ ချိန်ချင်ရင် fontconfig ကိုပဲ သုံးပြီး ပြင်နိုင်ပါတယ်။
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!--- Use padauk as Default Fallback Font --> <match targe="pattern"> <test qual="any" name="lang" compare="eq"><string>my</string></test> <edit mode="assign" name="family"> <string>padauk</string> </edit> <!--- Change Font Size --> <edit name="pixelsize" mode="assign"> <double>16</double> </edit> </match> </fontconfig>
၆။ နံပါတ် (၁) မှာ ဆိုထားတဲ့အတိုင်း ကျနော်စက်မှာ ယူနီကုတ်ဖောင့်တွေထဲက ပိတောက်တစ်ခုပဲ အဆင်ချောချော render လုပ်နိုင်ပါသေးတယ်။ ဒါပေမဲ့ အွန်လိုင်းပေါ်က တစ်ချို့ ဆိုက်တွေက (ဥပမာ-MITP) မြန်မာသရီးကို default လုပ်ထားတတ်ပါတယ်။ ဒါကြောင့် - မြန်မာသရီး ဖောင့်နဲ့ render လုပ်ရမဲ့ စာသားတွေကို padauk နဲ့ ပြောင်းပြီး render လုပ်ချင်တယ် ဆိုပါစို့။ " .fonts.conf" ဖိုင်ကို အောက်မှာ ပြထားသည့်အတိုင်း ထပ်မံ ပြင်ဆင်ပေးဖို့ လိုပါလိမ့်မယ်။
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!--- Use padauk as Default Fallback Font --> <match targe="pattern"> <test qual="any" name="lang" compare="eq"><string>my</string></test> <edit mode="assign" name="family"> <string>padauk</string> </edit> </match> <!-- replace myanmar3 with padauk --> <match targe="pattern"> <test qual="any" name="family" compare="eq"><string>myanmar3</string></test> <edit mode="assign" name="family"> <string>padauk</string> </edit> </match> </fontconfig>
--- ဆက်ရန် ---
How to install & use Masterpiece Uni Sans on Ubuntu
Why?
- Being linux-native (using pango to render), it is slightly faster to render than other fonts.
- All other unicode fonts except padauk have some (minor) rendering problems on linux. MasterPiece Uni Sans can render properly and look better than padauk.
Steps
1) Download and install the font ttf-masterpiece_0.6-0ubuntu1_all.deb.
2) Download and install the patched pango module. This module is patched, meaning it is different from the original module from Ko Tin Myo Htet (prahita). The original module will not render other unicode fonts like myanmar3, padauk correctly, making burmese text in some sites like mitp scrambled in firefox. If you have previously installed it before, you need to reinstall this file. For other distros, apply this patch, build and install from source.
3) Create a file, ".blacklist-mymr-fonts", in your home directory and put the burmese font names you don't want to render with this module (one font per line). For example,
echo -e "Myanmar3\nPadauk\nZawgyi-One" > .blacklist-mymr-fonts
Now, you can use MasterPiece Uni Sans in all gtk+ applications. You cannot use it in openoffice, since openoffice doesn't use pango. If certain burmese fonts are not rendering properly, don't forget to put their font names in aforesaid ".blacklist-mymr-fonts".
Feb 5, 2011
လင်းနက်စ်ကို ဘာကြောင့်သုံးသင့်လဲ
လင်းနက်စ်နဲ့ ပတ်သတ်ပြီး အမြင်မှားတစ်ချို့
- လင်းနက်က သာမန်လူတွေ သုံးဖို့ မဟုတ်ဘူး။
ကျနော် networking စသင်ကာစက သင်တန်းမှာ သူများတွေကို လင်းနက်စ် သင်နေတာ သွားကြည့်ဖူးပါတယ်။ အဲဒီတုန်းကတော့ အမဲရောင် screen ကြီးမှာ ကွန်မန်းတွေ ရိုက်နေတာကိုပဲ တွေ့တော့ လင်းနက်စ်ဆိုတာ ကွန်ပြူတာ ကျွမ်းကျင်ပညာရှင်တွေပဲ သုံးတာလို့ တွေးမိခဲ့ဖူးပါတယ်။ လင်းနက်စ်အကြောင်း ကြားဖူးကာစ လူတွေလည်း အဲဒီလိုပဲ တွေးတတ်ပါတယ်။ ဟိုးအရင်တုန်းက လင်းနက်စ်ကို ကျွမ်းကျင်ပညာရှင်တွေပဲ အဓိက သုံးခဲ့ပေမဲ့ အခုအချိန်မှာ အဲဒါက မမှန်တော့ပါဘူး။ လင်းနက်စ်ကို အသုံးပြုနေတဲ့ သာမန်ကွန်ပြူတာအသုံးပြုသူ (Desktop User) တွေ သန်းချီ ရှိနေပါပြီ။
- လင်းနက်စ်က ၀င်းဒိုးလောက် မလှဘူး။
မှားပါတယ်။ တစ်ကယ်တော့ လင်းနက်စ်က သေချာပြင်ဆင်သုံးတတ်သွားရင် ၀င်းဒိုးထက် အပြန်တစ်ရာလောက် လှအောင် ဖန်တီးနိူင်ပါတယ်။ အောက်က ဗီဒီယိုတွေကို နမူနာကြည့်နိူင်ပါတယ်။
http://www.youtube.com/watch?v=Of4m0AgPv-o
http://www.youtube.com/watch?v=69bKvvDV7a0
- လင်းနက်စ်က သုံးရတာ ခက်တယ်။
လင်းနက်စ်က သုံးရတာ မခက်ပါဘူး။ ဒါပေမဲ့ ၀င်းဒိုးကို သုံးနေကြလူက လင်းနက်စ်ကို စပြောင်းသုံးတာဆိုရင် လုံးဝကွဲပြားတဲ့ system နှစ်ခု ဖြစ်တဲ့ အညီ ကျင့်သားမရမချင်း နည်းနည်း အခက်တွေ့နိူင်ပါတယ်။ ကျနော်တို့ ၀င်းဒိုးကို စသုံးကာစကလည်း အဲဒီလို အခက်တွေ့ခဲ့တာပဲ ... မဟုတ်ဘူးလား။
- လင်းနက်စ်အတွက် လုပ်ငန်းသုံးပရိုဂရမ်(Application)တွေ သိပ်မရှိဘူး။
ဒါလည်း မှားပါတယ်။ လင်းနက်စ်အတွက် ရေးထားတဲ့ ပရိုဂရမ်တွေ ထောင်ချီပြီးတော့ ရှိပါတယ်။ လင်းနက်စ်က အခုမျက်မှောက်မှာ ၀င်းဒိုးလောက် ဆောဖ့်ဝဲတွေ မရှိသေးဘူးဆိုပေမဲ့ ၀င်းဒိုးအတွက် ထုတ်လုပ်ထားတဲ့ ပရိုဂရမ်တွေ အများစုကို လင်းနက်စ်မှာ ဝိုင်(Wine) ဆိုတဲ့ ပရိုဂရမ်နဲ့ အသုံးပြုနိူင်ပါတယ်။ ပြီးတော့ အခုနောက်ပိုင်း ကုမ္ပဏီ အများစုက ၀င်းဒိုးအတွက်သာမက လင်းနက်စ်အတွက်ပါ ပရိုဂမ်တွေ ထုတ်လာကြပါပြီ။
- လင်းနက်က သွင်းရခက်တယ်။
လုံးဝ လုံးဝကို မှားပါတယ်။ လင်းနက်စ်လောက် သွင်းရလွယ်တာ လင်းနက်စ်ပဲ ရှိပါတယ်။ လင်းနက်စ်က ၀င်းဒိုးထက် သွင်းရတာ ပိုမြန်သလို ပိုလဲလွယ်ပါတယ်။ လင်းနက်စ်ကို မိမိကွန်ပြူတာမှာ မသွင်းပဲ စီဒီရွမ်ကနေ စမ်းသုံးကြည့်လို့တောင် ရပါတယ်။
ဘာလို့ လင်းနက်စ်ကို သုံးသင့်လဲ
- လင်းနက်စ်က ငွေကြေးအကုန်အကျ သက်သာတယ်။
၀င်းဒိုးကို အသုံးပြုဖို့ ဒေါ်လာရာနဲ့ချီပြီး ၀ယ်ရတာပါ။ မြန်မာငွေဆို သိန်းချီပြီး ကျမှာပေါ့။ ကျနော်တို့ မြန်မာနိူင်ငံမှာ အခု ၀င်းဒိုးကို သုံးနေတာ အများစုက လိုင်စင်မဲ့ (pirate) ခိုးသုံးနေကြတာပါ။ ဒါက အခုအချိန်မှာ ပြဿနာ မရှိသေးပေမဲ့ နောင်တစ်ချိန်မှာ ရှိလာနိူင်ပါတယ်။ လင်းနက်စ်ကိုတော့ အခမဲ့ အင်တာနက်ပေါ်က ဒေါင်းလုပ်လုပ်ပြီး သုံးစွဲနိူင်ပါတယ်။ ပြီးတော့ ၀င်ဒိုးမှာ တစ်ခြား ပရိုဂရမ်တွေ အများစုကလည်း ပိုက်ဆံပေးဝယ်ရတာပါ။ လင်းနက်စ် ပရိုဂရမ်တွေ အများစုက အခမဲ့ပါ။ ဥပမာ - ၀င်းဒိုးအတွက် ရုံးသုံးပရိုဂရမ်(Microsoft Office) ကို ဒေါ်လာရာချီပြီး ပေးဝယ်ရပါလိမ့်မယ်။ ထိုနည်းတူ မိမိ ဓာတ်ပုံလေးတွေ ပြင်ဆင်လိုပြန်ပြီဆိုရင် ဖိုတိုပြင်တဲ့ ပရိုဂရမ်(Adobe Photoshop) ကို ၀ယ်ရပါလိမ့်မယ်။ လင်းနက်စ်မှာတော့ Open Office, GIMP အစရှိတဲ့ ပရိုဂရမ်တွေကို အခမဲ့ ရယူနိူင်သုံးစွဲနိူင်ပါတယ်။
- လင်းနက်စ်က လွတ်လပ်မူ (Freedom) ရှိတယ်။
အခမဲ့ဖြစ်တာနဲ့ လွတ်လပ်တာနဲ့ မတူပါဘူး။ တစ်ချို့ ပရိုဂရမ်တွေက အခမဲ့ ရယူသုံးစွဲနိူင်ပေမဲ့ အဲဒီ ပရိုဂရမ်ကို မိမိ စိတ်ကြိုက်ပြင်ဆင် သုံးဆွဲနိူင်ခွင့် မရှိသလို တစ်ခြား သူတွေကိုလည်း ပြန်လည်မျှဝေခွင့် မရှိအောင် လိုင်စင်တွေနဲ့ ကန့်သတ်ထားပါတယ်။ အဲဒါတွေကို freeware လို့ခေါ်ပါတယ်။ ဒါပေမဲ့ လင်းနက်စ်နဲ့ လင်းနက်စ်ပရိုဂရမ်အများစုကို ဘယ်လို ရေးသားထားတယ်ဆိုတာ မိမိကိုယ်တိုင် လေ့လာကြည့်ရူပြီး မိမိစိတ်ကြိုက်ပြင်ဆင် သုံးစွဲနိူင်ပါတယ်။ ပြီးတော့ လွတ်လွတ်လပ်လပ် ပြန်လည်မျှဝေခွင့် ရှိပါတယ်။ အဲဒါကို free software လို့ခေါ်ပါတယ်။ ၀င်းဒိုးက လိုင်စင်တွေနဲ့ ကန့်သတ်ထားလို့ လွတ်လပ်ခွင့် လုံးဝ မရှိပါဘူး။ မိမိက ၀ယ်ပြီးသွားရင်တောင် ကွန်ပြူတာတစ်လုံးဆို တစ်လုံးမှာပဲ သုံးရပါမယ်။ နောက်တစ်လုံးမှာ သုံးချင်ရင် နောက်လိုင်စင်တစ်ခု ထပ်ဝယ်ရပါမယ်။ လင်းနက်စ်မှာတော့ မိမိစိတ်တိုင်းကျ လွတ်လွတ်လပ်လပ် သုံးစွဲပြီး ပြန်လည်မျှဝေနိူင်ပါတယ်။
- လင်းနက်စ်က ပိုမိုလုံခြုံပြီး ပြဿနာရှင်းတယ်။
လင်းနက်စ်က ၀င်းဒိုးထက် အများကြီး ပိုပြီး လုံခြုံစိတ်ချရပါတယ်။ ဒါကြောင့်လည်း လုံခြုံရေး (Security) အဓိက ဖြစ်တဲ့ အင်တာနက်ဆာဗာတွေ အများစုက လင်းနက်စ်ကိုပဲ သုံးကြတာပါ။ လင်းနက်ကို သုံးရင် BSOD (Blue Screen of Death), Virus, Worms, Trojan တွေကို မေ့ထားနိူင်တယ်။ Anti-Virus, Firewall တွေ အတွက်လည်း ခေါင်းစားစရာ လိုတော့မှာ မဟုတ်ဘူး။ လင်းနက်စ်မှာ စက်ဟန်းသွားလို့ ကွန်ပြူတာ ပြန်စရတယ်(restart) ဆိုတာ မရှိပါဘူး။
- လင်းနက်စ်က ပိုမိုယုံကြည်စိတ်ချရတယ်။
၀င်းဒိုးက closed source၊ လင်းနက်စ်က open source ပါ။ Source(source code) ဆိုတာက ကွန်ပြူတာ ပရိုဂရမ်တွေကို ဘယ်လိုရေးသားထားလဲဆိုတဲ့ နည်းပါ။ ဥပမာ - ပြောရရင် ကျနော်တို့ ကိတ်မုန့် ၀ယ်တယ် ဆိုပါစို့။ ကိတ်မုန့်ကို ဘယ်လိုဖုတ်ထားတယ်ဆိုတဲ့ အသေးစိတ်ကို ကျနော်တို့ မသိနိူင်ပါဘူး။ ထိုနည်းတူ closed source ပရိုဂရမ်တွေကို ဘယ်လိုရေးသားထားပြီး ဘာတွေလုပ်တယ်ဆိုတယ်ကို ကျနော်တို့ သေချာ မသိနိူင်ပါဘူး။ ပြဿနာက ကိတ်မုန့်ထဲ ဘာပါတယ်ဆိုတာကို ကျနော်တို့ သေချာ မသိနိူင်သလို closed source ပရိုဂရမ်တွေ ဘာတွေလုပ်နေတယ်ဆိုတာ ကျနော်တို့ မသိနိူင်ပါဘူး။ မိုက်ကရိုဆောဖ့်က ကျနော်တို့ရဲ့ အရေးကြီးတဲ့ ကိုယ်ရေးကိုယ်တာအချက်အလက်တွေကို အင်တာနက်က တစ်ဆင့်ပြန်ပြီး စုဆောင်းနေသလားဆိုတာ ဘုရားသခင်နဲ့ ဘီလ်ဂိတ်ပဲ သိပါတယ်။ :P လင်းနက်မှာတော့ open source ဖြစ်တဲ့အတွက် ဘာတွေဘယ်လို ရေးသားထားတယ်ဆိုတာကို လူတိုင်းကြည့်ရူ စစ်ဆေးနိူင်ပါတယ်။ တစ်ကယ်လည်း ကွန်ပြူတာပညာရှင်များစွာက လေ့လာစစ်ဆေးနေတာပါ။ ဒါကြောင့် open source ပရိုဂရမ်တွေက ပိုပြီး ယုံကြည်စိတ်ချရပါတယ်။
- လင်းနက်စ်ကို လက်ဝါးကြီးအုပ်ထားတဲ့ ကုမ္ပဏီ မရှိပါဘူး။
၀င်းဒိုးကို ကုမ္ပဏီတစ်ခုတည်း(မိုက်ကရိုဆောဖ့်)ကပဲ လက်ဝါးကြီးအုပ် ထားတာပါ။ ဥပမာ ဆိုပါစို့ - မိုက်ကရိုဆောဖ့်ကို ၀င်းဒိုးကို ဆက်မထုတ်တော့ဘူးဆိုရင် ကျနော်တို့ ဘာမှ မတတ်နိူင်ပါဘူး။ လင်းနက်စ်က အဲဒီလို ကုမ္ပဏီ တစ်ခုတည်းကို မှီခိုတာ မရှိပါဘူး။ Red Hat က ဖီဒိုရာ(Fedora) လင်းနက်စ်ကို ဆက်မထုတ်တော့ဘူးဆိုရင် ကျနော်တို့ Canonical က အူဘွန်တု(Ubuntu) လင်းနက်စ် ကိုသုံးနိူင်ပါတယ်။ ဒါမှမဟုတ် လင်းနက်စ်က အထက်မှာဆိုခဲ့တဲ့အတိုင်း free software ဖြစ်တဲ့အတွက် မိမိကိုယ်တိုင် ကုမ္ပဏီထောင်ပြီး ပြန်လည်ဖြန့်ဝေလို့ရပါတယ်။
- လင်းနက်က ပိုမိုအဆင်မြင့်ကောင်းမွန်တယ်။
၀င်းဒိုးမှာ လုံးဝ မဖြစ်နိူင်တဲ့ ပိုမိုအဆင့်မြင့်ကောင်းမွန်တဲ့ နည်းပညာတွေ လင်းနစ်မှာ အများကြီးပါပါတယ်။ ဥပမာ ဆိုပါစို - ၀င်းဒိုးမှာ ကွန်ပြူတာမှာ ရှိသမျှ ပရိုဂရမ်တွေ အားလုံးကို upgrade လုပ်ဖို့ မလွယ်ပါဘူး။ window update ရှိပေမဲ့ အဲဒါက မိုက်ကရိုဆောဖ့်က ဆောဖ့်ဝဲတွေပဲ update လုပ်နိူင်တာပါ။ တစ်ခြား မိုက်ကရိုဆော့ဖ်က မဟုတ်တဲ့ ဆောဖ့်ဝဲတွေ (Winzip, Winrar, Firefox, Nero Burning, PowerDVD ...) အစရှိတာတွေကို တစ်ခုချင်းလိုက်ပြီး update လုပ်ရမှာပါ။ လင်းနက်စ်မှာတော့ ကလစ်တစ်ချက်နှိပ်ရုံနဲ့ ကွန်ပြူတာထဲမှာ သွင်းထားတဲ့ ပရိုဂရမ်တွေအားလုံးကို update လုပ်နိူင်ပါတယ်။
- လင်းနက်စ်က ပိုမြန်တယ်။
ဒါက ကိုယ်တိုင်သုံးကြည့်မှ သိမှာပါ။ ဒါက အူဘွန်တုလင်းနက်စ်နဲ့ ၀င်းဒိုးကို နိူင်းယှဉ်ပြထားတာပါ။
- လင်းနက်စ်က မိမိ စိတ်ကြိုက် ပြင်ဆင်လို့ရတယ်။
၀င်းဒိုးမှာဆိုရင် ပြင်ဆင်လို့ရတယ်ဆိုပေမဲ့ အကန့်အသတ်ရှိပါတယ်။ နောက်ခံပုံတွေ၊ ကာလာဒီဇိုင်း၊ အထားအသိုတွေ ပြောင်းလို့ရပေမဲ့ အခြေခံ Desktop Enviroment ပုံစံက တူတူပါပဲ။ လင်းနစ်မှာတော့ Desktop Enviroment ကို GNOME/KDE/xfce/Open Box/Xmonad အစရှိသဖြင့် မိမိ စိတ်တိုင်းကျ ရွေးချယ်ပြီး အသေးစိတ် ပြင်ဆင်နိူင်ပါတယ်။
- လင်းနက်စ်မှာ အရမ်းမိုက်တဲ့ CLI ဆိုတာ ရှိတယ်။
ဒါက သာမန်ကွန်ပြူတာအသုံးပြုသူတွေ အတွက် သိပ်အရေးမပါလှပေမဲ့ ကျနော်တို့လို ကွန်ပြူတာသမားတွေ အတွက် အရမ်းအသုံးဝင်ပါတယ်။ တစ်ချို့ကိစ္စတွေမှာ GUI(Grahpical User Interface)ထက် CLI(Command Line User Interface)က ပိုသင့်လျော်ပါတယ်။ ဥပမာ - မိမိက ဖိုလ်ဒါတစ်ခုမှာ ရာချီရှိတဲ့ text file တွေအားလုံးထဲက OS ဆိုတဲ့ စကားလုံးပါတာကို ရှာချင်တယ် ဆိုပါစို့။ လင်းနက်စ်မှာ "grep 'OS' -R ." ဆိုတဲ့ ကွန်မန်းလေး တစ်ခုနဲ့တင် ပြီးပါတယ်။
Subscribe to:
Posts (Atom)









