Tuesday, August 17, 2010

Vim 7.3 Released

On 16 August 2010, I had received an email from Vim google mailing list, this mail announce that Vim 7.3 was released to public finally. You can check below quote for release note by Bram Moolenaar.

Hello Vim users,

Announcing:  Vim (Vi IMproved) version 7.3

This is a minor release of Vim.  It consists of Vim 7.2 plus all
patches, updated runtime files and some more, see below.  It has been
two years since the 7.2 release, thus it's not that "minor".  But not
"major" either.  Something in between, don't know how to call that.

The most notable additions since 7.2:
- Persistent undo and undo for reload
- Blowfish encryption, encryption of the swap file
- Conceal text
- Lua interface
- Python 3 interface

Once you have installed Vim 7.3 you can find all the details about the
changes since Vim 7.2 with:
        :help version-7.3


If you like Vim, this is the way to say thanks:

Where to get it

The best way to obtain the latest Vim 7.3 is using Mercurial.
        hg clone vim
        cd vim/src
        hg update vim73
More information here:

All downloadable files can be found below this directory:

Direct link to the MS-Windows self-installing executable:

Information about which files to download for what system:

A list of mirror sites can be found here:

unix/vim-7.3.tar.bz2           sources + runtime files, bzip2 compressed

MS-WINDOWS one-size-fits-all:
pc/gvim73.exe                  installer for GUI and console executables,
                               includes all runtime files, many features

doc/              help files converted to HTML

MS-WINDOWS separate files:
pc/                 runtime files
pc/                  GUI binary for Windows 95/98/NT/2000/XP
pc/               GUI binary with OLE support
pc/                GUI binary for Windows 3.1 (untested)
pc/                console version for MS-DOS/Windows 95/98
pc/                console version for Windows NT/2000/XP
pc/                sources for PC (with CR-LF)

unix/vim-7.2-7.3.diff.gz               sources + runtime files
unstable/unix/vim-7.3f-7.3.diff.gz     sources + runtime files

Omitted in this version are:
- Extra and lang archives, these are now included in the main source
  and runtime archives.
- The 16-bit DOS, OS/2 and Amiga versions, these are obsolete.

Mailing lists

For user questions you can turn to the Vim mailing list.  There are a
lot of tips, scripts and solutions.  You can ask your Vim questions, but
only if you subscribe.  See

If you want to help Vim development, discuss new features or get the
latest patches, subscribe to the vim-dev mailing list.  See

Subject specific lists:
Multi-byte issues:
Macintosh issues:

Before you ask a question you should search the archives, someone may
already have given the answer.

Reporting bugs

Send them to>.  Please describe the problem precisely.
All the time spent on answering mail is subtracted from the time that is
spent on improving Vim!  Always give a reproducible example and try to
find out which settings or other things influence the appearance of the
bug.  Try starting without your own vimrc file: "vim -u NONE".  Try
different machines if possible.  See ":help bugs" in Vim.  Send me a
patch if you can!

Happy Vimming!

Q: Should I clean my house or work on Vim?
A: Whatever contains more bugs.

 /// Bram Moolenaar -- --   \\\
///        sponsor Vim, vote for features -- \\\
\\\        download, build and distribute --        ///
 \\\            help me help AIDS victims --    ///

Thursday, August 5, 2010

Bad Evince Font in Slackware

When I install evince on my Slackware, sometimes I encounter a strange problem which is the font is not display correctly or looks weird, as like the picture below:

You can see that there are fonts look too bold and inconvenient to read. After diving in google, I found that the problem comes from the Nimbus font in slackware package. To check and fix it you can follow instructions below:
  • Check fonts in pdf file
  • $ pdffonts file.pdf
    name                                 type      emb sub uni object ID
    ------------------------------------ --------- --- --- --- ---------
    Times-Italic                         Type 1    no  no  no       5  0
    Times-Roman                          Type 1    no  no  no       7  0
    Times-Bold                           Type 1    no  no  no      13  0
    Courier-Bold                         Type 1    no  no  no      18  0
    XOEOHB+CMSY10                        Type 1    yes yes no      21  0
    Courier                              Type 1    no  no  no      23  0
    RXRCVR+CMSY7                         Type 1    yes yes no      26  0
    CRMLEZ+NimbusRomNo9L-Regu-Slant_167  Type 1    yes yes no      32  0
  • Check"Times" compatible font
  • $ fc-match "times"
    n021004l.pfb: "Nimbus Roman No9 L" "Medium"
  • Find n021004l.pfb location
  • $ su
    # find / -name "n021004l.pfb" -print
  • Download new n021004l.pfb
  • As I get from searching in google, the problem is n021004l.pfb in Slackware package is not updated yet, so we need to replace it with the new one. In this case I'll replace it with the Fedora 13 URW fonts package. You can download the package from
  • Extract the rpm package
  • # rpm2cpio urw-fonts-2.4-9.fc13.noarch.rpm | cpio -idmv 
  • Copy fonts file and reboot
  • # cd usr/share/fonts/default/Type1
    # cp n021004l.pfb /usr/share/fonts/Type1/n021004l.pfb
    # reboot 

After reboot then I check evince display, and the result is like below. There we can see that the font looks better and convenient than before.

I hope this tutorial is helpful.

Monday, July 26, 2010

Get apk from phone

When I do flashing my Samsung Spica for the first time, I lost all of my application. It means I need to download it all again from market and costs my credit. Therefore I need to get my apk from phone, and backup it all to my PC.

After doing some tests and trials based on a clue from my friend. I finally find a way to backup all of applications by downloading all installed apk from the phone, and it's really simple.

Before going further, we need to install android SDK:

  • Download android sdk from here 
  • Extract android sdk zip file to C:\
  • Add this "C:\android-sdk-windows\tools" to windows path in environment variable

And then to allow you accessing /data/app directory, you must have root permission therefore wee need to root the device. You can follow instructions in here to root your device here, but please be careful because it can bricks your device.

When you download applications from market, the system will store the apk files in /Data/app. Base on this information we can pull all of downloaded apk from phone to PC by using adb pull command.

adb pull /data/app "your destination directory"

And you can find all of your downloaded apk in "your destination directory".

Monday, July 19, 2010

PDCurses for MinGW32

As I know MinGW doesn't come with graphic control library, it isn't like borland or turbo which brings conio.h. But you can use curses library for alternative. If you use Linux you can find ncurses library, but if you're windows user you can use PDcurses.

In this tutorial I'll explain how to install PDcurses for MinGW32 compiler in MS Windows. The first things you need are Installed MinGW32 compiler and PDcurses source. You can download MinGW from here and PDcurses from here.

Set up MinGW32
  1. Install MinGW32, don't forget to install 'MinGW make' also (if you don't want to install MSys), in this case I'll install MinGW in C:\MinGW
  2. Set environment path for MinGW bin directory
    • Go to control panel
    • Click System
    • Choose Advanced tab and click "Environment Variables" button
    • Add PATH variable for user, if you have one you can skip this
    • Select PATH variable and Edit
    • In "variable value" text box, add C:\MinGW\bin, and don't forget to use ';' (semicolon) as delimiter
  3. If you didn't install MSys so you need to rename mingw32-make.exe become make.exe
  4. CD C:\MinGW\bin
    RENAME mingw32-make.exe make.exe

Install PDcurses
  1. I assume you have downloaded PDCurses source successfully, in this case I have downloaded PDCurses-3.4.tar.gz
  2. Unpack it by using winrar to C:\ and you will have C:\PDCurses-3.4 directory
  3. Compile win32 PDcurses with DLL
  4. CD C:\PDCurses-3.4\win32
    make -f gccwin32.mak DLL=Y

  5. Copy pdcurses.dll to C:\MinGW\bin
  6. COPY pdcurses.dll C:\MinGW\bin
  7. Copy pdcurses.a to be C:\MinGW\lib\libpdcurses.a
  8. COPY pdcurses.a C:\MinGW\lib\libpdcurses.a
  9. Copy pdcurses header file to C:\MinGW\lib\include
  10. CD ..
    COPY *.h C:\MinGW\include

