Setting up MySQL Database from .sql Dump on DotCloud

Here I assume that MySQL service is running as db for my application named myapp. If I don’t remember, the password can be obtained as follows:

$ dotcloud info myapp.db
... a bunch of info, one of which is passwd ...

If I have a MySQL dump file named somedb.sql, do

$ dotcloud run myapp.db -- mysql -u root -pMYMYSQLROOTPASSWOD < somedb.sql

This is it. It is probably a good idea to create a regular MySQL user.

Posted in Uncategorized | Tagged , | Leave a comment

Customizing & Installing Linux Kernel on Debian Wheezy

Here is a quickie for customizing and install Linux kernel 3.5.x on Wheezy.

Add yourself to some groups:

# adduser username sudo

You need to logout and login for this change to take effect. You also need to be able to use sudo or su to install the new kernel in the end.

Install some packages and kernel source:

$ sudo aptitude update
$ sudo aptitude install kernel-package pkg-config bzip2 g++ libqt4-dev libncurses5-dev fakeroot

The kernel packaged for Wheezy is at version 3.2. A newer kernel can be obtained from kernel.org and saved somewhere. You just need to expanding the compressed source somewhere (even under your home directory, which is the case in this post). Either way, the customization procedure is similar. Here I just follow the Debian way:

$ sudo aptitude install linux-source-3.2

Extract the source tree:

$ cd ~/src
$ tar -jxf /usr/src/linux-source-3.2.tar.bz2
$ ln -s linux-source-3.2 linux
$ cd linux

Edit the EXTRAVERSION entry in Makefile, as in:

EXTRAVERSION = .20120929.1

for example to add .20120929.1 to the kernel version number. This is convenient for keeping the existing, working kernels around when you need to recompile with different options.

Use xconfig or menuconfig to customize the kernel options. Before the make-kpkg lines, setting concurrency (most likely to the number of cores of my processor) is optinal but having a higher number typically reduces the compilation time.

$ make mrproper
$ make xconfig    # or make menuconfig
$ export CONCURRENCY_LEVEL=2    # this is optional
$ fakeroot make-kpkg clean
$ fakeroot make-kpkg --initrd kernel_image
$ sudo dpkg -i ../linux-image-3.2.20120929.*_amd64.deb

Upon reboot in the GRUB menu you will find the newly installed kernel:

$ sudo reboot

Purging Old Kernel Image from System

For example, if the kernel to be uninstalled is of version 2.6.26 and the extra version that I used was 20091112.1, do:

$ sudo dpkg -P linux-image-2.6.26.20091112.1

That’s it. However it is often a good idea to keep at least one kernel image that I know for sure to work so that when a custom kernel fails, I have something to fall back on. On the other hand, it is also a good idea to purge very old kernel images to save space in /boot.

Posted in Uncategorized | Tagged , , | Leave a comment

Power Management on Lenovo T430s with Debian Wheezy

Since tp_smapi does not work properly on T430s, I am using TLP this time. I still want some traditional tools

$ sudo aptitude install powertop

but not others:

$ sudo aptitude remove --purge laptop-mode-tools

To install, follow the instruction. In short, first update the APT source list by adding the following line to /etc/apt/sources.list:

deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main

and run

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 02D65EFF
$ sudo aptitude update
$ sudo aptitude install tlp tlp-rdw tp-smapi-dkms smartmontools ethtool acpi-call-tools

Upon reboot, TLP starts running.

I am impressed by the ease of installation and how effective TLP is on configuring T430s to star saving from the get go. According to powertop, T430s is already using just 7 - 8 W on battery. That's several watts below I had been using on other ThankPads!!

Controlling the behavior of TPL is done by modifying /etc/default/tlp. I mostly use the default except the following changes:

...

# Main battery (values in %)
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=90
# Ultrabay battery (values in %)
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=90

...

# Radio devices to disable on connect
DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"

# Radio devices to enable on disconnect
DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi"
DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""

Note that in this configuration the battery charge thresholds are intentionally set lower than the factory default to prolong the health of batteries. When I wish to fully charge them, do:

$ sudo tlp fullcharge [ BAT0 | BAT1 ]

and the thresholds will be set back to the factory default. The setting reverts to the custom configuration upon next reboot.

