Freitag, 11. September 2020

Install Xrdp Server (Remote Desktop) on (K)Ubuntu 18.04.x

Had a hard time to install Xrdp Server on Kubuntu, initially all worked fine after doing like this. But then it failed with
another Xserver might already be active on display 10
and it took me quite some time to find the fix here:
sudo apt-get install xorgxrdp-hwe-18.04

Mittwoch, 27. Februar 2019

Switch from systemd-resolved to dnsmasq

So DNS handling is rather messy on (K)Ubuntu, especially if you need to change some settings. Your best bet is to switch back to using dnsmasq, here's how to do that:
  1. Remove /etc/resolv.conf

  2. Install dnsmasq:
    sudo apt-get install dnsmasq

  3. Disable and stop systemd-resolve (if currently being used):
    sudo systemctl disable systemd-resolved.service
    sudo systemctl stop systemd-resolved

  4. Make sure /etc/resolv.conf is a link to /run/resolvconf/resolv.conf, which should just contain the line
    nameserver 127.0.0.1

  5. Edit /etc/NetworkManager/NetworkManager.conf to contain this line in [main] section:
    dns=dnsmasq

  6. Restart the system to be on the safe side.
Now this should use the DNS nameservers NetworkManager received via DHCP. If you need to manually override it, you can edit /etc/dnsmasq.conf, e.g. to override DNS servers from DHCP to resolve Dropbox and Google queries via Google' DNS 8.8.8.8, and fallback to 1.2.3.4 for all other domains:
server=/dropbox.com/8.8.8.8
server=/dropboxapi.com/8.8.8.8
server=/google.com/8.8.8.8
server=/#/1.2.3.4

Dienstag, 31. Dezember 2013

Sharing Garmin Activities/History directories between multiple computers

Finally a new post after a really long pause, my new found love for endurance sports not playing the least part here, so this will be the topic here.

Obviously, I'm using Garmin products for tracking my training, so I can train and play around with technology at the same time :-)  Garmin devices will usually store the training data in Activities/History directories in your Windows user directory, e.g. for XP in C:\Documents and Settings\{USERNAME}\Application Data\GARMIN\Devices\{DEVICE-NUMBER}\ and for Windows 7 in C:\Users\{USERNAME}\AppData\Roaming\GARMIN\Devices\{DEVICE-NUMBER}\.

Now if you synchronize your device with multiple computers, you'll only get new data on the computer you sync with after the activity. Why not use Dropbox to keep the computers in sync?

For Windows XP, create a symbolic link according to http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html, for Windows 7 use mklink according to http://verysimple.com/2008/06/02/create-symbolic-links-in-windows-xp-and-vista/.

Then link Activities and History directories in your Windows user directory from above to some directory in your Dropbox folder. That's it.

Note: I work at Garmin, but this is in no way an official Garmin approach but simply what I found out as an interested Garmin user, so use at your own risk.

Montag, 9. Mai 2011

Combine multiple PDF documents into one

Just a quick one, as I now needed this for the second time and already didn't write it down the first time …
I found this when looking for a way to combine multiple PDF documents into one. You just need to
  • sudo apt-get install gs pdftk

  • gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf
Pretty self explaining, so I'm gonna end early here.

Dienstag, 15. Februar 2011

Setting up my Kubuntu

Just for the record, here's how I configure Kubuntu after installation:
  • install Firefox with the following add-ons:
  • install VirtualBox
  • System Settings: setup Social Desktop opendesktop.org
  • setup ssh server
    • sudo apt-get install openssh-server
  • setup ssh public key authentication
  • setup Dropbox
  • setup Synergy+
  • setup BackupPC client:
    • sudo apt-get install rsync
    • edit /etc/default/rsync to include "RSYNC_ENABLE=true"
    • create /etc/rsyncd.conf
    • sudo chown root:root /etc/rsyncd.conf
    • create /etc/rsyncd.secrets
    • sudo chown root:root /etc/rsyncd.secrets
    • sudo chmod 600 /etc/rsyncd.secrets
    • sudo /etc/init.d/rsync start
  • setup Autostart
    • ~/.dropbox-dist/dropboxd
    • /usr/bin/ssh-add (using ksshaskpass)
    • On desktop, mounting netbook drive: /usr/bin/sshfs eee1005.home.lan:/home/stefan/ /home/stefan/eee1005/
    • On desktop, Synergy+ server: /usr/bin/synergys
    • On netbook, Synergy+ client: /usr/bin/synergyc -f e521mk
  • setup Skype

