Sunday, August 19, 2007

CD/DVD eject - disable lock


#sudo echo "dev.cdrom.lock=0" >> /etc/sysctl.conf

Saturday, May 26, 2007

kqemu - backport from 'feisty' to 'dapper'


Edit apt sources:

#sudo vi /etc/apt/sources.list

--8<--
## Ubuntu source packages for backporting to older releases
deb-src http://mirrors.easynews.com/linux/ubuntu feisty main restricted universe
-->8--


Update, build dependencies and install:

#sudo aptitude update
#sudo apt-get build-dep kqemu
#sudo apt-get source --build kqemu
#sudo dpkg -i *.deb
#sudo module-assistant prepare kqemu
#sudo module-assistant auto-install kqemu


Edit udev rules:

#sudo vi /etc/udev/rules.d/60-kqemu.rules

--8<--
KERNEL=="kqemu", NAME="%k", MODE="0660", GROUP="kqemu"
-->8--


Edit 'kqemu' modprobe.d options:

#sudo vi /etc/modprobe.d/kqemu

--8<--
options kqemu major=0
-->8--


Add user and group:

#sudo addgroup --system kqemu
#sudo adduser your_username kqemu


Load 'kqemu' kernel module:

#sudo modprobe kqemu

Monday, May 21, 2007

qemu


Create a virtual HDD:

#qemu-img create hda.img 5G


Set 512MB of virtual memory, allow access to a virtual HDD and boot from a virtual CD using an ISO file:

#qemu -m 512 -hda hda.img -cdrom ubuntu-7.04-desktop-i386.iso -boot d

-boot a, c, d = floppy drive, hard drive, optical drive respectively
-no-kqemu = if kqemu kernel module not present


Boot from a virtual HDD:

#qemu -m 512 -hda hda.img


Convert a "RAW" HDD image to a "QCOW" compressed image:

#qemu-img convert -c hda.img -O qcow harddiskimage.img


Check image type:

#qemu-img info hda.img

image: hda.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 2.3G



#qemu-img info harddiskimage.img

image: harddiskimage.img
file format: qcow
virtual size: 5.0G (5368709120 bytes)
disk size: 891M



CTRL+ALT+2 = qemu console

Save virtual memory state:

(qemu) savevm dump.img

Load virtual memory state:

(qemu) loadvm dump.img


CTRL+ALT+1 = qemu main screen

Start qemu using a hard drive image and restore saved memory state:

#qemu -m 512 -hda hda.img -loadvm dump.img

Monday, April 30, 2007

PDF electronic signature


Required tools:
  • imagemagick
  • pdftk

1. Split multi-page PDF into single pages.

#pdftk offer.pdf burst
#ls
pg_0001.pdf pg_0002.pdf pg_0003.pdf pg_0004.pdf


2. Convert the signature page to an image.

#convert -density 200 pg_0004.pdf pg_0004.png

Experiment with -density to get the best quality.


3. Sign a blank sheet of paper. Take a picture with a digicam. Edit the document image with your favourite image manipulation application (I used KolourPaint) and add your signature.


4. Convert the image back to PDF.

#convert pg_0004.png pg_0004_sig.pdf


5. Merge all pages into a single document.

#pdftk pg_0001.pdf pg_0002.pdf pg_0003.pdf pg_0004_sig.pdf cat output offer_sig.pdf

Monday, April 23, 2007

DPI - change from 75 to 96


There is no one standard DPI. It is actually determined based on monitor size values from DDC given the screen resolution. If DDC does not specify the size, 75 DPI is used by default.

Unlike GNOME, KDE does not force DPI anywhere in its settings. So, when you run KDE and GNOME applications side by side, the font sizes will differ.

When I switch from "nvidia" to the binary "nv" driver, it always sets 75 DPI for my BenQ FP731. To force 96 DPI which will produce consistent font sizes for GNOME, KDE, XFCE and all other applications, I need to edit the display manager's configuration.

Here is how to do it in Xubuntu:

#sudo vi /etc/X11/gdm/gdm-cdd.conf

--8<--
# Definition of the standard X server.
[server-Standard]
name=Standard server
command=/usr/bin/X -br -audit 0 -dpi 96
-->8--


To do it the really easy way using the GDM setup GUI tool:

#sudo gdmsetup

Add the DPI setting in Security > Configure X Server > Command.


The same for KDE greeter:

#sudo vi /etc/kde3/kdm/kdmrc