Test PDcurses
  1. Create test.c
  2. #include <curses.h> int main()
        printw("Hello World !!!\n");
        return 0;

  3. Compile test.c and check if there is any error
  4. gcc test.c -o test -lpdcurses
  5. Test executable file. If you can see "hello world" it means everything goes well
  6. test.exe

I hope this tutorial will be helpful for who need it.

Wednesday, June 9, 2010

Upgrade to Slackware 13.1

Slackware 13.1 has been released on 24 May 2010. There are updates for some packages and kernel. Usually every Slackware released I will choose fresh install before use it, but now I won't choose that, I'll choose to upgrade.

Before going further. To keep my configuration files safe I need to backup my /etc folder. In this case I backup it by creating iso image of /etc and keep the owner and permission of those files. You can do below method for your important files aswell.
# mkisof -o ~/etc-backup.iso -R /etc
And then check it
# mount -t iso9660 -o loop=/dev/loop0 ~/etc-backup.iso /mnt/tmp
# ls -ll /mnt/tmp

Next step is based on UPGRADE.TXT instructions, you can find it in root directory of Slackware distribution package. There area some steps to do to Upgrade your slackaware:
  • Create packages folder
  • Switch to single user
  • Upgrade package utility and related tools
  • Upgrade glibc shared libraries
  • Upgrade packages and install new packages
  • Remove obsolete packages
  • Fix or install new configuration files
  • Finishing
  • Reboot

Create packages directory
You need to create directory which contains Slackware 13.1, you can download it one by one or download it in ISO format. In my case I download ISO file from one of this mirror and extract it into "Slackware packages" directory
# mount -t iso9660 -o loop=/dev/loop0 slackware-13.1-install-dvd.iso /mnt/tmp
# mkdir /slackware
# cp -rf /mnt/tmp/* /slackware/*

Basically I can use /mnt/tmp as "Slackware packages directory" but I prefer to copy it to another directory as my "Slackware packages" directory. It's only for safety and stability.

Switch to single user
I just do a simple command to switch into single user
# telinit 1

Upgrade package utility and related tools
Before going further we need to upgrade tools that related to packaging
# upgradepkg /slackware/a/pkgtools-*.tgz
# upgradepkg /slackware/a/tar-*.tgz
# installpkg /slackware/a/xz-*.tgz
# upgradepkg /slackware/a/findutils-*.txz

Upgrade glibc shared libraries
# upgradepkg /root/slackware/a/glibc-solibs-*.t?z

Upgrade packages and install new packages
If you want to upgrade and install all new packages, you can use command below
# upgradepkg --install-new /root/slackware/*/*.t?z
If you want to uprage and install new package based on package group you can use command below, just add and remove package group in looping.
for dir in a ap d e f k kde l n t tcl x xap y ; do
    ( cd $dir ; upgradepkg --install-new *.t?z )

You can check the description of those package group below:
A : The base system.
AP : Various applications that do not require the X Window System.
D : Program development tools.
E : GNU Emacs.
F : FAQs, HOWTOs, and other miscellaneous documentation.
K : The source code for the Linux kernel.
KDE : The K Desktop Environment.
KDEI : Language support for the K Desktop Environment.
L : System libraries.
N : Networking programs.
T : teTeX document formatting system.
TCL : The Tool Command Language, Tk, TclX, and TkDesk.
X : The base X Window System.
XAP : X applications that are not part of a major desktop environment.
Y : Games (the BSD games collection, Sasteroids, Koules, and Lizards).

Remove obsolete packages
You can remove obsolete packages in Slackware 13.1 by using command below:
#removepkg bluez-libs bluez-utils cupsddk device-mapper epic4 gqview \
     kdelibs-experimental lbxproxy libgtkhtml liblbxutil libungif \
     libv4l loadlin mpg321 mplayerthumbs proxymngr xf86-input-citron \
     xf86-input-elographics xf86-input-fpit xf86-input-hyperpen \
     xf86-input-mutouch xf86-video-newport xf86-video-xgixp