Enables RC6 Power Saving

Edit /etc/default/grub and add the option i915.i915_enable_rc6=1 to GRUB:

GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.i915_enable_rc6=1"

After editing, update Grub:

$ sudo update-grub

This can save about 0.5 W of power!

Fan Control

I have not fine tuned this, but the fan can be controlled manually via thinkfan:

$ sudo aptitude install thinkfan

Create (or edit) /etc/modprobe.d/thinkpad_acpi.conf and add the line:

options thinkpad_acpi fan_control=1

Reboot. The fan can be controlled manually following this Wiki article.

Configuring System on Switch between AC & Battery

For regular daemons (like ssh), TLP provides a way to start/stop based on AC status.

For other personal processes, KDE power management can also do some work by running a script upon dis/connecting with AC. In particular, the sound for the KDE system notifications should be disabled entirely, because they cause quite a number of unwanted interruptions according to powertop. Also, I wish to start/stop programs like flux and Dropbox when on battery just to squeeze more juice. I create a script like this:

#!/usr/bin/env bash
##############################################################################
# This is a script to run when AC/battery switches.  Ideally used
# within the power management configuration setting on KDE.  Requires
# tp_smapi to be loaded for the detection of AC/battery.
  
USERNAME=johndoe
LATITUDE=37.78
LONGITUDE=-122.42
  
  
##############################################################################
# DO NOT MODIFY BELOW
 
statuspath="/sys/class/power_supply/AC/online"
  
if [ ! -f "$statuspath" ]; then
    exit 0
fi
  
tag=pmpersonal
status=`cat "$statuspath"`
 
if [ "$status" = "1" ]; then
    logger -t $tag "on ac"
  
    logger -t $tag "start xflux"
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
    xflux -l $LATITUDE -g $LONGITUDE
  
    logger -t $tag "start dropbox"
    dropbox start
  
    logger -t $tag "enable system notification"
    kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" false
else
    logger -t $tag "on battery"
  
    logger -t $tag "stop xflux"
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
  
    logger -t $tag "stop dropbox"
    dropbox stop
  
    logger -t $tag "disable system notification"
    kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" true
fi

Save this to ~/bin/pmpersonal.sh. Go to System Settings -> Power Management -> Energy Saving Settings. There, for each of “On AC,” “On Battery,” and “On Low Battery,” I can set different configurations. I can also specify “Run Script” option for each profile to enable/disable a few desktop related applications and settings. The script should be run on profile load.

Preload Daemon

$ sudo aptitude install preload

In /etc/default/preload, uncomment the line reading

OPTIONS="-l /dev/null"

This should reduce disk activity.

Disabling Nepomuk, Strigi and Akonadi on KDE

I am not fond of these daemon. Disable them by going to System Settings -> Desktop Search and unchecking “Enable Nepomuk Semantic Desktop.” In ~/.config/akonadi/akonadiserverrc, set:

StartServer=false

so that it doesn’t start at all. On powertop, this shows up as a service running mysqld constantly.

Posted in Uncategorized | Tagged , , | 3 Comments

LaTeX on Debian Wheezy

Install basic packages for LaTeX:

$ sudo aptitude install texlive texlive-latex-extra

Use pdflatex to compile TeX documents.

dvipng may be needed to render LaTeX on Matplotlib:

$ sudo aptitude install dvipng
Posted in Uncategorized | Tagged , | Leave a comment

Installing NixNote on Debian Wheezy

After downloading the .deb for 64-bit Wheezy, do:

$ sudo aptitude install default-jre
$ sudo dpkg -i nixnote-1.2_amd64.deb
Posted in Uncategorized | Tagged , | Leave a comment

Installing Debian Wheezy on Lenovo T420

Some loser stole my T410s, so I was needing a quick replacement. With T430s on its way (ordered a month ago since I needed a backup anyways) but with the shipment being delayed for so long with hardware issues, I could wait no longer and decided to get this one on budget. This T420 cost me $650 (actually wanted ThinkPad Edge for a couple hundred bucks less, but it wasn’t available at the store).

By the way, if you see a T410s with serial number R84K78G, it’s mine, stolen at a San Francisco Starbucks on September 9, 2012. Please report to police and have the douche bag who stole the thing well-deserved punishment…