--8<--
[X-:*-Core]
AllowNullPasswd=true
AllowShutdown=All
NoPassEnable=false
NoPassUsers=
ServerArgsLocal=-nolisten tcp -dpi 96
ServerCmd=/usr/X11R6/bin/X -br
-->8--

nVIDIA binary driver freq fix (Feisty)


When some people switch to the nVIDIA binary driver ("nvidia" as opposed to "nv"), they can no longer access their desktop. For example, my old BenQ FP731 LCD goes black&blank and displays "Out of range".

Here is the fix:

#vi /etc/X11/xorg.conf

Section "Device"
Identifier "nVidia Corporation NV34 [GeForce FX 5200]"
Driver "nvidia"
Busid "PCI:1:0:0"
Option "AddARGBVisuals" "True"
Option "AddARGBGLXVisuals" "True"
Option "NoLogo" "True"
Option "UseEdid" "False"
#Option "UseEdidDpi" "False"
#Option "DPI" "96 x 96"
EndSection

The "UseEdidDpi" and "DPI" options can be used to set the DPI to 96. These settings are specific to nVIDIA gfx chips but there is another way to set a sane DPI...

Friday, April 06, 2007

Airlink101 AWLL3026 wireless USB adapter


Created Ubuntu wiki instead of posting here.

Sunday, March 04, 2007

Aliases: ls, cp, mv, rm, less


# vi ~/.bashrc

alias ll='ls -l'
alias la='ls -A'

# F=classify (append file type indicators), p=append directory indicator,
# s=print file sizes, h=sizes human readable, C=list by columns,
# 1=list in single column, X=sort by extension, S=sort by size,
# t=sort by modification time, u=sort by access time, r=reverse sort
#alias l='ls -psh1X'
alias l='ls -FshC'

alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -iv'

# don't overwrite files when redirecting output
set -o noclobber

# g=highlight search, I=ignore case, M=long prompt,
# S=chop long lines (don't fold/wrap), Q=quiet (no bell),
# w=highlight first unread line after scroll, ~=don't show tilde at EOF,
# #n=shift n step(s) when scrolling horizontally
alias less='less -gIMSQW~#2'

Saturday, November 18, 2006

Backport 'MPD' to Dapper using Edgy source package


# sudo -i
# vi /etc/apt/sources.list

deb-src http://mirrors.kernel.org/ubuntu/ edgy universe

# apt-get update
# apt-get build-dep mpd
# apt-get source --build mpd
# dpkg -i mpd_0.12.1-1ubuntu1_i386.deb

Thursday, November 16, 2006

Compile 'darkice' with mp3 support


# sudo apt-get install liblame-dev
# sudo vi /etc/apt/sources.list

deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse

# sudo apt-get update
# sudo apt-get build-dep darkice

# vi darkice-0.16/debian/rules

#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr --sysconfdir=/usr/share/doc/darkice/examples --with-lame


# sudo apt-get source --build darkice
# sudo dpkg -i darkice_0.16-1_i386.deb

Monday, November 13, 2006

Chaintech AV-710 (VIA ICEnsemble Envy24HT-S VT1721) digital optical output SPDIF


# sudo vi /var/lib/alsa/asound.state

