ubuntu


(ubuntu 9.04 gnome, netbeans 6.5, Java 1.6)

I assume you are familiar with: FaqNetbeansConf , Change the Font Size .

Setting the font size of your editors is easy : Tools – Options – Font and Colors .

If you want to change font size of the menues and panels of the GUI and you are using startup options

--laf javax.swing.plaf.metal.MetalLookAndFeel

you can set the GUI font size:
--fontsize 13

and it will work without any problems.

In case you are using the default GTK Theme you will find that the last option doesn’t change the font size of the menues. Here it helps to edit the ~/.gtkrc-2.0 configuration file:

# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/Qt/gtk-2.0/gtkrc"

style "user-font"
{
  font_name="Verdana 11"
}
widget_class "*" style "user-font"

gtk-theme-name="Qt"
gtk-font-name="Verdana 11"

Change entries like “Verdana 11″ according to your needs.

This would be easy in kde, but in gnome some extra steps are needed. I changed to gnome just recently being impressed by the clarity and simplicity of the user interface. Being used to the “kde way” I needed some time to figure that out.

This is an example for kdissert:

Create a wrapper script for example kdissert.sh in ~/bin/launch and make it executable

#!/bin/bash                                                                                                     
cd ~/Known
nohup kdissert > /dev/null 2>&1 &
exit 0

Then use the panel menu to create a Custom Application Launcher : Add to panel -> Custom Application Launcher -> Choose Type: Application, Command: /home/yourusername/bin/launch/kdissert.sh

Another way is to use shell directly. But watch out – you will need to source your .bashrc if needed:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=netbeans with some environment settings
Exec=/bin/bash -c  '. ~/.bashrc; ~/workarea/nb_run.sh'
# to run it in a terminal:
# Exec=gnome-terminal --command "/bin/bash -c  '. ~/.bashrc; ~/workarea/nb_run.sh' "
Icon=/home/kostja/bin/netbeans-6.5rc2/nb6.5/netbeans.png
Categories=Development;Java;IDE
StartupNotify=true
Type=Application

This is an addition to my post Convenient SSH on Linux cause I was suprised finding that KDE is run from ssh-agent per default.

# ps aux | grep ssh-agent
userx    6784  0.0  0.0   4480   816 ?        Ss   19:02   0:00 /usr/bin/ssh-agent /usr/bin/gpg-agent --daemon --sh --write-env-file=/home/userx/.gnupg/gpg-agent-info-myhome /usr/bin/startkde

So, first, how can you disable this?

In /etc/X11/Xsession.options :

# cat /etc/X11/Xsession.options
# See Xsession.options(5) for an explanation of the available options.
allow-failsafe
allow-user-resources
allow-user-xsession
use-ssh-agent
use-session-dbus

you can disable use-ssh-agent. This option will be used by
/etc/X11/Xsession.d/90x11-common_ssh-agent
see there for details.

If you want to use the running ssh-agent you can add your keys on startup by putting this script to .kde/Autostart