General Hardware Specifications

My Lenovo T420 is 4177X07. This is so-called T420i, a budget version of T420 with Intel Core i3. Not Linux certified but seems to work fine.

Hardware Components Status under Linux Notes
Intel Core i3 2310M 2.1 GHz Works
14.0 HD+ (1600 x 900) Works
Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) Works
NVIDIA Corporation GF119 [Quadro NVS 4200M] Not tested
4 GB Memory Works
320GB 7200rpm Hitachi HTS723232A7A364 Works
Intel Corporation 82579LM Gigabit Network Connection (rev 04) Not tested
Intel Corporation Centrino Advanced-N 6205 (rev 34) Works
HL-DT-STDVDRAM GT33N Works
Sanyo 42T4791 Battery Works
Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Works
Integrated Speaker & Microphone Not tested
ThinkLight Works
TrackPoint & TrackPad Works
Keyboard Not fully tested Haven’t thoroughly tested special keys

The stock kernel (3.2.0-3-amd64) seems to work fine with this configuration.

Installing Debian Wheezy

Recovery Media

Make sure to create factory recovery disks in case the factory default needs to be restored. In order to do this, on Windows 7, launch ThinkVantage and go to Factory Recovery Disks. Check both boot and data. Four blank DVDs were necessary for me (one for boot and three for data). After making the disks, it is recommended to test if they work or not by rebooting off the boot disk just created.

Shrink the Windows Partition

For T420, I decided to dual boot Windows 7 and Linux in case I ever need to run something on Windows (e.g., games). This is actually PITA to do due to “unmovable system files.” I found this article useful for what needs to be disabled before shrinking a partition on Windows (for me no external utilities were necessary to shrink it to the minimum).

Installing Wheezy

I decided to do netinst with wireless firmware already included into the boot media, so that I don’t have to bother with missing firemware during the install process while on WiFi. The latest installer at the writing is still at beta 2, but an ISO image is available here. Burn this onto a blank CD/DVD. The availability of netinst media with firmware made the whole process such a breeze! Simply boot off the DVD and follow the on-screen instruction.

Installation Customization Options

Debian installation has gotten easy enough that I don’t feel the need for this any more, but just for completeness, here goes. Obviously this is just one way to customize. I used the text installer.

  • Language: English
  • Country, territory or area: United States
  • Keymap: American English
  • Primary network interface should be configured automatically, even if the installer complains about missing firmware.
  • Hostname: (choice)
  • Domain name: (choice)
  • Root password: (choice)
  • Full name for the new user: (choice)
  • Username for your account: (choice)
  • Choose a password for the new user: (choice)
  • Select your time zone: Pacific
  • Partitioning method: Manual

I’m doing dual boot, but my Linux partition scheme is very simple:

$ df -Tlh
Filesystem                    Type      Size  Used Avail Use% Mounted on
rootfs                        rootfs    491M  172M  295M  37% /
/dev/disk/by-uuid/cc0...      ext4      491M  172M  295M  37% /
/dev/sda6                   ext4      101M   24M   72M  25% /boot
/dev/sda7                   ext4      4.9G  201M  4.5G   5% /tmp
/dev/sda8                   ext4      3.9G  1.2G  2.6G  32% /var
/dev/sda9                   ext4      9.8G  2.8G  6.6G  30% /usr
/dev/sda10                  ext4      9.8G  318M  9.0G   4% /usr/local
/dev/sda12                  ext4      168G  5.2G  154G   4% /home
  • Debian archive mirror country: United States
  • Participate in the package usage survey: Yes
  • Choose software to install: (I want a fairly minimal install. I only check ssh, laptop, and standard system utilities.)
  • Install the GRUB boot loader to the master boot record: Yes

Reboot and a very simple Debian box is ready. Upon the first reboot, I login as root and install a few essential packages for system administration, for example:

# aptitude install sudo ssh rsync wget wireless-tools emacs

and in case I need to run 32-bit applications:

# aptitude install ia32-libs ia32-libs-gtk

I also install basic KDE:

# aptitude install kde-plasma-desktop kmix network-manager-kde

Setting up sudo

At this point I add myself as an sudoer by adding username to /etc/sudoers, just under the entry for root, giving full admin privileges (i.e., just copy the line for root).

