To get dual-monitor remote desktop over VNC working withUbuntu, I had to install x11vnc. With the default VNC server, only half of my desktop would appear with the other half blacked out. Also, the whole two screen layout would not fit within my VNC client window.Ultimately this is the command I came up with the start the VNC server:
x11vnc -xinerama -xwarppointer -scale 3/4 -noxdamage -ncache 10
The first two arguments setup dual screen mode. The next one (-scale 3/4) scales the screen to 3/4 of it's original size (the scaling is done server-side). The -noxdamage argument prevented some annoying server errors that were appearing. And the -ncache 10 option enables client-side pixel caching, which speeds up things considerably.
References:
http://ubuntuforums.org/showthread.php?t=535574
http://ubuntuforums.org/archive/index.php/t-252888.html
https://help.ubuntu.com/community/VNC?action=show&redirect=VNCOverSSH
Life, the universe and everything. The state of the world, from the perspective of one in it.
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts
Thursday, 29 April 2010
Wednesday, 14 April 2010
ebay USB MIDI Interface on Ubuntu Linux (1a86:752d)
I recently bought a USB MIDI interface off ebay. It was just a generic, pretty cheap made-in-china kind of model, with a red, orange and green light. It lit up red when I plugged it into my (Linux) computer, but showed up in lsusb as "Unknown" device:
Being USB of course, there was some delay, and for some peculiar reason no keys below Middle C would work for me. But it works well on Sibelius!
root@theta:~# lsusbTurns out, even though it's listed as an unknown device, it still worked as a MIDI input. I just started up JACK Audio Server, Rosegarden, and ZynAddSubFx for an organ simulation. Then i plugged in the MIDI In and Out ports to my keyboard, hooked up the connections in JACK and it all worked!
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 003: ID 0461:0010 Primax Electronics, Ltd
Bus 005 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 046d:09b8 Logitech, Inc.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 004: ID 1a86:752d Unknown
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Being USB of course, there was some delay, and for some peculiar reason no keys below Middle C would work for me. But it works well on Sibelius!
Wednesday, 7 April 2010
openSuSE 11.2 as Active Directory PDC?
I'm looking at reinstalling my server (currently Ubuntu 8.04 LTS) with openSuSE 11.2. Does anyone know of some way that I can configure openSuSE as an Active Directory domain controller? I would like to configure Samba and LDAP with a GUI preferably, and automatically transfer any modifications I make to the client computers. I also need offline authentication.
I was looking at Novell eDirectory, and it appears to be exactly what I am looking for. Is there a tutorial available for how to setup eDirectory on openSuSE? By default it runs on Open Enterprise Server only.
I was looking at Novell eDirectory, and it appears to be exactly what I am looking for. Is there a tutorial available for how to setup eDirectory on openSuSE? By default it runs on Open Enterprise Server only.
Tuesday, 23 March 2010
[FIX] Breezy apt-get update returns 404 not found
Today I logged into an old Ubuntu machine, and tried to install a program. However, running apt-get update came up with a whole bunch of "404 file not found" errors, although it was using the standard ubuntu repositories.
Turns out some time ago, the Ubuntu project took down the Breezy Badger repositories. After all, this is an old project. Thankfully there is a way you can update your breezy machines even without this repository. According to this thread, just change the lines "archive.ubuntu.com ..." to "old-releases.ubuntu.com ..." in your /etc/apt/sources.list or using the GUI in Synaptic/Adept.
More info here.
Turns out some time ago, the Ubuntu project took down the Breezy Badger repositories. After all, this is an old project. Thankfully there is a way you can update your breezy machines even without this repository. According to this thread, just change the lines "archive.ubuntu.com ..." to "old-releases.ubuntu.com ..." in your /etc/apt/sources.list or using the GUI in Synaptic/Adept.
More info here.
Thursday, 4 March 2010
Mounting Filesystems by UUID - Ubuntu
Ubuntu 9.10 automatically mounts hard drives by UUID when it's installed. This means that if you insert a new hard drive, which changes all the /dev/sdxx numbers, your system will still function normally. Linux by examples has a good tutorial on common fstab commands for uuid.
To find all UUIDs:
To check the UUID for a known device:
or this:
To find all UUIDs:
ls -l /dev/disk/by-uuid/ To check the UUID for a known device:
sudo vol_id /dev/sda1or this:
blkid /dev/sda1
Wednesday, 17 February 2010
Ubuntu: How to automatically lock & unlock screen with Android phone
Evan Boldt has a useful script: Unlock your screen with ANY USB device. I've modified it slightly to work with my HTC Magic / Google Android device. A script is run every minute, which polls the system log every 2 seconds to determine when the USB device is plugged in in or unplugged. It then forwards the relevant command to GNOME Screensaver. The script is posted below for your interest.
Firstly, run lsusb and locate your phone. In my case, it was the highlighted line:
Copy everything from ID to the end of the line (i.e. "
Paste this file into your /home/username/bin folder:
Now you simply add a line to your crontab to run this script every minute:
add the line:
That's it! Now, when you unplug your Android phone it should lock the screen. When you plug in again, the screen unlocks. Easy!
More information:
http://echowarp.neomenlo.org/2009/scripts/unlock-your-screen-with-any-usb-device
https://help.ubuntu.com/community/UsbDriveDoSomethingHowto
Firstly, run lsusb and locate your phone. In my case, it was the highlighted line:
Bus 002 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 045e:0752 Microsoft Corp.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 045e:0039 Microsoft Corp. IntelliMouse Optical
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 0bb4:0c02 High Tech Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Copy everything from ID to the end of the line (i.e. "
ID 0bb4:0c02 High Tech Computer Corp.") This will be the ID used to determine when your device is plugged in & unplugged.Paste this file into your /home/username/bin folder:
#!/bin/bash
#Replace with the ID of your USB device
id="ID 0bb4:0c02 High Tech Computer Corp." # Example: id="ID 05ac:1292 Apple, Inc"
#runs every 2 seconds
for ((i=0; i<=30; i++))
do
if [ -z "`lsusb | grep "$id"`" ]
then
echo "Device is NOT plugged in"
if [ -n "`DISPLAY=:0 gnome-screensaver-command --query | grep "is active"`" ]
then
if [ -e /tmp/autoUnlock.lock ]
then
#stop locking the screen
rm /tmp/autoUnlock.lock
fi
elif [ -e /tmp/autoUnlock.lock ]
then
DISPLAY=:0 notify-send -t 5000 –icon=dialog-info “Device Disconnected” “Bye!”
#lock the desktop
DISPLAY=:0 gnome-screensaver-command --lock
rm /tmp/autoUnlock.lock
fi
else
echo "Android IS plugged in"
if [ ! -e /tmp/autoUnlock.lock ]
then
DISPLAY=:0 gnome-screensaver-command --deactivate
DISPLAY=:0 notify-send -t 5000 --icon=dialog-info "Device Connected" "Welcome Back!"
touch /tmp/autoUnlock.lock
##Uncomment the 3 following lines if you would like your computer to remind you if you lock your screen without disconnecting the device
#echo "Don't forget your device!" > /tmp/androidReminder
#DISPLAY=:0 festival --tts /tmp/androidReminder
#rm /tmp/androidReminder
fi
fi
sleep 2
done
Now you simply add a line to your crontab to run this script every minute:
crontab -e
add the line:
* * * * * bash /home/username/bin/autoUnlock & >/dev/null 2>&1
That's it! Now, when you unplug your Android phone it should lock the screen. When you plug in again, the screen unlocks. Easy!
More information:
http://echowarp.neomenlo.org/2009/scripts/unlock-your-screen-with-any-usb-device
https://help.ubuntu.com/community/UsbDriveDoSomethingHowto
ERROR: Creating templock /var/lock/mrtg/.....: No such file or directory [How to Fix]
I have been running MRTG on Ubuntu server 8.10, and recently it stopped running for no obvious reason. Examining the MRTG log, I found many lines like this:
Turns out there is a bug with running MRTG on Ubuntu/Debian which removes the MRTG lock file on every reboot. To fix this, create a new text file (as root) in
This will create a new
More information:
http://www.enterprisenetworkingplanet.com/netos/article.php/3663941
http://ubuntuforums.org/showthread.php?t=249393
http://www.directadmin.com/forum/showthread.php?t=7843&page=3
http://www.google.com/search?hl=en&q=ERROR%3A+Creating+templock%3A+No+such+file+or+directory&aq=f&aqi=&oq=
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5012: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5020: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5041: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5046: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5074: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5100: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5112: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5121: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5129: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5148: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5173: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_5905: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6004: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6023: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6049: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6065: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6092: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6191: No such file or directory at /usr/bin/mrtg line 1645.
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg.cfg_l_6247: No such file or directory at /usr/bin/mrtg line 1645.
Turns out there is a bug with running MRTG on Ubuntu/Debian which removes the MRTG lock file on every reboot. To fix this, create a new text file (as root) in
/etc/rcS.d/ called "S91mrtg-lock-dir.sh" and paste the following code into it:
#!/bin/sh
# Create the lock directory for MRTG
# This is needed due to a bug for Ubuntu/Debian which erases this directory at shutdown
echo "Creating MRTG lock directory...."
mkdir -m 0755 /var/lock/mrtg
This will create a new
/var/lock/mrtg directory every time the computer starts up. You may need to reboot to enable this, or simply run the command mkdir -m 0755 /var/lock/mrtg.More information:
http://www.enterprisenetworkingplanet.com/netos/article.php/3663941
http://ubuntuforums.org/showthread.php?t=249393
http://www.directadmin.com/forum/showthread.php?t=7843&page=3
http://www.google.com/search?hl=en&q=ERROR%3A+Creating+templock%3A+No+such+file+or+directory&aq=f&aqi=&oq=
Sunday, 7 February 2010
VFS: busy inodes on changed media or resized disk sr0
(Ubuntu 9.10 Karmic) If you get a lot of error messages like this:
It means your cdrom drive has been ejected without unmounting. Check this by typing this in your terminal:
If this shows a line like:
then your cdrom has been ejected. Try typing:
This should unmount the cdrom. If it doesn't work, maybe try:
Feb 7 14:38:58 theta kernel: [564762.288036] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:38:58 theta kernel: [564762.297408] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:38:59 theta kernel: [564763.286910] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:00 theta kernel: [564764.288880] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:00 theta kernel: [564764.298198] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:01 theta kernel: [564765.288943] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:02 theta kernel: [564766.287691] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:02 theta kernel: [564766.297007] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:03 theta kernel: [564767.339877] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:04 theta kernel: [564768.288076] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:04 theta kernel: [564768.297457] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:05 theta kernel: [564769.288688] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:06 theta kernel: [564770.292023] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:06 theta kernel: [564770.301389] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:07 theta kernel: [564771.316633] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:08 theta kernel: [564772.287440] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:08 theta kernel: [564772.296807] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:09 theta kernel: [564773.288408] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:10 theta kernel: [564774.288406] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:10 theta kernel: [564774.297774] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:11 theta kernel: [564775.286283] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:12 theta kernel: [564776.288231] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:12 theta kernel: [564776.297599] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:13 theta kernel: [564777.294194] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:14 theta kernel: [564778.288487] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:14 theta kernel: [564778.297790] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:15 theta kernel: [564779.287965] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:16 theta kernel: [564780.288390] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:16 theta kernel: [564780.297835] VFS: busy inodes on changed media or resized disk sr0
Feb 7 14:39:17 theta kernel: [564781.288703] VFS: busy inodes on changed media or resized disk sr0
It means your cdrom drive has been ejected without unmounting. Check this by typing this in your terminal:
mountIf this shows a line like:
/dev/sr0 on /media/cdrom1 type iso9660 (ro,nosuid,nodev,utf8)then your cdrom has been ejected. Try typing:
sudo umount /dev/sr0This should unmount the cdrom. If it doesn't work, maybe try:
sudo umount -f /dev/sr0
Monday, 1 February 2010
How to setup Linux (Ubuntu) Active Directory Authentication with Cached Credentials (Kerberos)
Running Linux, I'm using Kerberos & Samba to authenticate myself using Microsoft Windows Active Directory credentials from our domain controller. I used the guide for Ubuntu to get this setup. However, this would not allow me to login to my computer using AD credentials unless I was connected to the network (and it could access the domain controller). This is how I enabled "credential caching" for offline kerberos / Active Directory authentication on Ubuntu Linux.
I used two tutorials - Ubuntu Community Howto, and Cat in the Red Hat. Basically, since I already had Kerberos authentication working, I just installed the necessary packages:
and then edited my /etc/pam.d/common-auth file as per Cat in the Red Hat's instructions.
Listed here is the entire contents of my /etc/pam.d/common-auth file (this allows me to authenticate using first AD credentials, then Unix accounts, then cached credentials):
Some of the errors I encountered:
Firstly, caching will not work if you have a line like the following:
This basically skips everything else when a successful kerberos authentication is made. I just commented this line out, and it worked fine.
If you receive an error such as "
If you're interested, there's also quite a nice GUI for Active Directory integration at Likewise. I haven't used it, but looks like an easy way to setup AD authentication from Ubuntu without editing heaps of config files.
I used two tutorials - Ubuntu Community Howto, and Cat in the Red Hat. Basically, since I already had Kerberos authentication working, I just installed the necessary packages:
sudo apt-get install nss-updatedb libnss-db libpam-ccreds
and then edited my /etc/pam.d/common-auth file as per Cat in the Red Hat's instructions.
Listed here is the entire contents of my /etc/pam.d/common-auth file (this allows me to authenticate using first AD credentials, then Unix accounts, then cached credentials):
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth [default=ignore success=1 service_err=reset] pam_krb5.so use_first_pass
auth [default=die success=done] pam_ccreds.so action=validate use_first_pass
auth sufficient pam_ccreds.so action=store use_first_pass
auth required pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth required pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config
Some of the errors I encountered:
Firstly, caching will not work if you have a line like the following:
#Windows Domain Auth
#auth sufficient pam_winbind.so krb5_auth krb5_ccache_type=FILE
This basically skips everything else when a successful kerberos authentication is made. I just commented this line out, and it worked fine.
If you receive an error such as "
su: Error in service module" when trying to login, it may be that your file is misconfigured. Check whether /var/cache/.security.db is being created or updated - if it isn't, then most likely PAM isn't reaching the line where pam_ccreds.so is referenced. Check that you don't have any auth sufficient lines where they shouldn't be.If you're interested, there's also quite a nice GUI for Active Directory integration at Likewise. I haven't used it, but looks like an easy way to setup AD authentication from Ubuntu without editing heaps of config files.
Thursday, 28 January 2010
How to update CyanogenMod on HTC Magic 32A [Ubuntu]
I'm running CyanogenMod on my HTC Magic, and Ubuntu 9.10 (Karmic) on my laptop computer. Most of the upgrade guides & automated tools for upgrading CyanogenMod (i.e. CMUpdater) are based on the 32B kernel. This is a guide to upgrading CyanogenMod with a HTC Magic 32A kernel. Most of the instructions are taken from the CyanogenMod wiki.
Ok, so what if you don't have an option to apply this zip in the recovery? If your phone only gives you the option to "apply update.zip" then you don't have the fancy recovery ROM. Download it from here (scroll down and choose the "H" version), and get the fastboot binary from here. Copy both into your android sdk "tools" directory.
Now, power down your phone, plug it into your computer via USB and press the Back and Power buttons at the same time. This should bring you to the fastboot screen. On your computer, cd into the android sdk tools directory, and type "fastboot boot ./recovery-RA-sapphire-vX.XX.zip". This will reboot the phone into the fancified recovery screen, which should let you update to any chosen zip file.
Oh, and note that this will not wipe your data!!! If you perform these steps completely and nothing goes wrong, all your apps and preferences will remain as they were. Of course, I can't guarantee anything. =) The only time you would wipe your phone is if you applied a full firmware upgrade (DRC83 in the filename, usually.) If you're unsure though, just leave a comment & I'll try to help! Or you could checkout the forums associated with some of the links above.
- Download the latest CyanogenMod (Current Stable Version) from this site.
- Download the latest EBI1/32A Kernel from the same page.
- Copy both .zip files to your SD and reboot in Recovery Mode (press Home+Power at the same time or fastboot into your recovery)
- Apply Zip: update-cm-xxxx-signed.zip
- Apply Kernel Port Zip: rad-4.xxxx.zip or bc-4.xxxx.zip (depends on who released the latest port: rad - Radix999,bc - bcrook )
- Reboot
- Wait. For a long time. =) Seriously, this will take ages to boot after an upgrade.
Ok, so what if you don't have an option to apply this zip in the recovery? If your phone only gives you the option to "apply update.zip" then you don't have the fancy recovery ROM. Download it from here (scroll down and choose the "H" version), and get the fastboot binary from here. Copy both into your android sdk "tools" directory.
Now, power down your phone, plug it into your computer via USB and press the Back and Power buttons at the same time. This should bring you to the fastboot screen. On your computer, cd into the android sdk tools directory, and type "fastboot boot ./recovery-RA-sapphire-vX.XX.zip". This will reboot the phone into the fancified recovery screen, which should let you update to any chosen zip file.
Oh, and note that this will not wipe your data!!! If you perform these steps completely and nothing goes wrong, all your apps and preferences will remain as they were. Of course, I can't guarantee anything. =) The only time you would wipe your phone is if you applied a full firmware upgrade (DRC83 in the filename, usually.) If you're unsure though, just leave a comment & I'll try to help! Or you could checkout the forums associated with some of the links above.
Sunday, 3 January 2010
Fix: Firefox 3 runs slowly keeps pausing and not responding on Ubuntu 9.10 Dual core
When I installed Ubuntu 9.10 "Karmic" on my new HP Dual-core computer, I found that Firefox was having a lot of issues. It would startup alright, and load pages pretty fast. But mainly whenever I tried to open a new tab, or had a lot of tabs open, it would randomly stop responding for a few seconds at a time. Since I have compiz enabled, Firefox would "grey out" and stop responding to mouse clicks. CPU usage never exceeded 50% of both cores though.
I trued using the CPU Frequency Scaler applet on the panel to increase the CPU speed with no effect. Also, reducing the threshold at which the CPU frequency is raised had no effect either. It turns out that Firefox just doesn't like running across multiple CPUs for some reason. The solution was to restrict Firefox to run on a single core.
This can be accomplished using the linux utility "taskset". The command I used is shown below (run as root):
An explanation:
This command has to be run every time Firefox starts. I'm looking for a way to change this automatically when Firefox is run - perhaps by changing the menu entry? Any suggestions are welcome!
I trued using the CPU Frequency Scaler applet on the panel to increase the CPU speed with no effect. Also, reducing the threshold at which the CPU frequency is raised had no effect either. It turns out that Firefox just doesn't like running across multiple CPUs for some reason. The solution was to restrict Firefox to run on a single core.
This can be accomplished using the linux utility "taskset". The command I used is shown below (run as root):
taskset -c -p 1 `pidof firefox`An explanation:
- The -c says to use a zero-based number to identify cores (Core 1 is "0", Core 2 is "1", etc). The default is to use a bitmask (more advanced).
- The -p says to reuse the existing pid, and not start a new task.
- Then we specify the core (Core 2 in this case, we could separate them with commas such as "0,1" if we wanted both cores to be used).
- Then we have another command, between backticks (` not ') that finds us the pid (Process ID) of the running Firefox.
This command has to be run every time Firefox starts. I'm looking for a way to change this automatically when Firefox is run - perhaps by changing the menu entry? Any suggestions are welcome!
Sunday, 20 December 2009
Suspend / Hibernate fails & doesn't work on HP dv7t-1000 CTO Pavilion Laptop running Ubuntu 9.10 Karmic
I recently bought a new HP Pavilion (dv7t-100 CTO) laptop, and installed Ubuntu Karmic 9.10 on it immediately. Everything seemed to work perfectly out of the box, including the function keys. Only problem is, Suspend and Hibernate definitely did not work. Any attempt to suspend or hibernate would basically corrupt the hard drive, and on the next boot (after a manual fsck), /home was wiped.
The solution was simple. No SMART hard drive tests (incidentally, a short SMART scan said the drives were OK). No drivers or kernel modules in Ubuntu. Simply a BIOS upgrade.
I simply had to download the BIOS update from the HP website, copy them to a USB drive, and boot into Windows to install the update. On next reboot, suspend and hibernate worked perfectly, and no more corrupted hard drives!
The solution was simple. No SMART hard drive tests (incidentally, a short SMART scan said the drives were OK). No drivers or kernel modules in Ubuntu. Simply a BIOS upgrade.
I simply had to download the BIOS update from the HP website, copy them to a USB drive, and boot into Windows to install the update. On next reboot, suspend and hibernate worked perfectly, and no more corrupted hard drives!
Friday, 18 December 2009
Installing Android Devloper Tools on Eclipse fails - Ubuntu Karmic 9.10
I followed these instructions to install the Eclipse Android Developer Plugins using Eclipse 3.5.1 and the default Ubuntu Karmic install. However I was presented with the following error message when clicking "Next":
For some reason ubuntu doesn't include the standard update repository for Eclipse by default. To fix this:
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404)
Missing requirement: Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404) requires 'org.eclipse.wst.xml.ui 0.0.0' but it could not be foundFor some reason ubuntu doesn't include the standard update repository for Eclipse by default. To fix this:
- Go to "Help/Install New Software..."
- Add http://download.eclipse.org/releases/galileo/ to the update sites list (strange it's not installed by default on ubuntu)
- From there, install WST (use the filter box to find the package)
- Restart eclipse
- Go back to "Help/Install New Software..." and install the Android ADT as explained on the android website.
Wednesday, 9 December 2009
Install Ubuntu from Alternate ISO Image and USB Drive (Karmic 9.10)
I downloaded the Ubuntu 9.10 (Karmic) alternate install CD. At first I thought there would be no way to run a clean install from this, but I discovered a simple way, which doesn't even involve burning to CD. This method is designed to be run from another linux system.
Source: https://help.ubuntu.com/community/Installation/FromUSBStick
- Download the alternate install cd image
- Find a usb thumb drive with at least 1GB free (may need more, up to 2GB)
- Download usb-creator, and run it (usb-creator-gtk or usb-creator-kde on Kubuntu)
- In the top box, choose your alternate ISO image. Plug in your usb drive and it should appear in the lower section of the window. Choose the drive (for example, /dev/sdb1) and choose "Discarded on Shutdown".
- Click "Make Startup Disk"
Source: https://help.ubuntu.com/community/Installation/FromUSBStick
Saturday, 28 November 2009
How to Convert MIDI to Mp3 using Timitidy and FFMPEG
Command line switch for outputting WAV file from timidity is -Ow.
So:
timidity -Ow ./file-to-play.midi
will generate a WAV file named ./file-to-play.wav
To convert this to mp3, use FFMPEG:
ffmpeg -i ./file-to-play.wav ./file-to-play.mp3
That's it! You will now have an mp3 file ./file-to-play.mp3
So:
timidity -Ow ./file-to-play.midi
will generate a WAV file named ./file-to-play.wav
To convert this to mp3, use FFMPEG:
ffmpeg -i ./file-to-play.wav ./file-to-play.mp3
That's it! You will now have an mp3 file ./file-to-play.mp3
Tuesday, 10 November 2009
Taskbar across dual monitors in Ubuntu linux
Right click panel, click "New Panel"
Right click the new panel, choose "Properties", and uncheck "Expand"
You should be able to drag it to the other monitor.
Open the panel's properties, and check "Expand" again. You may also have to choose to place it on the bottom edge of the screen.
Right click the new blank panel, and click "Add to Panel"
Choose "Window List" and click "Add". Your programs will show up in a list on the screen they are visible on.
Source: http://www.lloydleung.com/2006/10/14/gnome-multiple-monitor-taskbar-window-listing/
Right click the new panel, choose "Properties", and uncheck "Expand"
You should be able to drag it to the other monitor.
Open the panel's properties, and check "Expand" again. You may also have to choose to place it on the bottom edge of the screen.
Right click the new blank panel, and click "Add to Panel"
Choose "Window List" and click "Add". Your programs will show up in a list on the screen they are visible on.
Source: http://www.lloydleung.com/2006/10/14/gnome-multiple-monitor-taskbar-window-listing/
Friday, 6 November 2009
Add a directory to PATH in Ubuntu / Unix
To add a directory (in this case
To view the new PATH variable:
System PATH environment variables are stored in
/app1) to your path run the following command:export PATH=$PATH:/app1To view the new PATH variable:
echo $PATHSystem PATH environment variables are stored in
/etc/profile.
Tuesday, 27 October 2009
Ubuntu 9.04 Jaunty Ctrl+Alt+F1 Show Blank Screen
I was trying to change to a virtual terminal, but all I got was a black screen. I am using the latest Nvidia graphics drivers (proprietary).
To fix, I had to run the following command:
Then I was able to change to different tty virtual terminals using the keyboard shortcut. Ctrl+Alt+F7 to get back to graphical interface.
Source: http://ubuntuforums.org/showthread.php?t=679861
To fix, I had to run the following command:
sudo modprobe vga16fb sudo modprobe fbcon
Then I was able to change to different tty virtual terminals using the keyboard shortcut. Ctrl+Alt+F7 to get back to graphical interface.
Source: http://ubuntuforums.org/showthread.php?t=679861
Wednesday, 21 October 2009
How to Mount Samba Share at Boot / Startup Ubuntu 9.04 Jaunty
To mount a Samba share to be mounted when a Linux system comes up after reboot edit the /etc/fstab file and put entry as follows for your Windows/Samba share:
//ntserver/share /mnt/samba smbfs username=username,password=password 0 0
For example, if you want to mount a share called //ntserver/docs then you need to write the following entry in your /etc/fstab file:
Where,
In this case, smbfs might not be installed. For ubuntu, run:
sudo apt-get install smbfs
and then try mounting again.
Source: http://www.cyberciti.biz/faq/configure-a-system-to-automount-a-samba-share-with-etcfstab/
//ntserver/share /mnt/samba smbfs username=username,password=password 0 0
For example, if you want to mount a share called //ntserver/docs then you need to write the following entry in your /etc/fstab file:
//ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0Where,
- //ntserver/docs: Windows 2003/NT/Samba share name
- /mnt/samba: Local mount point (you may need to create this directory first)
- smbfs: File system type (samba file system)
- username=docsadm,password=D1Y4x9sw: Share username and password
$sudo mount /shared
mount: wrong fs type, bad option, bad superblock on //beta/shared,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
In this case, smbfs might not be installed. For ubuntu, run:
sudo apt-get install smbfs
and then try mounting again.
Source: http://www.cyberciti.biz/faq/configure-a-system-to-automount-a-samba-share-with-etcfstab/
Friday, 19 October 2007
Ubuntu 7.10 released!

It's here! Today Canonical officially announced the release of Ubuntu 7.10, aka "Gutsy Gibbon". This release incorporates new features from the past six months, including the latest release of GNOME and a new Deskbar desktop search feature. Ubuntu 7.10 is easier to use than ever, with automatic printer detection and fast user switching. The fast user switching is absolutely fabulous compared with Windows Vista - on my fast Vista laptop it takes over 1 minute to switch users, even with both already logged in!
Along with the release of Ubuntu, Kubuntu 7.10 has also been announced. Although it does not include KDE4 (as the release schedule has been delayed to December), the latest KDE4 Beta 3 is available in the Kubuntu Universe repositories.
I can't wait to get my hands on a copy of this latest release, but unfortunately my internet has slowed to dialup speed and the CDs will take a few weeks to ship, so I'll have to wait a fair while. But I'm sure it will be worth the wait.
Subscribe to:
Posts (Atom)