Freitag, 28. Januar 2011

Installed Linux on an SSD

I have it up and running for some weeks now, I took the most simple approach possible described here: just create one partition on the SSD (I still have Grub on my HD) using

sudo fdisk -H 32 -S 32 /dev/sdg (choose first cylinder as 2, end cylinder as the default one)
sudo mke2fs -t ext4 -E stripe-width=128 /dev/sdg1

when booting Kubuntu 10.10 from installation CD, then install from there.

No need to do any aligning calculations whatsoever. I even have /home, /tmp and /var on the SSD. There is quite some write activity in those directories, but then SSDs get cheaper and cheaper …

All that is left to do after installation is:

  • sudo apt-get install sysfsutils
  • sudo nano /etc/sysfs.conf
  • add the line block/sdf/queue/scheduler = noop at the end
  • sudo nano /etc/fstab
  • change the options for / to noatime,discard,data=ordered,errors=remount-ro

System performing abolutely great now!

Freitag, 17. Dezember 2010

Installing Linux on an SSD

I've got myself an OCZ Vertex 2 60 GB for Christmas :-)

I'll document the process of how to configure, format and install Kubuntu 10.10 here. I've waited until this release, as starting from 2.6.33 Linux Kernel has built in TRIM support making best use of SSDs. I'll try to come up with the best setup for

  • installing Linux as single OS, so no dual booting
  • no RAID or LVM setup
  • keeping /home and /var on my existing HDD as these will be written to rather frequently

I'll make use of knowledge gained by filesystem developer Ted Ts'o and some other blogger regarding alignment considerations, the excellent Ubunti Wiki SSD checklist and the detailed blog entry on Aligning an SSD on Linux by Markus Ewald.

Now the fun can start …

Dienstag, 7. Juli 2009

Building NSIS on Linux amd64

NSIS is an open source scriptable installer for creating Windows setup files that can also be run under Linux to produce .exes. You can even install it using sudo apt-get install nsis. But I needed a version that creates a log file when installing, so I had to compile from the sources myself. I faced some problems, as I didn't find any good documentation for an amd64 system, so here's what I did additionally to the steps described here:


  • sudo apt-get install g++ gcc-multilib g++-multilib


  • edit SCons/config.py and set the variable NSIS_CONFIG_LOG to yes


  • scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/home/stefan/opt/nsis-2.43 install-compiler

Mittwoch, 11. Juni 2008

Unable to open PDFs in KPDF

After installing the latest Adobe Reader directly from Adobe's site (I quickly uninstalled the version from Medibuntu again that I blogged about before, because I couldn't choose a german locale), I noticed I couldn't open my PDFs in KPDF anymore. I found some errors from AppArmor in /etc/messages, but according to Google they were not relevant. Than I found a post describing the same behaviour, noting that starting KPDF as root worked. I checked it, same with me.

When starting KPDF from the commandline, a warning is shown:
kpdf: WARNING: Unknown mimetype 'application/x-kdeuser1'.


This hints at the solution: Adobe Reader installation obviously messed up mime types, going to Konqueror -> Settings -> Configure Konqueror -> File Associations -> Known Types -> applications and deleting user x-kdeuser1 (I also had x-kdeuser2) solved the problem.

Samstag, 7. Juni 2008

Installing software from Medibuntu

Here's how to install Skype and Adobe Reader via Adept Manager from Medibuntu:


  1. in /etc/apt/sources.list add
    ## medibuntu
    deb http://packages.medibuntu.org/ hardy free non-free
    deb-src http://packages.medibuntu.org/ hardy free non-free

  2. add the GPG key for medibuntu:
    wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O-
    | sudo apt-key add -

  3. update packages:
    sudo apt-get update


Now in Adept Manager just install Skype or Adobe Reader.

Freitag, 25. Januar 2008

Deploying BIRT WebViewerExample in Tomcat 5.5