# chmod 640 /etc/sudoers
# emacs -nw /etc/sudoers
 ... add a regular user to the list ... 
# chmod 440 /etc/sudoers

Manage Network with Network Manager

After configuring the basic system, I had trouble using the KDE network manager. The installing is simple as usual:

$ sudo aptitude install network-manager-kde

If I don’t see it on the system tray, right-click on the tray, System Tray Settings -> Display -> Extra Items, and check Network Management.

I found that the network manager neither found any WiFi access points nor recognized the ones that I added manually. This seems to happen when I use WiFi to do netinst, in which case my /etc/network/interfaces includes the following lines:

allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-ssid MYACCESSPOINT
    wpa-psk  MYPASSWORD

Uncomment all these lines and perhaps add a new line instead:

allow-hotplug eth0

This will make the network manager work as usual.

TrackPoint and TouchPad

I can use the red TrackPoint for scrolling. I usually disable TouchPad, since it interferes often with my palms.

Suspend, Resume, and Power Management

I have always been a type who turns off computer when not used, but I am now using suspend/resume frequently. So this hasn’t been tested yet. I have a set of power management tips on separate post, though.

One problem I have been having with T420 is that, when on battery, shutdown operation leads to reboot. This seems to be caused by a kernel bug, but fortunately there is a solution (thanks to this post, which I pretty much duplicate here). Create a file /etc/init.d/shutdownfixes.sh:

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          shutdownfixes.sh 
# Required-Start:    
# Required-Stop:     
# X-Stop-After:      $network
# Default-Start:     
# Default-Stop:      0
# Short-Description: Fixes shutdown-to-reboot glitch.
# Description:       Fixes shutdown-to-reboot glitch.
### END INIT INFO

PATH="/sbin:/bin"

