Sunday, November 6, 2011

Convert DVD to AVI

I tried a few programs to burn a DVD and found acidrip works best.

Remember:
  • set size to around 1000 for each hour
  • turn scale off
  • detect the correct crop size
  • preview results

Code syntax highlighting

I use this when I need to syntax highlight code snippets:
http://tohtml.com

Wednesday, November 2, 2011

Writing in Korean

Install ibus, ibus-m17n, ibus-hangul

Restart - I couldn't use ibus in Chrome or choose the Romaji keyboard option until restarting

Ctrl-Space to activate language. Change keyboard to Romaji for English keyboard.

Scim also has a Korean package but I couldn't get it to activate reliably.

Friday, August 19, 2011

Set linux date

Use this graphical tool to set the timezone:
sudo dpkg-reconfigure tzdata

Or set the time directly with:
sudo date MMDDhhmmYYYY

Sunday, July 31, 2011

Left hand mouse

One of the buttons on my laptop broke so to avoid that key I switched to using a left hand mouse:

xmodmap -pp
There are 12 pointer buttons defined:
    Physical        Button
     Button          Code
        1              1
        2              2
        3              3
        4              4
        5              5
        6              6
        7              7
        8              8
        9              9
       10             10
       11             11
       12             12
 xmodmap -e "pointer = 3 2 1 4 5 6 7 8 9 11 12 13"

Thursday, May 19, 2011

chrome user agent

Chrome doesn't seem to currently have a setting or extension to set the user-agent.

You can however define it with a command line argument:

  chromium-browser --user-agent="richard"

Sunday, May 1, 2011

Working with large CSV files

When working with large CSV files I sometimes get this:
Traceback (most recent call last):
  File "stats.py", line 12, in
    for i, row in enumerate(csv.reader(open(filename))):
_csv.Error: field larger than field limit (131072)

This means the CSV file contains more content between delimiters that allowed by default. To raise this limit use:

import sys
import csv
csv.field_size_limit(sys.maxint)