When deploying the WebViewerExample of the BIRT runtime as documented, the viewer application didn't start correctly but gave a java.security.AccessControlException: access denied (java.io.FilePermission /var/lib/tomcat5.5/webapps/birt-viewer/documents
write)
, because it couldn't create the documents directory in it's installation directory.

Some googling showed that the problem was that in Debian/Ubuntu Tomcat is started using the java security manager. The solution given was to deactivate the security manager in /etc/init.d/tomcat5.5, but that didn't quite convince me. I simply granted the web application all permissions by appending to /etc/tomcat5.5/policy.d/50user.policy:

grant codeBase "file:${catalina.base}/webapps/birt-viewer/-" {
permission java.security.AllPermission;
};

Freitag, 18. Januar 2008

Cleaning up packages

Installing software in Kubuntu is really simple. Just launch Adept Manager, select the package you want and install it. The software is then installed automatically, as are any additional packages it depends upon.

Unfortunately, when removing the software again, any dependent packages that were installed automatically are not removed (Synaptic in Ubuntu is more intelligent, I wonder when Kubuntu will catch up here).

Recently, I learned about sudo apt-get autoremove and deborphan for cleaning up those packages that are no longer needed.

Donnerstag, 17. Januar 2008

Multimedia Support in NoMachine NX

I've finally found out how to enable sound when logged in an NX session, so I can remotely log in to my desktop computer (referred to as server in the description below), start up Amarok and hear music over the network (so far I've only tried it at home with 100 MBit LAN, when I look at the network traffic I doubt it will work via WLAN, let alone DSL …):


  1. enable multimedia support for the NX session by clicking Configure … then going to the Services tab and activating the corresponding option, then log on to the server


  2. on the server, go to System settings > Sound system > Hardware and select the Enlightened Sound Daemon (ESD) (I've translated the german text back to english, I don't know if it actually corresponds to an english Kubuntu)


  3. go to System settings > Notifications > Replay settings … and select KDE sound system; now playing a sound for a notification should already work!


  4. Start Amarok and go to Settings > Configure Amarok … > Audio output and select esd as output module; if it's not available, you must sudo apt-get install libxine1-gnome (I know, it looks like a strange package for Kubuntu/Amarok, but it contains the ESD output plugin for xine, Amarok's audio backend)




Now play some music in Amarok, you should hear it on the client where you started the NX session!


One more thing, it seems not to work when Amarok is automatically started when logging in (i.e. it was running when you logged out last time), in that case I quit Amarok, then log off from the NX session and start a new NX session.

Donnerstag, 3. Januar 2008

Adding JDBC driver in BIRT

I'm currently learning how to use BIRT, the open source Eclipse-based reporting system. After working through the tutorial I tried to add my own database, and so had to provide a JDBC driver for it. There are installation instructions on how to do it, but when testing the connection I always received org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: org.sqlite.JDBC.

Only later I found a section in the online help where it says that the driver must be copied to a certain plugin directory first (/eclipse/plugins/org.eclipse.birt.report.data.oda.jdbc_2.0.0/drivers).

I've created an enhancement request for the installation instructions.


Update 2008-01-17: Obviously, it's not a bug but the effect of installing Eclipse in /opt with root ownership, and then starting Eclipse as a normal user.

Donnerstag, 20. Dezember 2007

VirtualBox and USB devices

My parents bought a new panasonic camcorder, the software that came with it is Windows only of course. So I tried to get it running in Wine, but the installer didn't get very far before hanging. Next I installed VirtualBox, and installing the video software in a Windows 2000 hosted on VirtualBox worked just fine.

Unfortunately, Windows didn't see the camera's SD card that was attached via a USB adapter. Some googling showed that USB support in VirtualBox is broken in Gutsy. Here are the steps to get it working:


  1. Edit /etc/init.d/mountdevsubfs.sh as root
  2. , then activate the commented lines for making /proc/bus/usb work:

    mkdir -p /dev/bus/usb/.usbfs
    domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
    ln -s .usbfs/devices /dev/bus/usb/devices
    mount --rbind /dev/bus/usb /proc/bus/usb


  3. Save the file and run the script via sudo /etc/init.d/mountdevsubfs.sh

  4. Edit /etc/fstab as root and add a line:

    none /proc/bus/usb usbfs devgid=XXXX,devmode=664 0 0

    where XXXX is the gid for group vboxusers as defined in /etc/group

  5. Save the file, then activate the changed configuration via sudo mount -a