echo -n "Preparing PCI busses for shutdown..."
for i in /sys/bus/pci/devices/*/power/control; do
  echo on > $i
done
echo "done."

echo -n "Removing e1000e module..."
lsmod | grep -q e1000e && rmmod e1000e
echo "done."

Give this an executable permission:

$ sudo chmod ugo+x /etc/init.d/shutdownfixes.sh

and install it

$ cd /etc/init.d
$ sudo update-rc.d shutdownfixes.sh 8 0 0 .

On the next attempt, shutdown should be successful and not result in reboot.

Miscellaneous

Installing Applications

Here is a list of applications to install on my machine. This is to be done…

Posted in Uncategorized | Tagged , , | Leave a comment

Power Management on Lenovo T420 with Debian Wheezy

NOTE: This is an older method. I have moved on to using TLP and the amount of powersaving is quite amazing (yes, 6 – 7 W is possible!!). I will eventually try to update this post, but for now the solution that I wrote for T430s should be followed.

Here is my continuously growing notes. I use Debian Wheezy (amd64) on T420.

First, install must-have packages:

$ sudo aptitude install powertop acpi acpid tp-smapi-dkms

To load tp-smapi module on boot, add the line

tp-smapi

to /etc/modules.

To monitor the power consumption, use powertop:

$ sudo powertop

This is one of the most useful tool for power management. I can see which processes wake up the computer most, and try to eliminate them one by one.

Laptop Mode Configurations

Install laptop-mode-tools:

$ sudo aptitude install laptop-mode-tools

In /etc/laptop-mode/laptop-mode.conf, make sure to have this line:

ENABLE_AUTO_MODULES=1

(which was set to 0 by default on Squeeze but does not appears to be the case for Wheezy). When on battery this will apply a bunch of power saving settings. This sole step should typically save about 2 – 2.5 W of power consumption according to powertop! Note that wattage information only shows up while running on battery.

The following additional tweaks (overriding the default settings) are optional.

To disable ethernet when on battery, make sure /etc/laptop-mode/conf.d/ethernet.conf has the following lines:

CONTROL_ETHERNET="auto"
DISABLE_ETHERNET_ON_BATTERY=1

For more aggressive power saving on Intel HDA, make sure /etc/laptop-mode/conf.d/intel-hda-powersave.conf has the following lines:

CONTROL_INTEL_HDA_POWER="auto"
INTEL_HDA_DEVICE_TIMEOUT=2
INTEL_HDA_DEVICE_CONTROLLER=1

For more aggressive power saving on the wireless adapter, make sure /etc/laptop-mode/conf.d/wireless-iwl-power.conf has the following lines:

CONTROL_IWL_POWER="auto"
IWL_BATT_POWER=3

After changing the configuration, restart laptop-mode:

$ sudo /etc/init.d/laptop-mode restart

to make the changes effective.

Disabling Nepomuk, Strigi and Akonadi on KDE

I am not fond of these daemon. Disable them by going to System Settings -> Desktop Search and unchecking “Enable Nepomuk Semantic Desktop.” In ~/.config/akonadi/akonadiserverrc, set:

StartServer=false

so that it doesn’t start at all. On powertop, this shows up as a service running mysqld constantly.

Starting & Stopping Services

Some daemons running in the background can be stopped while on battery by laptop-mode. If the init scripts are stored under /etc/init.d, the simplest method is to place a symlink to the init script under /etc/laptop-mode/*-stop directories.

For example, if I want to stop ssh from running while on battery, do this:

$ cd /etc/laptop-mode/batt-stop
$ sudo ln -s /etc/init.d/ssh .

Now, I want ssh to get restarted when on AC:

$ cd /etc/[lm|nolm]-ac-start
$ sudo ln -s /etc/init.d/ssh .

(depending on how laptop-mode is configured, I create a symlink either in lm-ac-start or nolm-ac-start.)

I should create similar symlinks for all services that should be stopped while on battery.

Configuring System on Switch between AC & Battery

For certain things that laptop-mode does not take care of, I create a script which gets run each time the AC is plugged or unplugged. Depending on the state (on battery or on AC), I change some settings.

Such a script may look like this:

#!/bin/bash

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
  exit 0
fi

TAG=pmtp
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ "$STATUS" = "1" ]; then
  logger -t $TAG "on ac"
  logger -t $TAG "increasing swappiness"
  sysctl -w vm.swappiness=60
else
  logger -t $TAG "on battery"
  logger -t $TAG "reducing swappiness"
  sysctl -w vm.swappiness=10
fi

Let us save this script as /usr/local/bin/pmtp. (FYI, this script changes the amount of swap disk usage, effectively reducing disk access while on battery. This is a recommended thing to do.)

To let laptop-mode handle this script, modify /etc/laptop-mode/conf.d/exec-commands.conf to have these lines:

BATT_EXEC_COMMAND_0="/usr/local/bin/pmtp"
LM_AC_EXEC_COMMAND_0="/usr/local/bin/pmtp"
NOLM_AC_EXEC_COMMAND_0="/usr/local/bin/pmtp"

This way the script gets run each time the AC/battery state changes.

For personal processes, KDE power management can also do some work by running a script upon dis/connecting with AC. In particular, the sound for the KDE system notifications should be disabled entirely, because they cause quite a number of unwanted interruptions according to powertop. Also, I wish to start/stop programs like flux and Dropbox when on battery just to squeeze more juice. I create a script like this:

#!/bin/bash
##############################################################################
# This is a script to run when AC/battery switches.  Ideally used
# within the power management configuration setting on KDE.  Requires
# tp_smapi to be loaded for the detection of AC/battery.

USERNAME=johndoe
LATITUDE=37.78
LONGITUDE=-122.42


##############################################################################
# DO NOT MODIFY BELOW 

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
    exit 0
fi

TAG=pmpersonal
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ "$STATUS" = "1" ]; then
    logger -t $TAG "on ac"

    logger -t $TAG "start xflux"
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
    xflux -l $LATITUDE -g $LONGITUDE

    logger -t $TAG "start dropbox"
    dropbox stop
    dropbox start

    logger -t $TAG "enable system notification"
    kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" false
else
    logger -t $TAG "on battery"

    logger -t $TAG "stop xflux"
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done

    logger -t $TAG "stop dropbox"
    dropbox stop

    logger -t $TAG "disable system notification"
    kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" true
fi

Save this to ~/bin/pmpersonal.sh. Go to System Settings -> Power Management -> Energy Saving Settings. There, for each of “On AC,” “On Battery,” and “On Low Battery,” I can set different configurations. I can also specify “Run Script” option for each profile to enable/disable a few desktop related applications and settings. The script should be run on profile load.

Disabling Bluetooth

To control the on/off status of wireless device on the command line, I need:

$ sudo aptitude install rfkill
... below is an example usage ...
$ rfkill list

I can live without Bluetooth entirely (in fact, my T420 does not have Bluetooth). To disable Bluetooth at boot time, add the following line:

rfkill block bluetooth

to /etc/rc.local before the “exit 0″ statement.

Preload Daemon

$ sudo aptitude install preload

In /etc/default/preload, uncomment the line reading

OPTIONS="-l /dev/null"

This should reduce disk activity.

Changing Swappiness

On the command line,

$ sudo sysctl -w vm.swappiness=10

The system will try to use physical RAM as much as possible instead of swapping. To make this in effect upon boot, add the line

vm.swappiness=10

to /etc/sysctl.conf. However, I opt to change this particular setting dynamically using a custom script described above.

Battery Charge Thresholds

To extend battery life, charge thresholds should be tweaked. My current settings are:

$ echo 90 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
$ echo 95 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

Do this for each battery in my system (BAT0, BAT1, etc.)

Chromium over Firefox

My default browser is Firefox. When browsing the web, however, Chromium is much easier on power. I can save about 1 W using Chromium.

Powertop Status

Currently, I typically use 11 – 13 W during typical usage.

Reference

Posted in Uncategorized | Tagged , , | 3 Comments

Installing Firefox on Debian Wheezy

I don’t like to get stuck with a very old version of browser, so I install a Firefox binary provided by Mozilla, not the one by Debian.

Make sure to download a 64-bit version (as I use amd64) from here. The tarball expands to a directory named firefox. For example:

$ cd /usr/local/src
$ sudo wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/firefox-15.0.1.tar.bz2
$ sudo tar -xvjf firefox-15.0.1.tar.bz2
$ sudo mv firefox ..
$ cd /usr/local/bin
$ sudo ln -s ../firefox/firefox .

This makes firefox command available system-wide.

To install flash, do:

$ sudo aptitude install flashplugin-nonfree

To install Java plugin, do:

$ sudo aptitude install icedtea-7-plugin
Posted in Uncategorized | Tagged , | Leave a comment

Installing Skype on Debian Wheezy

Go to Skype web site and download an appropriate version (Debian 6.0 64-bit for me) of the deb file. Then

$ sudo aptitude install ia32-libs ia32-libs-gtk
$ sudo dpkg -i skype-debian_4.0.0.8-1_amd64.deb

simply works.

Posted in Uncategorized | Tagged , , | Leave a comment

Using Japanese on Debian Wheezy

The goal is to make the system capable for Japanese input, while letting the base system remain English. For the Japanese input method, I had been using Anthy, but I will be using mozc, which is now better supported and presumably much better (it is).

First, set up locales and install im-config. In addition to my base English locale (en_US.UTF-8), install Japnese locales ja_JP.EUC-JP and ja_JP.UTF-8:

$ sudo aptitude install locales im-config
$ sudo dpkg-reconfigure locales

Set the default locale for the system to en_US.UTF-8.

Install some Japanese fonts:

$ sudo aptitude install ttf-kochi-mincho ttf-kochi-gothic ttf-sazanami-mincho

IBus

Install IBus-related packages and configure for KDE:

$ sudo aptitude install ibus ibus-mozc ibus-qt4 ibus-gtk ibus-gtk3 ibus-clutter
$ im-config
... choose IBus ...

Run the IBus setup program:

$ ibus-setup

If asked, start ibus-daemon. Logout the KDE sesssion, restart X session, and login again. Under the Input Method tab, add “Japanese – Mozc”. Configure IBus to my liking, such as making Ctrl + Space (as opposed to Shift + Space) trigger the Japanese input mode. The IBus icon also shows up in the system tray, from which various settings can be changed.

Mozc

Run

$ sudo aptitude install ibus-mozc mozc-utils-gui
$ /usr/lib/mozc/mozc_tool --mode=config_dialog

to configure Mozc to my liking.

Using Japanese in Emacs

Install ibus-el:

$ sudo aptitude install ibus-el

Within emacs, M-x ibus-mode will toggle IBus on and off. Very easy!

Posted in Uncategorized | Tagged , , , | 1 Comment