Kenno's openNOTE

My Programming Weblog

Archive for the ‘HowTo’ Category

Playing .ass subtitles with mplayer

leave a comment »

$ mplayer -ass -sub subtitle.ass file.avi

Written by kenno

August 29, 2010 at 11:57 am

Posted in HowTo, Tips

Tagged with

Change default editor in Debian

with one comment


# update-alternatives --config editor

There are 7 alternatives which provide `editor’.

Selection Alternative
———————————————–
1 /bin/ed
+ 2 /bin/nano
3 /usr/bin/vim.tiny
* 4 /usr/bin/vim.basic
5 /usr/bin/nedit
6 /usr/bin/emacs21
7 /usr/bin/xemacs21

Press enter to keep the default[*], or type selection number: 6

Written by kenno

April 19, 2010 at 2:29 am

Posted in HowTo, Tips

Tagged with ,

Enable sudo insults

leave a comment »

$ sudo visudo

Look for line begins with Defaults, and append insults to the end.

Defaults        env_reset,insults

Save it, and clear the sudo session (sudo -K), and try sudo with a wrong password. :)

Source: Enable sudo insults for some laughs

Written by kenno

April 15, 2010 at 2:42 pm

Posted in HowTo, Tips

Tagged with , , ,

Enable Japanese input on Debian/Ubuntu

with one comment

Normally, I would install Scim and Anthy for Japanese input method on Debian. Recently, I found an easier way to achieve the same thing, which is to use IBus instead of Scim.

  1. Install ibus: sudo apt-get install ibus ibus-anthy ibus-gtk
  2. From the menu, System -> Preferences -> IBus Preference
    IBus Preference should detects that you have run IBus daemon yet, click “Yes” to run it.
  3. You’ll be asked to edit yoru .bashrc and add the following 3 lines:

    export GTK_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    export QT_IM_MODULE=ibus
  4. Click on “Input Method” tab, if you don’t see “Japanese – Anthy” listed under the Input Method list, select “Japanese -> Anthy” from the “Select an input method” drop down list, then click Add.
  5. You might want to restart X (logout and log back in)
  6. Open a text editor, and hit Ctrl + Space to toggle the Japanese input method

Reference: Japanese Input with Karmic?

Written by kenno

March 14, 2010 at 7:59 am

Posted in HowTo, Tips

Tagged with , ,

How to tell which Linux distro you’re running

with 3 comments

Update:

Thanks to Jayen, there is a better way:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic

$ cat /etc/issue
Debian GNU/Linux squeeze/sid \n \l

Or


$ cat /proc/version
Linux version 2.6.32-trunk-686 (Debian 2.6.32-5) (ben@decadent.org.uk) (gcc version 4.3.4 (Debian 4.3.4-6) ) #1 SMP Sun Jan 10 06:32:16 UTC 2010

Source: Which Linux Distro are you using??

Written by kenno

February 3, 2010 at 11:13 pm

Posted in HowTo, Tips, Unix/Linux

Tagged with

Follow

Get every new post delivered to your Inbox.