state.AV710 {
control.1 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Master Playback Switch'
value true
}
control.2 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Master Playback Volume'
value.0 15
value.1 15
}
control.3 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Center Playback Switch'
value false
}
control.4 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 31'
iface MIXER
name 'Center Playback Volume'
value 0
}
control.5 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'LFE Playback Switch'
value false
}
control.6 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 31'
iface MIXER
name 'LFE Playback Volume'
value 0
}
control.7 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Surround Playback Switch'
value.0 false
value.1 false
}
control.8 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Surround Playback Volume'
value.0 0
value.1 0
}
control.9 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Headphone Playback Switch'
value false
}
control.10 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Headphone Playback Volume'
value.0 0
value.1 0
}
control.11 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Master Mono Playback Switch'
value false
}
control.12 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 31'
iface MIXER
name 'Master Mono Playback Volume'
value 0
}
control.13 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'PC Speaker Playback Switch'
value false
}
control.14 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 15'
iface MIXER
name 'PC Speaker Playback Volume'
value 0
}
control.15 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Phone Playback Switch'
value false
}
control.16 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 31'
iface MIXER
name 'Phone Playback Volume'
value 0
}
control.17 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Mic Playback Switch'
value false
}
control.18 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 31'
iface MIXER
name 'Mic Playback Volume'
value 0
}
control.19 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Mic Boost (+20dB)'
value false
}
control.20 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Line Playback Switch'
value false
}
control.21 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Line Playback Volume'
value.0 0
value.1 0
}
control.22 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'CD Playback Switch'
value false
}
control.23 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'CD Playback Volume'
value.0 0
value.1 0
}
control.24 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Video Playback Switch'
value false
}
control.25 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Video Playback Volume'
value.0 0
value.1 0
}
control.26 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Aux Playback Switch'
value false
}
control.27 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'Aux Playback Volume'
value.0 0
value.1 0
}
control.28 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'PCM Playback Switch'
value true
}
control.29 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
iface MIXER
name 'PCM Playback Volume'
value.0 15
value.1 15
}
control.30 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 2
comment.item.0 Mic
comment.item.1 CD
comment.item.2 Video
comment.item.3 Aux
comment.item.4 Line
comment.item.5 Mix
comment.item.6 'Mix Mono'
comment.item.7 Phone
iface MIXER
name 'Capture Source'
value.0 Mix
value.1 Mix
}
control.31 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Capture Switch'
value true
}
control.32 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 15'
iface MIXER
name 'Capture Volume'
value.0 0
value.1 0
}
control.33 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name '3D Control - Switch'
value false
}
control.34 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 Mix
comment.item.1 Mic
iface MIXER
name 'Mono Output Select'
value Mix
}
control.35 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 Mic1
comment.item.1 Mic2
iface MIXER
name 'Mic Select'
value Mic1
}
control.36 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 15'
iface MIXER
name '3D Control - Center'
value 0
}
control.37 {
comment.access 'read write'
comment.type INTEGER
comment.count 1
comment.range '0 - 15'
iface MIXER
name '3D Control - Depth'
value 0
}
control.38 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Alternate Level to Surround Out'
value false
}
control.39 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Downmix LFE and Center to Front'
value false
}
control.40 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Downmix Surround to Front'
value false
}
control.41 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'External Amplifier'
value false
}
control.42 {
comment.access read
comment.type BYTES
comment.count 52
iface CARD
name 'ICE1724 EEPROM'
value '172414121c01020210c1ff0000ff0000ff0000000101010001000000000000000000000000000000ff000000ff000000ff000000'
}
control.43 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 '8000'
comment.item.1 '9600'
comment.item.2 '11025'
comment.item.3 '12000'
comment.item.4 '16000'
comment.item.5 '22050'
comment.item.6 '24000'
comment.item.7 '32000'
comment.item.8 '44100'
comment.item.9 '48000'
comment.item.10 '64000'
comment.item.11 '88200'
comment.item.12 '96000'
comment.item.13 '176400'
comment.item.14 '192000'
comment.item.15 'IEC958 Input'
iface MIXER
name 'Multi Track Internal Clock'
value '44100'
}
control.44 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Multi Track Rate Locking'
value true
}
control.45 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'Multi Track Rate Reset'
value true
}
control.46 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 'PCM Out'
comment.item.1 'H/W In 0'
comment.item.2 'H/W In 1'
comment.item.3 'IEC958 In L'
comment.item.4 'IEC958 In R'
iface MIXER
name 'H/W Playback Route'
value 'PCM Out'
}
control.47 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 'PCM Out'
comment.item.1 'H/W In 0'
comment.item.2 'H/W In 1'
comment.item.3 'IEC958 In L'
comment.item.4 'IEC958 In R'
iface MIXER
name 'H/W Playback Route'
index 1
value 'PCM Out'
}
control.48 {
comment.access read
comment.type INTEGER
comment.count 22
comment.range '0 - 255'
iface MIXER
name 'Multi Track Peak'
value.0 189
value.1 192
value.2 0
value.3 0
value.4 0
value.5 0
value.6 0
value.7 0
value.8 0
value.9 0
value.10 44
value.11 43
value.12 0
value.13 0
value.14 0
value.15 0
value.16 0
value.17 0
value.18 0
value.19 0
value.20 0
value.21 0
}
control.49 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 'PCM Out'
comment.item.1 'H/W In 0'
comment.item.2 'H/W In 1'
comment.item.3 'IEC958 In L'
comment.item.4 'IEC958 In R'
iface MIXER
name 'IEC958 Playback Route'
value 'H/W In 0'
}
control.50 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 'PCM Out'
comment.item.1 'H/W In 0'
comment.item.2 'H/W In 1'
comment.item.3 'IEC958 In L'
comment.item.4 'IEC958 In R'
iface MIXER
name 'IEC958 Playback Route'
index 1
value 'H/W In 1'
}
control.51 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'IEC958 Output Switch'
value true
}
control.52 {
comment.access 'read write'
comment.type IEC958
comment.count 1
iface PCM
device 1
name 'IEC958 Playback Default'
value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
}
control.53 {
comment.access read
comment.type IEC958
comment.count 1
iface PCM
device 1
name 'IEC958 Playback Con Mask'
value '3fff000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
}
control.54 {
comment.access read
comment.type IEC958
comment.count 1
iface PCM
device 1
name 'IEC958 Playback Pro Mask'
value df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
}
}


# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: CK804 [NVidia CK804], device 0: Intel ICH [NVidia CK804]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: CK804 [NVidia CK804], device 2: Intel ICH - IEC958 [NVidia CK804 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: AV710 [Chaintech AV-710], device 0: ICE1724 [ICE1724]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: AV710 [Chaintech AV-710], device 1: IEC1724 IEC958 [IEC1724 IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0


# sudo vi /etc/asound.conf

# /etc/asound.conf
# ~/.asoundrc
#
# 2006-11-18

################################################################################
# Chaintech AV-710 (IC Ensemble/VIA VT1721)

#
# HW definition for raw communication with ALSA kernel driver
#
pcm.chaintech {
type hw
card 2
device 1

#mmap_emulation true # for ro/wo devices, increases latency
#nonblock true # force non-blocking open mode
}

#
# SPDIF output
#
pcm.!spdif {
type plug
slave.pcm "chaintech"
}

#
# Analog output
#
pcm.analog {
type plug
slave {
pcm "surround51"
format S32_LE
}
}

#
# Upmix stereo to 5.1
#
pcm.upmix {
type plug
slave.pcm "surround51"
slave.channels 6
route_policy duplicate
}

#
# DMIX output device
#
pcm.output {
type dmix
ipc_key 10001 # in integer, unique IPC key for each dmix definition
ipc_key_add_uid false # Don't add current UID to unique IPC key
ipc_perm 0666 # Share mixer with all users, default permissions = 0600
slave {
pcm "chaintech"
buffer_size 8192 # in bytes, power of 2, for dmix OSS emulation
period_size 1024 # in bytes, power of 2, (OSS emu), default = 125000
period_time 0 # in usec, apparently unnecessary since ALSA 1.0pre
#periods 128 # power of 2, if 'buffer_size' or 'buffer_time' is not specified
rate 44100 # in Hz, default = 48000
format S32_LE # Required for ICE1724 digital output, default = S16_LE
}
bindings {
0 0
1 1 # dmix will use only the first 2 channels
}
#slowptr true # Slow but more precise pointer updates
}

#
# DSNOOP input device
#
pcm.input {
type dsnoop
ipc_key 10002
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "chaintech"
channels 2
#buffer_size 4096
#period_size 1024
#rate 44100
}
}

#
# ASYM duplex device
#
pcm.duplex {
type asym
playback.pcm "output"
capture.pcm "input"
}

#
# SOFTwareVOLume for digital output
#
pcm.vol {
type softvol
slave.pcm "chaintech"
control.name "Master"
min_dB -65.0 # Minimal dB value in REAL num (default: -51.0)
}

#
# JACKplug device
#
pcm.jackplug {
type plug
slave.pcm "jack"
}

pcm.jack {
type jack
playback_ports {
0 alsa_pcm:playback_1
1 alsa_pcm:playback_2
}
capture_ports {
0 alsa_pcm:capture_1
1 alsa_pcm:capture_2
}
}

#
# default device ###############################################################
#
pcm.!default {
type plug
slave.pcm "duplex" # spdif, analog, upmix, duplex, vol
}

#
# OSS Compability
#
pcm.!dsp2 {
type plug
slave.pcm "default"
}

ctl.!mixer2 {
type hw
card 2
}

Monday, November 06, 2006

autofs: mounting iPod & USB


1. Install the goodies:

# aptitude install autofs pmount


2. Edit autofs config file:

# sudo vi /etc/auto.master

/media /etc/auto.media --ghost


3. Get your device ID:

# ls /dev/disk/by-id/ | grep iPod

usb-Apple_iPod_000A270012E6900E
usb-Apple_iPod_000A270012E6900E-part1
usb-Apple_iPod_000A270012E6900E-part2


4. Create custom config for media:

# sudo vi /etc/auto.media


dvd -fstype=auto,ro :/dev/dvd
usb -fstype=vfat :/dev/disk/by-id/usb-KINGMAX_USB2.0_Flashdisk_00000000000064-part1
ipod -fstype=vfat,iocharset=iso8859-1,fmask=0117,dmask=0007,gid=plugdev :/dev/disk/by-id/usb-Apple_iPod_000A270012E6900E-part2


