Colorizing VIM

The more you use vim, the further you are from all other text editors. However, when you get your new box ready, vim is likely not to enable syntax color by default. You can choose to do that individually or for everyone. If you decide to let other manage this on their own, you can just create ~/.vimrc or you can opt for system wide setting in /etc/vim/vimrc.

in /etc/vim/vimrc, you will find:-

" syntax

on which mean it’s commented out. What you have to do is uncomment it, save, and try. For ~/.vimrc, you can just touch that file and type syntax on or you can just do:

$ echo 'syntax on' > ~/.vimrc

That should do it.

Popularity: 2% [?]

How to install Thai input in Eee PC

I don’t know if this is useful, but I found many sites mentioned that Eee (Xandros) is not capable of handling Thai–only for input, I guess. So this could help somebody who passes by and is finding how to add Thai as an input language.

Originally, Eee PC comes with English and Chinese, of course. Thus, it needs something to switch between those languages already. Luckily it is SCIM - Smart Commom Input Method Platform. If you are familiar with another linux distro and using other language besides English, you will know it well. This is all you have to know in order to add Thai or any language as a keyboard input.

image

source: screenshot of openSUSE 10.3

Basically, SCIM has 2 parts which are core programs and tables (.bin & .png) for any languages. Usually, when you install SCIM, it will bundle tons of table for you to choose, but unfortunately Eee does have only English and Chinese. So, what you have to do is copying the table for the language you need into SCIM directory. That’s it!

I upload all non-CJK tables for SCIM in Sky Drive here, it’s only 110kB, so you may add all that or just choose what you want.

After you got the file, you have to extract and put them in

/usr/share/scim/

or if you want to add only Thai language, you have to copy Thai.png in icons folder to /usr/share/scim/icons and Thai.bin in tables folder to /usr/share/scim/tables. (you have to gain root privilege in order to do so)

image

Then you have to set for a hotkey for switch the language a bit. You might not use grave accent though since grave button is not on the right place as usual keyboard. I found that Ctrl+space is very comfortable way to switch, but it’s just my way.

Step-by-Step: how to add thai for eee pc:

1. download SCIM table from my Sky Drive here
2. Extract to where you want, assume /home/user
3. get into Terminal (Ctrl + Alt + T)
4. gain root privilege

sudo -i

5. copy 2 files needed for a lauguage you want

cp /home/user/scim/icons/Thai.png /usr/share/scim/icons/
cp /home/user/scim/Tables/Thai.bin /usr/share/scim/tables/

6. right-click on SCIM and set for a hotkey
7. you are now able to type Thai on Eee PC, congratulation!

#—–added on 2007-12-25—- การลงภาษาไทยใน eee pc ——–#
Additional part for you guys who prefer Pattachote keyboard layout (ปัตตะโชติ บน eee pc) pattachote on Eee; ปัตตโชติ บน eee

First of all, you don’t have to follow the step above. You have to do something a bit different which is adding scim-thai repository.
1. Get into terminal by ctrl+alt+t
2. add repository that has scim-thai (one I know is from linux.thai.net)

sudo kwrite /etc/apt/sources.list

add the following line into the file, then save and exit.

deb http://linux.thai.net/apt ./

3. update the repositories and install scim-thai in terminal

sudo apt-get update

You may have to try several times until you haven’t seen an error. Then:-

sudo apt-get install scim-thai

apt-get_scim-thai
4. once you finished installation; restart once–I don’t think it needs to but scim sometimes confuses about adding new stuffs.
choose_layout_in_scim-thai
5. After you get back; setting in SCIM then you all set!
test_keyboard_on_eee

Happy New Year! I hope you find some fun with your Eee PC!

Popularity: 26% [?]

how to config Samba server and user

First, I was switching from all time Windows user to Linux user, more specifically Ubuntu–first Linux that I can use regularly. I was wondering if I can share files over the network with Windows as well. I know that there is Samba service out there but I don’t know how to configure it properly. I messed things up as usual; all I knew to make it work is editing /etc/samba/smb.conf as security=share. Then I could get in there easily but no protection at all. Now I know, so I think it might be a good idea to explain in my ways instead of reading any-distro-docs which sometimes is too complex for novice users.

First of all, you have to install Samba server. I won’t go through this process because if you don’t know about this, you have to find out and get used to Linux first. My recommendation is trying with Debian, such as Ubuntu. It’s really easy to understand.

Second, we have to configure the smb.conf file. This time you have to be as “root” to make a share folder. You have 2 choices here, GUI or editing the file. I found that GUI is easy to understand but I can’t get it work for some reasons, thus I choose the traditional way :-P

After we already created share folders, we have to create a user for Samba too. This the point I misunderstood for a while; I thought that Samba will use the user from the system; however, it’s not and system and Samba user are not the same as well.

These 3 steps are all you have to do to make it work perfectly. I brief all the processes first so you can imagine what we are doing in each step.

for editing Samba configuration file (smb.conf) you have to get in there

sudo gedit /etc/samba/smb.conf

once you get in there you will find a lot of comments and samples; you may go through the file for more understanding of each. However, we will pay attention to how to set share folder.

[share-name]
path = /media/hdax/xxx/
comment = whatever you want
available = yes
browsable = yes
public = yes
writable = yes/no

This is what you have to insert at the end of the file. After you put the proper value, you will be able to see this share from another Windows PCs. However, you can’t browse the file right now because of login window. Whatever user and password you fill are not working :-P Don’t be surprise, that’s normal. You still have to know 2 more values which are

valid user = user-name
guest ok = yes/no

the first one, valid user, is which user you give permission to read and/or write. Another one, guest ok, is to enable guest user which is read-only user.

After this step, if you enable guest user, you will be able to see the share folder without any problem. If not, you still have to go on setting user.

For creating user, you will run the smbpasswd utility to create user and password

sudo smbpasswd -a user-name

Then you have to add that user to smbusers file

sudo gedit /etc/samba/smbusers

What you have to put in there is this form

system-user-name = “smb-user-name”

As you see, you may use Samba username (is what you add in smbpasswd) that differs from your username in the system depending on choice of preference.

All these methods above, you will be able to make many share folders with many conditions as you wish :-P

Note: If you just want to share all share folders without any restricts, you may change the line security = user in smb.conf to security = share and that’s all set.

Popularity: 13% [?]