#!/bin/sh
# set SSH_ASKPASS if not set elsewhere
# export SSH_ASKPASS=/usr/bin/ssh-askpass
for f in /home/userx/.ssh/mykeys/*_dsa ; do ssh-add $f </dev/null ; done ; 

Also check the related ubuntu bugs

After spending a day and a night I have got this working. Not perfectly as restarting Xserver by CTRL+ATL+BACKSPACE would show a scrumbled screen (see below for a fix).
This is the hardware configuration I tried to get working:
The Laptop “Dell Latitude D810″ ist connected to a docking station “D/Port Advanced Port Replicator”, the external monitor is connected to the DVI-D Port of the docking station. I wanted a big desktop stretched over both monitors, laptop and external, that makes sense cause the laptop can be fixed in a upright position by the D/View computer stand, the resolution of both monitors is 1680×1050.

The main steps were:

  1. Updating the fresh installed system.
  2. Removing the xorg-driver-fglrx driver package if installed.
  3. Downloading the latest ati fglrx driver from http://ati.amd.com/support/drivers/linux/linux-radeon.html and installing them by just running the downloaded ati-driver-installer-8-11-x86.x86_64.run as root.
  4. Reading Unofficial Ati Linux Driver Wiki
  5. Following descriptions in Dual Monitor Support With Binary, ATI-Only Big-Desktop
  6. Running aticonfig according to the descriptions:
    root@myhome:# aticonfig --initial --overlay-type=Xv
    root@myhome:# aticonfig --desktop-setup=horizontal --sync-vsync=on --add-pairmode=Width0xHeight0+Width1xHeight1
  7. Tuning my xorg.conf by adding some options to the device section.

To make this descriptions complete here is my xorg.conf :

# xorg.conf (X.Org X Window System server configuration file)

Section "ServerLayout"
  Identifier     "Default Layout"
  Screen      0  "aticonfig-Screen[0]-0" 0 0
  InputDevice    "Synaptics Touchpad"
EndSection

Section "Files"
EndSection

Section "Module"
EndSection

Section "InputDevice"
  Identifier  "Generic Keyboard"
  Driver      "kbd"
  Option      "XkbRules" "xorg"
  Option      "XkbModel" "pc105"
  Option      "XkbLayout" "de"
  Option      "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
  Identifier  "Configured Mouse"
  Driver      "mouse"
  Option      "CorePointer"
EndSection

Section "InputDevice"
  Identifier  "Synaptics Touchpad"
  Driver      "synaptics"
  Option      "SendCoreEvents" "true"
  Option      "Device" "/dev/psaux"
  Option      "Protocol" "auto-dev"
  Option      "HorizEdgeScroll" "0"
EndSection

Section "Monitor"
  Identifier   "Configured Monitor"
EndSection

Section "Monitor"
  Identifier   "aticonfig-Monitor[0]-0"
  Option      "VendorName" "ATI Proprietary Driver"
  Option      "ModelName" "Generic Autodetecting Monitor"
  Option      "DPMS" "true"
EndSection

Section "Device"
  Identifier  "Configured Video Device"
EndSection

Section "Device"
  Identifier  "aticonfig-Device[0]-0"
  Driver      "fglrx"
  Option      "VideoOverlay" "on"
  Option      "OpenGLOverlay" "off"
  Option   "Mode2"         "1680x1050" #Resolution for second monitor
  Option      "DesktopSetup" "horizontal"  #Enable Big Desktop
  Option "DesktopSetup" "LVDS,AUTO" #the types of monitors that is connected LVDS = LCD, CRT, AUTO
       Option "EnablePrivateBackZ" "yes" #Enable 3d support <= May Not Work
       Option "HSync2" "65" #This sets the horizontal sync for the secondary display. 
       Option "VRefresh2" "60" #This sets the refresh rate of the secondary display.
  Option      "Capabilities" "0x00000800"
  Option      "PairModes" "0x0+0x0"
  Option      "EnableMonitor" "lvds,tmds1" # may be you dont need this
  BusID       "PCI:1:0:0"
EndSection

Section "Screen"
  Identifier "Default Screen"
  Device     "Configured Video Device"
  Monitor    "Configured Monitor"
EndSection

Section "Screen"
  Identifier "aticonfig-Screen[0]-0"
  Device     "aticonfig-Device[0]-0"
  Monitor    "aticonfig-Monitor[0]-0"
  DefaultDepth     24
  SubSection "Display"
    Viewport   0 0
    Depth     24
  EndSubSection
EndSection

First I could fix the freezing of X on logout by disabling acpi. But then I found at Wiki Troubleshooting some hints and had success with:
File: /etc/kde3/kdm/kdmrc
TerminateServer=true
didn’t work alone. Added
sudo /usr/sbin/update-rc.d -f atieventsd remove
with success even with acpi enabled.

Grub menu disabling acpi:

# set this in /boot/grub/menu.lst
title           Ubuntu 8.04.1, kernel 2.6.24-21-generic ACPI=off
root            (hd0,5)
kernel          /boot/vmlinuz-2.6.24-21-generic root=UUID=45c3fc6b-bbcb-4320-8470-9228582f3115 ro quiet pci=noacpi acpi=off
initrd          /boot/initrd.img-2.6.24-21-generic

Since Version 1.1 subversion can deal with symlinks (see Does Subversion support symlinks?). There are only a few remarks in the manual Versioned Properties – svn:special and ‘svn add’ command.

Actually all handling of the symbolic link is up to the client. Cause in creation of symlinks the used paths do matter and subversion stores the link target in simple text file with the appropriate relative or absolute path you should choose the way you create your symlinks with care.

Example – Creating a symlink in your working copy:

$ mkdir A
$ ln -s A link
$ svn add --force .
A         A
A         link
$ svn commit -m "link there"

the contents of the link file in svn:
link A

Example – change symlink target

$ svn del --force link
$ svn commit -m "no link"
$ mkdir B
$ ln -s B link
$ svn add --force .
$ svn commit -m "link changed to B"

the contents of the link file in svn:
link B

To exclude certain files and directories from subversion’s version control you can set the ‘svn:ignore’ property as described in Ignoring Unversioned Items.
That works fine but nevertheless you might run into problems if you are using
svn add *
or similiar on linux systems. This is due to the shell expansion of wildcards. The above command is expanded to explicit files names svn add filename and seems to have the same effect as svn add --no-ignore filename.
Tip: Use svn add --force . instead!

Today I faced a strange bug caused by the interaction of the user-agent string of Firefox on ubuntu feisty and some paket filters. A site wouldn’t load with the error message above in Firefox, but it would load in Opera. Update of firefox package didn’t fix it.

Found this thread Connection Reset in Firefox but not other browsers and one proposed fix worked for me:

Open “about:config” , type useragent in filter and change setting “general.useragent.extra.firefoxComment” from (Ubuntu feisty) to (Ubuntu). The problem seems to be that substring “ist” is recognized as a malware signature by some paket filters.

If it happens that you see the error message:”Unknown device: x11″ when you want a print file preview or similar, install the gs-esp-x package. That will fix the problem.

Command line utilities are great for one-pointed tasks or for batch processing, but sometimes you just want to browse around and quickly play with the options. For that purpose I prefer to use GUI-tools.

In ubuntu you can use the svn-workbench as an GUI-Client written in python to subversion repositories. I am using KDE, so installing kdesvn (also see kde-apps.org) gives me a repository access and management functions right in my Konqueror file browser by using addresses like: ksvn+https://rcs.somehost.de/rep1. In this way you can work in repositories without explicit checkout. The only draw back appears in case you want to copy directories. Due to Konquerors way of copying/moving with KIO you will be asked for log messages for each single subdir or file recursively. To avoid being asked for log messages every time start kdesvn, go to Main Menu Settings – Configure Kdesvn – KIO/Commandline – check KIO operations use standard logmessage .

Kdesvn adds extra functions in Konqueror’s context menu : RightClick – Actions – Subversion . Kate and QuantaPlus Integration is also provided by kdesvn.

BTW: Subclipse is a good svn GUI client implementation as well, but requires an Eclipse installation.

Say you want to record a video live stream from the internet for example from the Streaming CCC Congress in Berlin 2007.

This can be accomplished using the glorious mplayer HOWTO Rip Streams With MPlayer.

To stop the recording after a certain amount of time use this simple script (see also my post Finding Child Process Pids … ):

#!/bin/bash
URL=$1
FILE=$2
# duration in minutes
DURATION=$3
mplayer -framedrop -autosync 30 -cache 10000 -dumpstream $URL -dumpfile $FILE &
sleep $DURATIONm
kill %+

Now you need to start this script at a certain time. For that you could use the linux “at” command (see at). To run it you have to export the DISPLAY variable on ubuntu (see Bug #94933):
export DISPLAY=$DISPLAY ; export TERM=$TERM; echo "echo 'Hallo'" | at  now

But I prefer KAlarm from KDE to schedule tasks which should run only once.
Run KAlarm, create New Alarm, choose Action “Command”, enter the path to your script with appropriate arguments for stream url, dumpfile and duration in minutes:
/home/myhome/scripts/stream_ripper.sh mms://streaming-internet.fem.tu-ilmenau.de/saal3 test.asf 60
, adjust all other settings which are quite self explaining. Use the template feature of KAlarm for similiar tasks.

Next Page »