You can use UUID instead of ID to identify your device. It's shorter. You could also use LABEL but there would be a chance of a conflict.

ipod -fstype=vfat :/dev/disk/by-uuid/A5D3-DF28


5. Reload autofs:

# sudo /etc/init.d/autofs reload


6. Start gtkpod or just check out /media/ipod and witness the magic.

Saturday, November 04, 2006

VNC (a.k.a. KDE 'Desktop Sharing') crashing and slow performance workaround


Disable the built-in 'Desktop Sharing' and install x11vnc:

# apt-get install x11vnc

If you have an existing VNC password file:

# x11vnc -display :0 -rfbauth ~/.vnc/passwd


To set the password (not my preferred way):

# x11vnc -storepasswd yourpassword /path/to/password

Or set the password using vncpasswd (part of vnc-common):

# vncpasswd

***

Alternatively, create ~/.x11vncrc with all the options you need and then just start 'x11vnc'.

# ~/.x11vncrc
# ** uncomment options you need **

# password file must use full path
rfbauth /home/user/.vnc/passwd

display :0
forever
shared

# keyboard repeat
repeat

# visual speed tweak
nodragging

# CPU performance tweak (?)
threads

# be less verbose
quiet

# put process in background
#bg

# show GUI
#gui


To stop x11vnc running in background ('bg' option):

# x11vnc -remote stop

Thursday, October 26, 2006

Dapper directory sizes


Just for reference for someone who wants to set up multiple partitions but has no clue how much space is required.

This is what my file system currently looks like (fresh Kubuntu install a year ago, a few essential apps + dist-upgrade to some recent stuff):

/bin 4.5M
/boot 9.4M
/dev 5.5M
/etc 40M
/home 862M
/lib 110M
/proc 900M
/root 24M
/sbin 8.5M
/tmp 31M
/usr 2.8G
/var 1.3G

Initializing existing RAID-0 setup to install Ubuntu on it


If you have your root partition on RAID-0 and for some reason decided to delete the system while keeping /home (or any other directories) and start over, here's how to do it:

1. Boot the 'alternate' disc.
2. Go through the setup until you get to partitioning.
3. Switch to console (for example: ALT+F2).
4. Issue the following commands, replacing hde3 and hdg8 with your RAID partitions:

# modprobe md
# mdadm --assemble /dev/md0 /dev/hde3 /dev/hdg8
# mount /dev/md0 /mnt

You can now access your stuff in /mnt. Delete what you need, keep the rest. Then:

# umount /mnt
# mdadm --stop /dev/md0

Go on with the installation. Make sure not to format your RAID!

Saturday, September 09, 2006

nvidia-glx 1.0.8762 binary driver fix


After upgrading from Breezy to Dapper, Xorg failed to work with the new nVIDIA binary driver on my BenQ FP731 LCD at its native resolution of 1280x1024.

Quick fix #1:

Edit /etc/X11/xorg.conf and add the section in bold, then restart X (Ctrl+Alt+Backspace will do).

Section "Device"
Identifier "NVIDIA Corporation NV43 [GeForce 6200]"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "UseEDID" "false"
EndSection

"By default, the NVIDIA X driver makes use of a display device's EDID, when available, during construction of its mode pool. The EDID is used as a source for possible modes, for valid frequency ranges, and for collecting data on the physical dimensions of the display device for computing the DPI. However, if you wish to disable the driver's use of the EDID, you can set this option to False."
(from nVIDIA Accelerated Linux Driver Set README and Installation Guide)


Quick fix #2:

Edit /etc/X11/xorg.conf and add the section in bold to force 60Hz refresh rate, then restart X.

Section "Screen"
Identifier "Default Screen"
Device "NVIDIA Corporation NV43 [GeForce 6200]"
Monitor "BenQ FP731"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024_60" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Sunday, April 16, 2006

Firefox - Flash audio fix


# vi ~/.mozilla/firefox/rc

FIREFOX_DSP="none"

iPod - safe remove fix


Unmouting iPod from a user's account doesn't completely work. iPod will still be showing "Do not disconnect". Fix (insecure, I know):

# sudo chmod +s /usr/bin/eject

Friday, March 24, 2006

prelinking


# sudo apt-get install prelink
# sudo vi /etc/default/prelink

PRELINKING=yes

# sudo /etc/cron.daily/prelink

Saturday, March 04, 2006

multi source audio


- ALSA

# sudo apt-get install libesd-alsa0

- OSS

# sudo apt-get install libesd0