Fix or Install New Configuration file
Upgrading means you will have new configuration files in etc, if you brave enough you can apply script below to apply it.
cd /etc
find . -name "*.new" | while read configfile ; do
if [ ! "$configfile" = "./rc.d/" \
    -a ! "$configfile" = "./rc.d/" \
    -a ! "$configfile" = "./" \
    -a ! "$configfile" = "./" \
    -a ! "$configfile" = "./" ]; then
    cp -a $(echo $configfile | rev | cut -f 2- -d . | rev) \
        $(echo $configfile | rev | cut -f 2- -d . | rev).bak 2> /dev/null
    mv $configfile $(echo $configfile | rev | cut -f 2- -d . | rev)

You should upgrade/merge your man.conf file and vimrc with these file:

# reboot

If you've installed some packages that are not in Slackware default, you need to recheck it functionality, and if you find problem I think you need to recompile the software or it's dependency.

Saturday, May 29, 2010

Slackware 13.1 has been released

Yes, it's that time again! After many months of development and
careful testing, we are proud to announce the release of Slackware
version 13.1!

We are sure you'll enjoy the many improvements. We've done our best
to bring the latest technology to Slackware while still maintaining the
stability and security that you have come to expect. Slackware is well
known for its simplicity and the fact that we try to bring software to
you in the condition that the authors intended.

Slackware 13.1 brings many updates and enhancements, among which
you'll find two of the most advanced desktop environments available
today: Xfce 4.6.1, a fast and lightweight but visually appealing and
easy to use desktop environment, and KDE 4.4.3, a recent stable release
of the new 4.4.x series of the award-winning KDE desktop environment.
We continue to make use of HAL (Hardware Abstraction Layer) and udev,
which allow the system administrator to grant use of various hardware
devices according to users' group membership so that they will be able
to use items such as USB flash sticks, USB cameras that appear like USB
storage, portable hard drives, CD and DVD media, MP3 players, and more,
all without requiring sudo, the mount or umount command. Just plug and
play. Properly set up, Slackware's desktop should be suitable for any
level of Linux experience. New to the desktop framework are ConsoleKit
and PolicyKit. ConsoleKit handles "seats", things like dealing with
devices when switching from one user to another. PolicyKit is a system
for fine-grained access control, allowing a non-root user to run certain
tasks with elevated privilege, but more securely than if the entire task
were simply run as root.

Slackware uses the kernel bringing you advanced performance
features such as journaling filesystems, SCSI and ATA RAID volume
support, SATA support, Software RAID, LVM (the Logical Volume Manager),
and encrypted filesystems. Kernel support for X DRI (the Direct
Rendering Interface) brings high-speed hardware accelerated 3D graphics
to Linux.

There are two kinds of kernels in Slackware. First there are the
huge kernels, which contain support for just about every driver in the
Linux kernel. These are primarily intended to be used for installation,
but there's no real reason that you couldn't continue to run them after
you have installed. The other type of kernel is the generic kernel, in
which nearly every driver is built as a module. To use a generic kernel
you'll need to build an initrd to load your filesystem module and
possibly your drive controller or other drivers needed at boot time,
configure LILO to load the initrd at boot, and reinstall LILO. See the
docs in /boot after installing for more information. Slackware's Linux
kernels come in both SMP and non-SMP types now. The SMP kernel supports
multiple processors, multi-core CPUs, HyperThreading, and about every
other optimization available. In our own testing this kernel has proven
to be fast, stable, and reliable. We recommend using the SMP kernel
even on single processor machines if it will run on them.

Here are some of the advanced features of Slackware 13.1:

- Runs the version of the Linux kernel from
Also included is a kernel patched with Speakup to support speech
synthesizers providing access to Linux for the visually impaired
community. The 2.6.x kernel series has matured into a stable
kernel, and provides reliable performance for your desktop or
your production server.

- System binaries are linked with the GNU C Library, version 2.11.1.
This version of glibc also has excellent compatibility with
existing binaries.

- X11 based on the X.Org Foundation's modular X Window System.
There's been much activity in the X development world, and the
improvements in terms of performance and hardware support are
too numerous to mention them all here.

- Installs gcc-4.4.4 as the default C, C++, Objective-C,
Fortran-77/95, and Ada 95 compiler.

- Support for fully encrypted network connections with OpenSSL,
OpenSSH, OpenVPN, and GnuPG.

- Apache (httpd) 2.2.15 web server with Dynamic Shared Object
support, SSL, and PHP 5.2.13.

