Unfortunately, in the linux desktop world, some things just don't work. Especially when it comes to webinars, web conferencing and the like, where the focus is on Windows desktops. Using RDP to a virtual or physical Windows box is a good solution, except when it comes to audio. Audio jitter/stutter is almost guaranteed on an RDP session. Googling the topic, you'll even find several "experts" saying its just not possible to have quality audio over RDP.
The linux RDP client "rdesktop" was historically built against OSS, and under Ubuntu it was patched to work with ASLA, as OSS is kinda considered "old and non-standard". So, yay, Ubuntu's rdesktop works with "-r sound:local" to get sound over an RDP session.. but again.. jittery - even over gigabit LAN.
Virtualbox comes with a custom RDP client, rdesktop-vrdp, which was tweaked for virtual rdp sessions, but still uses OSS, and therefore there is NO sound on RDP sessions (unless of course you build OSS support on your system - just not there in Ubuntu).
Alas! The PulseAudio developers built this wrapper "padsp", which "starts the specified program and redirects its access to OSS compatible audio devices (/dev/dsp and auxiliary devices) to a PulseAudio sound server." The result of running rdesktop-vrdp via this wrapper is just amazing.. audio is just PERFECT! Absolutely no jitter in the audio at all. Not only on a local network, but even across WAN.
Its so simple to launch too: "padsp rdesktop-vrdp -r sound:local .....(whatever other params)"
padsp is part of pulseaudio-utils in Ubuntu
I have no idea why this wrapper works so good.. but kudos to the developers! Or maybe its just OSS that is so efficient with networked audio?? If anyone knows, let us know in comments below.
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
Thursday, December 11, 2014
Tuesday, October 21, 2014
Ubuntu LTSP for the Enterprise
Ubuntu LTSP (ltsp-server package) provides a very easy and convenient method for deploying a thin-client environment (see ltsp.org), but is centered primarily around one server being the DHCP/TFTP/NBD and image build server. Being in an enterprise environment, I needed to be able to split these functions in order to deploy thin clients. The image below depicts what I needed to achieve. Essentially I wanted to have ubuntu 14.04 images served by older release servers, so my "build" server needs to be 14.04. Plus I wanted to be able to server multiple custom images off the same server(s). Note: I have existing DHCP/TFTP and NBD servers - so this post assumes these are already established - If you do not, then the ltsp-server package has everything you need, and this post is kinda moot.
First, on my build server, I did the following:
apt-get install ltsp-server
ltsp-build-client --dist trusty --arch amd64 --base /opt/ltsp-trusty
This builds your base client system, in my case an amd64 architecture ubuntu 14.04 base. It takes about 20 minutes depending on your Internet connection and system speed. Then any customizations can be done via ltsp-chroot:
ltsp-chroot -a amd64 -b /opt/ltsp-trusty --mount-package-cache
(more on what I customized in later post)
And to build the image:
ltsp-update-image --base /opt/ltsp-trusty
So what we have now on the build server, is the image in /opt/ltsp-trusty/images called amd64.img and the needed tftpboot files in /var/lib/tftpboot/ltsp. In very simple terms, we now need to deploy the image "amd64.img" to the NBD server, and the PXE boot environment to the TFTP server, and then tweak configuration files to point to the right places.
NBD server (Network Block Device)
For every different image you want to deploy, you need nbd-server listening on a different port. I am using inetd to spawn the nbd-server instances. Here is my inetd.conf, which is configured for 3 images on ports 2000 thru 2002:
2000 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nbdrootd /opt/ltsp/images/i386.img
2001 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nbdrootd /opt/ltsp-trusty/images/amd64.img
2002 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nbdrootd /opt/ltsp-trusty/images/i386.img
The image files have to be accessible directly, so in my case I copied them from my build server.
TFTP server (Trivial File Transfer Protocol)
For every different image, you need a specific PXE environment defined in /var/lib/tftpboot. In my case I have 3:
/var/lib/tftpboot/ltsp/i386
/var/lib/tftpboot/ltsp-trusty/amd64
/var/lib/tftpboot/ltsp-trusty/i386
These can be copied as is from the same location on the build server - each environment can have its own lts.conf file.
Now, there is some tweaking required in order for the client to grab the correct NBD image. You need to add nbdroot={ipaddress}:{port} to the kernel boot parameters for any image served by the non-standard 2000 NBD port. This is done in the pxelinux.cfg/ltsp file - snippet below.
# This file is regenerated when update-kernels runs.
# Do not edit, see /etc/ltsp/update-kernels.conf instead.
default ltsp-NBD
ontimeout ltsp-NBD
# This file is regenerated when update-kernels runs.
# Do not edit, see /etc/ltsp/update-kernels.conf instead.
label ltsp-NBD
menu label LTSP, using NBD
kernel vmlinuz-3.13.0-37-generic
#append ro initrd=initrd.img-3.13.0-37-generic init=/sbin/init-ltsp quiet splash root=/dev/nbd0
append ro initrd=initrd.img-3.13.0-37-generic init=/sbin/init-ltsp nosplash root=/dev/nbd0 nbdroot=192.168.202.4:2001
ipappend 2
DHCP server (Dynamic Host Configuration Protocol)
Your DHCP configuration is key, as it directs the PXE booting client to the correct TFTP server and PXE path. I use an Etherboot gPXE image served by a local TFTP server to fix issues with older network cards - but you may not need that. Here is one client config section example:
host webc2 { hardware ethernet 20:cf:30:6f:0a:9e;
fixed-address webc2;
option host-name "webc2";
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
if exists user-class and option user-class = "gPXE" {
next-server 192.168.202.4;
filename "/ltsp-trusty/i386/pxelinux.0";
} else { filename "/tftpboot/undionly.kpxe"; }
} else {
next-server 192.168.202.4;
filename "/ltsp-trusty/i386/nbi.img";}}
The "next-server" portion points it to the TFTP server and PXE file.
You'll probably notice that in my case, my TFTP server and NBD server are on the same server, but its not necessary.
Anyway, in another post I'll discuss an improvement I made to LTSP to allow better scripting via TFTP.
Thursday, June 5, 2014
Inserting/Pasting HTML into OpenOffice Calc via Basic macro
Its easy to manually copy data from a browser window and paste into an existing OO Calc doc. If tables are used in the html, they paste nicely into rows and columns.
I needed to automate this process via a macro, but it wasn't as simple as I at first thought.
Its easy to use a filter with loadComponentFromURL, to create a NEW Calc doc. But I wanted to place it specifically into an existing doc.
I then found ability to link to External Data via macro using AreaLinks.insertAtPosition. This worked wonderfully, but I didn't like that it retained links.. I just wanted a dump of the data, no strings attached.
I moved to try doing copy and paste via a Shell command, wget | xclip, and .uno:Paste , but the paste was always "unformatted text" and thus pasted raw html.
I went back to AreaLinks.insertAtPosition .. figured if I can insert a link, and then remove the link (retaining the data), I've essentially achieved my objective. So this is the macro I ended up with (works with OO 3.2 and LO 4.1):
Note: The "section" argument is either "all" or "1", "2", "3",.. etc representing which html table element you want.
Note 2: I also found that this method doesn't respect the http://user@pw:URL method, so I did have to use : Shell ("bash",0,"-c 'wget -O /tmp/file.html http://user@pw:URL....'", true) to get the results to a temp file, and then used InsertWebLinkAtSelection("file:///tmp/file.html","all")
I needed to automate this process via a macro, but it wasn't as simple as I at first thought.
Its easy to use a filter with loadComponentFromURL, to create a NEW Calc doc. But I wanted to place it specifically into an existing doc.
I then found ability to link to External Data via macro using AreaLinks.insertAtPosition. This worked wonderfully, but I didn't like that it retained links.. I just wanted a dump of the data, no strings attached.
I moved to try doing copy and paste via a Shell command, wget | xclip, and .uno:Paste , but the paste was always "unformatted text" and thus pasted raw html.
I went back to AreaLinks.insertAtPosition .. figured if I can insert a link, and then remove the link (retaining the data), I've essentially achieved my objective. So this is the macro I ended up with (works with OO 3.2 and LO 4.1):
Sub InsertWebLinkAtSelection(url As String, section As String)
Dim oDoc As Object
Dim oSelection
Dim oAddress As new com.sun.star.table.CellAddress
oDoc = ThisComponent
oSelection = oDoc.getCurrentController().getSelection()
if oSelection.supportsService("com.sun.star.sheet.SheetCell") then
oAddress = oSelection.getCellAddress()
oDoc.AreaLinks.insertAtPosition(oAddress,url,"HTML_" +
section,"calc_HTML_WebQuery","0 0")
oDoc.AreaLinks.removeByIndex(getCount())
endif
End SubThe key was that last line... oDoc.AreaLinks.removeByIndex(getCount()) .. doesn't affect any exist links in document. So it creates a link, which inserts the data at current cell address, and then removes the link.
Note: The "section" argument is either "all" or "1", "2", "3",.. etc representing which html table element you want.
Note 2: I also found that this method doesn't respect the http://user@pw:URL method, so I did have to use : Shell ("bash",0,"-c 'wget -O /tmp/file.html http://user@pw:URL....'", true) to get the results to a temp file, and then used InsertWebLinkAtSelection("file:///tmp/file.html","all")
Friday, April 26, 2013
Installing Ubuntu 13.04 on an ASUS X55A / X55U
Downloaded the official release of 13.04 yesterday, and tried installing on an ASUS X55A. I wanted a dual-boot setup. Took a little bit of effort, but got er done.. steps follow.
First thing I had to do was to disable Fast Boot and disable Secure Boot. From inital power on, press ESC repeatedly until small blue boot menu appears, then select "Enter Setup". Goto Boot -> Boot Configuration and disable Fast Boot. Change boot order so that DVD is 1st. Goto Security and disable Secure Boot Control. Press F10 to save and exit. This allows the install media to boot (in my case a DVD). Install went fine, selected the "Install Ubuntu alongside Windows 8" option.
After install, the system booted to grub, but when selecting Ubuntu, screen would go blank (but not off) and all HDD activity would stop. Numlock/Capslock keys worked, so system was not hung. Pressing Enter a few times would cause HDD light to flicker, but otherwise nothing.. Ctrl-Alt-Fn would not do anything. Strange thing was that if I rebooted, pressed ESC to get blue boot menu, and selected the "ubuntu" option (created by installer), it would goto grub and then boot fine!
To fix this, I installed and ran boot-repair.
Reboot and press ESC on boot to get blue menu, Enter Setup, goto Boot -> Add New Boot Option -> Add boot option and give it a name (i used "ubuntu13.04"). The filesystem was pre-selected for me, the path for the boot option I entered as follows: fsx:sda1/EFI/ubuntu/grubx64.efi - have no idea what the fsx: is about, but it was given in the help text. Scroll down to Create, and press enter. Press ESC to go back, and then move the newly created boot option to #1 position. Reboot and enjoy. Fully functional dual-boot system with Win8 and Ubuntu 13.04.
Why the Ubuntu folks don't learn from the boot-repair folks is really a mystery to me...
NOTE: I ended up having to delete the Windows 8 boot option in the BIOS, because after booting from grub into Win8 once, it did something to bypass grub.. frikin Windows!
First thing I had to do was to disable Fast Boot and disable Secure Boot. From inital power on, press ESC repeatedly until small blue boot menu appears, then select "Enter Setup". Goto Boot -> Boot Configuration and disable Fast Boot. Change boot order so that DVD is 1st. Goto Security and disable Secure Boot Control. Press F10 to save and exit. This allows the install media to boot (in my case a DVD). Install went fine, selected the "Install Ubuntu alongside Windows 8" option.
After install, the system booted to grub, but when selecting Ubuntu, screen would go blank (but not off) and all HDD activity would stop. Numlock/Capslock keys worked, so system was not hung. Pressing Enter a few times would cause HDD light to flicker, but otherwise nothing.. Ctrl-Alt-Fn would not do anything. Strange thing was that if I rebooted, pressed ESC to get blue boot menu, and selected the "ubuntu" option (created by installer), it would goto grub and then boot fine!
To fix this, I installed and ran boot-repair.
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (sudo boot-repair &)
I just selected the "recommended" option in boot-repair. After doing this, I had to add another boot option as per the instructions - had to add sda1/EFI/ubuntu/grubx64.efi. Pay attention to what it tells you, as it may not be identical, depending on your partitioning.
Reboot and press ESC on boot to get blue menu, Enter Setup, goto Boot -> Add New Boot Option -> Add boot option and give it a name (i used "ubuntu13.04"). The filesystem was pre-selected for me, the path for the boot option I entered as follows: fsx:sda1/EFI/ubuntu/grubx64.efi - have no idea what the fsx: is about, but it was given in the help text. Scroll down to Create, and press enter. Press ESC to go back, and then move the newly created boot option to #1 position. Reboot and enjoy. Fully functional dual-boot system with Win8 and Ubuntu 13.04.
Why the Ubuntu folks don't learn from the boot-repair folks is really a mystery to me...
NOTE: I ended up having to delete the Windows 8 boot option in the BIOS, because after booting from grub into Win8 once, it did something to bypass grub.. frikin Windows!
Thursday, March 21, 2013
Upgrading RT 3.6.4 to RT 4.0.10
Request-Tracker (RT) upgrade steps. This is based on http://blog.bestpractical.com/2011/07/upgrading-to-rt-4.html. Please read all related documents and don't just follow this blindly.
Moving from a gentoo linux 2.4 box, RT 3.6.4, mysql 4.0.8 to an ubuntu 12.04 server, RT 4.0.10 and mysql 5.5
Export 3.6.4 Database
On RT 3.6.4 machine as root (obviously must know the root mysql password):
Prepare SQL for Import
You have to edit rt3.sql with vim or sed, and remove all references to "Type=Innodb" (this is default in mysql now), and search for "timestamp(" and remove the bracketed section.. (eg. "timestamp(14)" is now just "timestamp").
Create Database for Import
Import 3.6.4 Database
Download RT 4.0.10 source, extract to temp dir, run .configure with needed parameters (see your 3.6.4 install), and basically follow README up to and including "make install". This should install in /opt/rt4. Be sure to configure RT_SiteConfig.pm and configure apache2 as needed (beyond scope of this post).
Upgrade Database
From the temp dir used above execute the following:
mysql -p rt4
CREATE INDEX CachedGroupMembers3 on CachedGroupMembers (MemberId, ImmediateParentId);
quit
make upgrade-database
(From 3.7.81 to 3.7.87)
mysql -p rt4
drop index groupmembers1 on GroupMembers;
create unique index groupmembers1 on GroupMembers (GroupId,MemberId);
quit
make upgrade-database
(From 3.8.3 to 4.0.9)
Moving from a gentoo linux 2.4 box, RT 3.6.4, mysql 4.0.8 to an ubuntu 12.04 server, RT 4.0.10 and mysql 5.5
Export 3.6.4 Database
On RT 3.6.4 machine as root (obviously must know the root mysql password):
mysqldump -p --opt rt3 > rt3.sqlCopy this file to the new machine. All further steps are on new machine.
Prepare SQL for Import
You have to edit rt3.sql with vim or sed, and remove all references to "Type=Innodb" (this is default in mysql now), and search for "timestamp(" and remove the bracketed section.. (eg. "timestamp(14)" is now just "timestamp").
Create Database for Import
mysql -pNOTE: above replace rt_user and rt_pass by the user/password you wish to use for RT. Also, it may seem counter intuitive to name database rt4, since we are importing rt3 - just remember the end target is 4.0.10.
create database rt4 character set latin1;
grant all on rt4.* to rt_user identified by 'rt_pass';
quit
Import 3.6.4 Database
mysql -p --default-character-set=binary rt4 < rt3.sqlDownload/Configure/Install RT 4.0.10
Download RT 4.0.10 source, extract to temp dir, run .configure with needed parameters (see your 3.6.4 install), and basically follow README up to and including "make install". This should install in /opt/rt4. Be sure to configure RT_SiteConfig.pm and configure apache2 as needed (beyond scope of this post).
Upgrade Database
From the temp dir used above execute the following:
make upgrade-databaseIf it fails at 3.7.81, do this:
(From 3.6.4 to 3.7.87)
mysql -p rt4
CREATE INDEX CachedGroupMembers3 on CachedGroupMembers (MemberId, ImmediateParentId);
quit
make upgrade-database
(From 3.7.81 to 3.7.87)
perl etc/upgrade/upgrade-mysql-schema.pl rt4 rt_user rt_pass > queries.sqlIf it fails at 3.8.2, do this:
(again replacing rt_user and rt_pass with user/password you wish to use for RT)
mysql -p rt4 < queries.sql
(this takes about 3 times as long as the initial import!)
mysql -p
alter database rt4 default character set utf8;
quit
make upgrade-database
(From 3.7.87 to 4.0.9)
mysql -p rt4
drop index groupmembers1 on GroupMembers;
create unique index groupmembers1 on GroupMembers (GroupId,MemberId);
quit
make upgrade-database
(From 3.8.3 to 4.0.9)
perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_cgm_table.plNow test, test, test... :)
(takes even longer than above query)
perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_transactions_table.pl
perl etc/upgrade/vulnerable-passwords --fix
Thursday, March 22, 2012
Linux memory tweaks for improved responsiveness
Memory management techniques in the linux kernel has changed over the years. Sometimes a kernel upgrade, or a hardware upgrade, where you expect better performance, can lead to disappointment.
For a while now, I've been struggling with our ubuntu 10.04 application server (managing 35 desktop sessions) where we experience "morning sluggishness" with the system. Between 6am and noonish, the system was just not as responsive as it could be, but in the afternoons it became quite zippy. I've been explaining this away with things like "everyone is just logging in morning, system is seeing a heavy load early in the day".. or "everyone does more work in the morning, and take it easy after lunch".
I decided to analyze memory usage patterns combined with I/O wait times. Between 8am and noon, there was an average I/O wait time of between 2% - 3%, and between noon and 4pm an average of < 1%. When I graphed out memory usage patterns, I noticed that our nightly backups were consuming a huge amount of buffered memory (understandably).. and that this buffer was slowly reclaimed overtime and around noonish every day it got close to cache size. This couldn't be coincidence.. performance steadily increased as the buffers from previous nights backup were free'd up. Makes total sense.. but question was.. how do I modify this behaviour?
Googling around, I came across this link
I already knew about vm.swappiness - already have this set to 10.
But vm.vfs_cache_pressure and vm.drop_caches were new to me. So I thought, if we can drop the caches right after the backup, and give a little more priority to the inode/dentry caches - this should reduce our I/O wait.
So, I set vm.vfs_cache_pressure to 50 ( sysctl -w vm.vfs_cache_pressure=50 ), and in my backup script, added "echo 3 > /proc/sys/vm/drop_caches" to the end. The results are quite dramatic. So far this morning, I have an average I/O wait of 0.19%, down from 2-3%!! (and system is very zippy.) This graph gives a good visual on the memory usage...
Notice: Everyday at 00:00.. this is backup kicking in.. Tues/Wed shows the slow reclaiming of buffers. Thurs is where I drop the caches right after backup.. now caches reach previous days peak by 8am!!
Could this be the end of my users complaining about a slow system?? Doubt it... They never notice when its fast.. but always and only notice when its slow.
Update: After two days now.. amazing.. average daytime I/O wait is now < 0.10%
Update: After two days now.. amazing.. average daytime I/O wait is now < 0.10%
Saturday, September 17, 2011
WinTV 1600 model 1199 and VirtualBox on linux
Had a working VirtualBox WinXP guest on an Ubuntu Natty host.
Installed a WinTV 1600 video capture card, and after that, the VirtualBox WinXP guest would not boot.. got the message:
Failed to load VMMR0.r0 VERR_NO_MEMORY
After digging thru the logs, and noticing vmalloc errors - I decided to blacklist the cx18 modules (for capture card), and reboot. VirtualBox worked now, but then if I removed the blacklist on the cx18 modules, and tried to load the module - I got the same vmalloc errors.
Determined its a shortage of virtual memory in the linux kernel. Default is 128M.
Certain device drivers (modules) - in my case, a video capture card - require chunks of this virtual memory for device mapping.
Virtualbox obviously uses the same mechanism. You can have 16GB of RAM, but if you only have 128M of vm allocated, you are going to run into the same issue.
Solution is to pass the "vmalloc=<size>" parameter to your kernel on boot. Preferably in 64M chunks.
In ubuntu, edit /etc/default/grub, and add "vmalloc=192M" to the GRUB_CMDLINE_LINUX_DEFAULT list.
eg. GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=192M quiet splash"
sudo update-grub
reboot
Installed a WinTV 1600 video capture card, and after that, the VirtualBox WinXP guest would not boot.. got the message:
Failed to load VMMR0.r0 VERR_NO_MEMORY
After digging thru the logs, and noticing vmalloc errors - I decided to blacklist the cx18 modules (for capture card), and reboot. VirtualBox worked now, but then if I removed the blacklist on the cx18 modules, and tried to load the module - I got the same vmalloc errors.
Determined its a shortage of virtual memory in the linux kernel. Default is 128M.
Certain device drivers (modules) - in my case, a video capture card - require chunks of this virtual memory for device mapping.
Virtualbox obviously uses the same mechanism. You can have 16GB of RAM, but if you only have 128M of vm allocated, you are going to run into the same issue.
Solution is to pass the "vmalloc=<size>" parameter to your kernel on boot. Preferably in 64M chunks.
In ubuntu, edit /etc/default/grub, and add "vmalloc=192M" to the GRUB_CMDLINE_LINUX_DEFAULT list.
eg. GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=192M quiet splash"
sudo update-grub
reboot
Now they play nicely together - and the overall system performance is much snappier.
Monday, April 11, 2011
ext4 performance and the barrier option
We recently implemented a 6-disk SAS RAID 1+0 /home ext4 filesystem on our application server to improve performance, and found that we still had a disk I/O bottleneck, with processor I/O wait averaging in the 3 to 4% range.
I came across this LWN article http://lwn.net/Articles/283161/ that talks about a 30% performance drop when the barrier option is enabled on an ext4 filesystem.
As of the time of the LWN article, barrier was not enabled by default on an ext4 filesystem. But somewhere along the kernel release line, barrier=1 (on) became the default for newly created ext4 filesystems.
Doing a "cat /proc/mounts" on my ubuntu 10.04 distro, I found that my ext4 filesystems indeed had the option barrier=1. So on April 3rd, I added barrier=0 to my fstab, and rebooted. The performance boost was quite dramatic.
Using measures of "average wait time", "% utilization" and "%IO wait", here is the before and after stats, measured and averaged on a typical work week 8am to 5pm...
With barrier=1:
Average wait time: 90 ms
Average Disk utilization %: 40%
Average CPU IO wait %: 3.5%
With barrier=0:
Average wait time: 2 ms
Average Disk utilization %: 2%
Average CPU IO wait %: 0.40%
Graphs depict the change more dramatically (comparing April 1st to April 4th):
NOTE: This is not a "very busy" April 1st compared to a "very light" April 4th. Both are with a 30 user load, approx. 2300 processes. And every other day of the week in the comparison show the same dramatic improvement.
Of course one can argue that we are sacrificing data integrity for performance - but we do have a UPS backed system, and crashes are (thus far) non-existent.
I came across this LWN article http://lwn.net/Articles/283161/ that talks about a 30% performance drop when the barrier option is enabled on an ext4 filesystem.
As of the time of the LWN article, barrier was not enabled by default on an ext4 filesystem. But somewhere along the kernel release line, barrier=1 (on) became the default for newly created ext4 filesystems.
Doing a "cat /proc/mounts" on my ubuntu 10.04 distro, I found that my ext4 filesystems indeed had the option barrier=1. So on April 3rd, I added barrier=0 to my fstab, and rebooted. The performance boost was quite dramatic.
Using measures of "average wait time", "% utilization" and "%IO wait", here is the before and after stats, measured and averaged on a typical work week 8am to 5pm...
With barrier=1:
Average wait time: 90 ms
Average Disk utilization %: 40%
Average CPU IO wait %: 3.5%
With barrier=0:
Average wait time: 2 ms
Average Disk utilization %: 2%
Average CPU IO wait %: 0.40%
Graphs depict the change more dramatically (comparing April 1st to April 4th):
Average Wait Time
Average % Utilization
Load Average
NOTE: This is not a "very busy" April 1st compared to a "very light" April 4th. Both are with a 30 user load, approx. 2300 processes. And every other day of the week in the comparison show the same dramatic improvement.
Of course one can argue that we are sacrificing data integrity for performance - but we do have a UPS backed system, and crashes are (thus far) non-existent.
Thursday, November 25, 2010
xscreensaver and empathy presence notification
xscreensaver doesn't support d-bus - and therefore when screensaver activates, empathy (IM client) doesn't change status to "Away", like it does with gnome-screensaver.
The xscreensaver man page includes a nice perl script which you can use to accomplish the same thing. So here is "watchx.pl" script:
NOTE: This is designed for one empathy account.. and that account name containing the users login name. Works on ubuntu lucid. Also - that dbus-send command is all on one line.
And to have it launch at login... create the following "watchx.desktop" file and place it in /etc/xdg/autostart:
The xscreensaver man page includes a nice perl script which you can use to accomplish the same thing. So here is "watchx.pl" script:
#!/usr/bin/perlThen, using dbus-send, you can set status in empathy.. I use the following scripts "empathy-away.sh":
my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while () {
if (m/^(BLANK|LOCK)/) {
if (!$blanked) {
system "/usr/local/bin/empathy-away.sh";
$blanked = 1;
}
} elsif (m/^UNBLANK/) {
system "/usr/local/bin/empathy-avail.sh";
$blanked = 0;
}
}
#!/bin/bashand "empathy-avail.sh":
USER=`whoami`
service=`qdbus | grep $USER | sed -e "s/ //g"`
path=`echo $service | sed -e "s/\./\//g"`
dbus-send --dest=$service /$path org.freedesktop.Telepathy.Connection.Interface.SimplePresence.SetPresence string:"away" string:"Away from keyboard"
#!/bin/bash
USER=`whoami`
service=`qdbus | grep $USER | sed -e "s/ //g"`
path=`echo $service | sed -e "s/\./\//g"`
dbus-send --dest=$service /$path org.freedesktop.Telepathy.Connection.Interface.SimplePresence.SetPresence string:"available" string:"Available"
NOTE: This is designed for one empathy account.. and that account name containing the users login name. Works on ubuntu lucid. Also - that dbus-send command is all on one line.
And to have it launch at login... create the following "watchx.desktop" file and place it in /etc/xdg/autostart:
[Desktop Entry]
Type=Application
Exec=/usr/local/bin/watchx.pl
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Watch screen saver
Name=Watch screen saver
Comment[en_US]=Watch screen saver
Comment=Watch screen saver
Tuesday, August 3, 2010
NETCONSOLE to the rescue
On a headless server, when you get a kernel panic and the system is totally locked up, and there is no sync of kernel log, its extremely frustrating trying to debug.
Discovered a wonderful kernel module/feature called NETCONSOLE. From netconsole.txt - "This module logs kernel printk messages over UDP allowing debugging of problem where disk logging fails and serial consoles are impractical."
Using this usefull howto as a basis I got this working on ubuntu 10.04, which already has netconsole built as a module.
On the source system where you want to trap the messages:
where sport is the source port, saddr is the source address, dev is interface, dport is destination port, daddr is destination address and dmac is destination mac address.
On the remote end, install netcat, and do:
So easy.. and so useful..
Note: This is different than remote syslogd - which will capture kernel messages over the network - since netconsole is at the kernel level and thus more capable of capturing panics.
Discovered a wonderful kernel module/feature called NETCONSOLE. From netconsole.txt - "This module logs kernel printk messages over UDP allowing debugging of problem where disk logging fails and serial consoles are impractical."
Using this usefull howto as a basis I got this working on ubuntu 10.04, which already has netconsole built as a module.
On the source system where you want to trap the messages:
modprobe netconsole netconsole=<sport>@<saddr>/<dev>,<dport>@<daddr>/<dmac>
where sport is the source port, saddr is the source address, dev is interface, dport is destination port, daddr is destination address and dmac is destination mac address.
On the remote end, install netcat, and do:
netcat -ul <dport> >> /var/log/netconsole
So easy.. and so useful..
Note: This is different than remote syslogd - which will capture kernel messages over the network - since netconsole is at the kernel level and thus more capable of capturing panics.
Friday, October 23, 2009
Real time log file watcher
Have you ever wanted to be notified - in real-time - of an event in a log file?
This is a very efficient and effective way to do it.. all you need is inotifywait (in inotify-tools package, and of course inotify enabled kernel which is pretty standard these days).
#!/bin/bash
LOGFILE=/var/log/smdr.log
while inotifywait -qq -e modify $LOGFILE; do
x=`tail -n1 $LOGFILE | grep "something"`
if [ "$x" != "" ]; then
echo $x | mailx -s "Something happened!" you@abc.org
fi
done
This is a very efficient and effective way to do it.. all you need is inotifywait (in inotify-tools package, and of course inotify enabled kernel which is pretty standard these days).
#!/bin/bash
LOGFILE=/var/log/smdr.log
while inotifywait -qq -e modify $LOGFILE; do
x=`tail -n1 $LOGFILE | grep "something"`
if [ "$x" != "" ]; then
echo $x | mailx -s "Something happened!" you@abc.org
fi
done
Thursday, June 25, 2009
Logitech Quickcam Pro 9000 on ubuntu hardy - no go
On initial plugin:
and
If I launch cheese - system hangs completely.
According to http://linux-uvc.berlios.de/, linux 2.6.26 includes linux uvc driver natively.. but hardy is 2.6.24.
Downloaded the driver from http://linuxtv.org/hg/~pinchartl/uvcvideo/ (gz link) and then..
cheese shows no output
skype neither
dmesg now shows
skype reports
Aborting effort for now..
[ 102.851571] usb 3-1: new full speed USB device using uhci_hcd and address 2
[ 44.040462] usb 3-1: device descriptor read/64, error -71
[ 102.933128] usb 3-1: device descriptor read/64, error -71
[ 102.939599] usb 3-1: new full speed USB device using uhci_hcd and address 3
[ 102.945009] usb 3-1: device descriptor read/64, error -71
[ 102.970417] usb 3-1: device descriptor read/64, error -71
[ 102.983105] usb 3-1: new full speed USB device using uhci_hcd and address 4
[ 103.020497] usb 3-1: device not accepting address 4, error -71
[ 103.025529] usb 3-1: new full speed USB device using uhci_hcd and address 5
[ 103.060941] usb 3-1: device not accepting address 5, error -71
[ 116.499098] usb 5-5: new high speed USB device using ehci_hcd and address 5
[ 116.627482] usb 5-5: configuration #1 chosen from 1 choice
and
which according to http://www.quickcamteam.net/documentation/faq/how-many-versions-of-the-quickcam-pro-9000-are-there says its third generation with buggy firmware.
lsusb -d 046d:0990 -v | grep bcdDevice
bcdDevice 0.08
If I launch cheese - system hangs completely.
According to http://linux-uvc.berlios.de/, linux 2.6.26 includes linux uvc driver natively.. but hardy is 2.6.24.
Downloaded the driver from http://linuxtv.org/hg/~pinchartl/uvcvideo/ (gz link) and then..
tar zxvf uvcvideo-bff77ec33116.tar.gzdmesg now shows:
cd uvcvideo-bff77ec33116/
make # and go have a coffee
sudo make install
reboot
[ 105.937744] usb 5-5: new high speed USB device using ehci_hcd and address 3
[ 106.197507] usb 5-5: configuration #1 chosen from 1 choice
[ 107.127908] Linux video capture interface: v2.00
[ 107.135021] usbcore: registered new interface driver snd-usb-audio
[ 45.915452] uvcvideo: Found UVC 1.00 device(046d:0990)
[ 45.932166] input: UVC Camera (046d:0990) as /devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0/input/input10
[ 45.962220] usbcore: registered new interface driver uvcvideo
[ 45.962226] USB Video Class driver (v0.1.0)
cheese shows no output
skype neither
dmesg now shows
[ 177.592621] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 177.976920] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 178.401788] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 178.807251] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 179.193500] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 179.743456] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 180.154183] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 180.655020] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
skype reports
Skype V4L2: Could not find a suitable capture format
Skype V4L2: Could not find a suitable capture format
Aborting effort for now..
Subscribe to:
Posts (Atom)