When you start VirtualBox now, a USB controller can be activated in the settings for each virtual machine.

Mittwoch, 5. Dezember 2007

KNetworkManager doesn't support KPPP

I've convinced my parents (mostly my father) that it would be easier for them to have Kubuntu on their new laptop than Vista. They'll have to learn a new user interface anyway, but Kubuntu makes support for me much easiear (especially since I've learnt about the desktop sharing feature of NX).

So I've ordered a trusty Dell Inspiron 6400n like my wife has, but this time with Ubuntu 7.04 preinstalled. Installation of Kubuntu 7.10 went smoothly, thanks to Dell's Ubuntu support even the internal modem is supported by a restricted driver.

But when using KPPP for making an internet connection, I was not able to brwose the internet using konqueror. Firefox did work, so I set it up as default internet browser.

But some days later my father found out that he couldn't receive any mails in KMail, though checking with the web frontend I saw he had new mails. There was no error message in KMail, it just said there were no new mails.

Some googling later I found a bug report and knew that KDE software like Konqueror and KMail rely on KNetworkManager to check wether they are in online or offline mode. When it works, it's a great feature. Unfortunately it doesn't work with some weird WLAN setups -- and with KPPP!

The easiest solution to get around this is to simpy quit KNetworkManager -- and make sure it doesn't automatically come up again on the next start.

Donnerstag, 22. November 2007

Compiling source code

I've found a kate plugin for sorting but had to compile it. I had gcc installed but still ./configure told me that the ,,C compiler cannot create executables.'' I quickly found out that some packages for doing development stuff were still missing, so that was a quick fix.

Dienstag, 6. November 2007

libxine1-extracodecs is now libxine1-ffmpeg

I've already posted about installing libxine-extracodecs in august and april. This is no longer true since Gutsy, now the package is libxine1-ffmpeg.

Actually, now there is a meta package kubuntu-restricted-extras with commonly used restricted packages which also contains libxine1-ffmpeg. I've not installed the meta package, since I didn't want Java6 to be installed, but I've installed most of the other packages contained.

Freitag, 2. November 2007

Speeding up Konqueror

Upgrading from Kubuntu Feisty to Gutsy didn't work for me, so I've installed Gutsy from scratch. As Konqueror still was far slower than Firefox, especially for sites with many images like GMX or Xing, I started to search again for solutions. Here's what I found out, and now Konqueror is nearly as fast as Firefox for me:

  • deactivate IPv6, otherwise IPv6 DNS queries will happen that can result in timeouts when some servers don't support it yet: append KDE_NO_IPV6=true to /etc/environment

  • install a local DNS cache, as Konqueror/KDE doesn't implement it (in contrast to Firefox): I'm using pdnsd, see here for installation instructions.

  • Konqueror uses a disk cache by default, the directory is /var/tmp/kdecache-username/http. I found out that the directory had root:root ownership for my installation, I have no idea how that happened. After chowning back to my user, the directory is now used as expected.

Montag, 8. Oktober 2007

Installing Type1 fonts for OpenOffice

My wife has a binary encoded Type1 font (a .pfb and a .pfm file) that contains symbols for guitar tab notation. It came with some Windows software, and obviously in Windows the .pfb file and .pfm file are enough to use the font.

Right clicking the .pfb file in KDE let's you install the font, but it doesn't show up in OpenOffice's font selector. KWord on the other hand let's you use it.

After some googling I found out that OpenOffice in Linux needs an accompanying .afm file, and here's how to create the .afm file from the .pfb file:

  • Install t1lib, a library for generating character- and string-glyphs from Adobe Type 1 fonts: sudo apt-get install t1lib-bin

  • Go to the directory where the .pfb file was installed, e.g.: cd ~/.fonts

  • Create the .afm file, e.g.: type1afm fontfile.pfb


And that's all, starting OpenOffice should now show the font in the font selector.

Alternatively, the .afm file can go to a subdirectory named afm.