- PCMCIA, CardBus, USB, IEE1394 (FireWire) and ACPI support. This
makes Slackware a great operating system for your laptop.

- The udev dynamic device management system for Linux 2.6.x.
This locates and configures most hardware automatically as it
is added (or removed) from the system, and creates the access
nodes in /dev. It also loads the kernel modules required by
sound cards and other hardware at boot time.

- New development tools, including Perl 5.10.1, Python 2.6.4,
Ruby 1.9.1-p378, Subversion 1.6.11, git-1.7.1, mercurial-1.5.2,
graphical tools like Qt designer and KDevelop, and much more.

- Updated versions of the Slackware package management tools make it
easy to add, remove, upgrade, and make your own Slackware packages.
Package tracking makes it easy to upgrade from Slackware 13.0 to
Slackware 13.1 (see CHANGES_AND_HINTS.TXT). The slackpkg tool can
also help update from an older version of Slackware to a newer one,
and keep your Slackware system up to date. In addition, the
slacktrack utility (in extra/) will help you build and maintain
your own packages.

- Web browsers galore! Includes KDE's Konqueror 4.4.3,
SeaMonkey 2.0.4 (this is the replacement for the Mozilla
Suite), and the immensely popular Firefox 3.6.3, as well as
the Thunderbird 3.0.4 email and news client with advanced
junk mail filtering.

- The KDE Software Compilation 4.4.3, a complete desktop environment.
This includes the KOffice productivity suite, networking tools, GUI
development with KDevelop, multimedia tools (including the amazing
Amarok music player and K3B disc burning software), the Konqueror web
browser and file manager, dozens of games and utilities,
international language support, and more.

- A collection of GTK+ based applications including pidgin-2.7.0,
gimp-2.6.8, gkrellm-2.3.4, gxine-0.5.903, xchat-2.8.6, xsane-0.996,
and pan-0.133.

- A repository of extra software packages compiled and ready to run.
This includes the Java(TM) 2 Software Development Kit Standard
Edition, an MPlayer browser plugin, and more (see the /extra directory).

- Many more improved and upgraded packages than we can list here. For
a complete list of core packages in Slackware 13.1, see this file:

Downloading Slackware 13.1:

The full version of Slackware Linux 13.1 is available for download
from the central Slackware FTP sites hosted by our friends at and

If the sites are busy, see the list of official mirror sites here:

We will be setting up BitTorrent downloads for the official ISO
images. Stay tuned to for the latest updates.

Instructions for burning the Slackware tree onto install discs may
be found in the isolinux directory.

Purchasing Slackware on CD-ROM or DVD:

Or, please consider purchasing the Slackware Linux 13.1 six CD-ROM
set or deluxe dual-sided DVD release directly from Slackware Linux, and
you'll be helping to support the continued development of Slackware

The DVD release has the 32-bit x86 Slackware 13.1 release on one
side, and the 64-bit x86_64 Slackware 13.1 release on the other. Both
sides are bootable for easy installation, and includes everything from
both releases of Slackware 13.1, including the complete source code

The 6 CD-ROM release of Slackware 13.1 is the 32-bit x86 edition.
It includes a bootable first CD-ROM for easy installation. The 6
CD-ROMs are labeled for easy reference.

The Slackware 13.1 x86 6 CD-ROM set is $49.95 plus shipping, or
choose the Slackware 13.1 x86/x86_64 dual-sided DVD (also $49.95 plus

Slackware Linux is also available by subscription. When we release
a new version of Slackware (which is normally once or twice a year) we
ship it to you and bill your credit card for a reduced subscription
price ($32.99 for the CD-ROM set, or $39.95 for the DVD) plus shipping.

For shipping options, see the Slackware store website. Before
ordering express shipping, you may wish to check that we have the
product in stock. We make releases to the net at the same time as disc
production begins, so there is a lag between the online release and the
shipping of media. But, even if you download now you can still buy the
official media later. You'll feel good, be helping the project, and have
a great decorative item perfect for any computer room shelf. :-)

Ordering Information:

You can order online at the Slackware Linux store:

Other Slackware items like t-shirts, caps, pins, and stickers can
also be found here. These will help you find and identify yourself to
your fellow Slackware users. :-)

Order inquiries (including questions about becoming a Slackware
reseller) may be directed to this address:

Have fun! :^) I hope you find Slackware to be useful, and thanks
very much for your support of this project over the years.

Patrick J. Volkerding

Visit us on the web at:

Tuesday, March 30, 2010

Python in Vim Script

I realized that we could embed python script in vim script. Thus we can do something that vim script can't do but python can.

In windows vim package, vim only supports for python24. But my python version was python26 therefore I needed to recompile vim or if you're too lazy, you could download compiled gvim.exe and vim.exe for python support at and replace your original gvim.exe and vim.exe with them.

Usually in Linux, vim package is already compiled with python support. You can script python in vim script with no time.

To check python already work in vim, you can type command bellow, if you see the message it means python already works well.
:py print "python in vim"
:python print "python in vim"

There are 3 ways to include python code in vim script:
  • By using python command for example:
    python import sys
    python sys.argv=["foo", "bar"]
    python print "this's python script"

  • By using marker:
    python << PYSCRIPT
    #python code here sys.argv=["foo", "bar"]
    print "this's python script"

    In example above I use "PYSCRIPT" as python marker, but you can another tag word for you python script marker.
  • By including file:
There are some commands vim provided to communicate between python and vim itself, but here I will explain only 2 of them briefly, those are "vim.command" and "vim.eval". Before using them you need to import vim module in python script. You can import it by adding below line in your python code:
import vim

vim.command is used to execute vim command in python script, for example when I want to turn off syntax color, I will add script below:
vim.command("syntax off")

vim.eval is used to get value of variables in vim script, for example :
let s:test_str = "Just test"
import vim
str = vim.eval("s:test_str")
print str

You can get more detail information about python in vim script in vim help
:help python

For further example I tried to create simple tags-setter and ctags-generator by reading it from a configuration file, here is the code.


let s:conf_file = "/home/test/tag-cfg"
py gen_and_set_tags(vim.eval('s:proj_file'))

import vim

def dir_trim(str):
    if '/' != str[len(str) - 1]:
    str = str + '/'
    return str

def str_trim(str):
    if '\n' == str[len(str) - 1]:
    str = str[:-1]
    return str

def gen_and_set_tags(proj_file):
    # Open file
    f = open(proj_file, "r")

    # Get project file path
    tmp_str = f.readline()
    tmp_str = str_trim(tmp_str)
    project_file = tmp_str

    # Get tag file path,1)
    tmp_str = f.readline()
    tmp_str = str_trim(tmp_str)
    tag_file = tmp_str

    # Get source dir,1)
    tmp_str = f.readline()
    tmp_str = str_trim(tmp_str)
    src_dir = tmp_str

    # Close file

    # Set the commands
    cmd_gen_tags = "!ctags -R -f " + tag_file + " " + src_dir + "/*"
    cmd_set_tags = "set tags=" + tag_file

    print cmd_gen_tags
    print cmd_set_tags

    # Execute the commands

Sunday, February 14, 2010

Region Code Protected DVD vs Laptop

Last Saturday night. I brought home a DVD from my office, I planned to watch the movie in my boarding house. I knew it was illegal but it wouldn't make any sense to the company as long as I had intention to return it back.

Unfortunately the DVD had been protected by region code, its region code was 1 (USA). So I couldn't play it on my laptop :(. I didn't know my DVD ROM region code and it couldn't play the DVD. Thus I assumed my DVD ROM and The DVD had different region code. And for your information I use Windows XP Professional as my operating system.

After searching in Google, finally I found a software which could bypass Region Code Protection. The software was AnyDVD, you can download it from It's a commercial software but you can try it for trial for 20 days. By using this software you can set region code to your system to match the DVD region code.

You can change your system region code by right-clicking on AnyDVD systray and choose setting option and then a dialog like below will appear:

Match region code setting to DVD's region code, in my case my dvd's region code is 1 , it means the DVD is only for USA and Canada region. When you finish this configuration, you can play your DVD by using your favorite media player.

Enjoy!, Hope this simple tutorial will be helpful.