AllFilled Blog Just another WordPress weblog

16Jun/110

Submitted my first Ubuntu bug today

Posted by DM8Mydog

If you've read my 'Headless Ubuntu 11.04 problematic privileges – [Incl. Partial solution]' post, here's the followup...

I filed an Ubuntu bug report (My First!): https://bugs.launchpad.net/bugs/797960

polkit-agent-helper-1 prompts for authentication on the wrong DISPLAY

With a spark of intuition I connected a monitor on my ubuntu box , pulled a laptop in-front of it and connected remotely to see what happens.

Tada! The auth dialogue was there, just ... not on the laptop (VNC) screen, it was on the Server's screen!

11Jun/110

Get back a classic scrollbar in Ubuntu 11.04

Posted by DM8Mydog

One thing that annoys the hell out of me in Ubuntu is that weird scrollbar thing ... why they added this is beyond me, it's silly.

So I Googled, 'ubuntu scrollbar' and found that they call it an 'overlay scrolbar'. Google again with 'how to disable ubuntu overlay scrollbar' and tadaaa!

found this article!

Filed under: Uncategorized No Comments
10Jun/110

Headless Ubuntu 11.04 problematic privileges – [Incl. Partial solution]

Posted by DM8Mydog

When machine is headless, user is no longer privileged.

Setting up an Ubuntu headless server after a long while, and I'm having lots of problems that I do not remember existing in previous Ubuntu versions.

Some details:

  • I started with ubuntu-11.04-server-amd64.iso and then installed ubuntu-desktop on-top of it.
  • uname -a: Linux MiddleEarth 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
  • The hardware is Intel D920, 2GB Ram, gfx is some fan-less nvidia 6600, 3xGigabit, 1x100mbit, no monitor,keyboard,mouse attached.

Round 1

While I was doing the testing/setting up with a monitor attached, everything was peachy, both when sitting infront of that monitor and when VNCing in from my desktop machine (into vino).

Without a monitor though problems arise:

[Unsolved/Dropped]

The very first problem was vino being stubborn and not liking to load before/during GDM. But since this is a headless system, I dont really need it to start with X by default (ie change the init level) anyways, so that's a bit moot. However, I distinctly remember this being very easy to do in an older ubuntu version ( v9.04 I think ). And it worked fine; but not any more!? ... anyways I dropped that idea altogether.

[Solved]

Then it was Unity/effects messing VNC (Solved it by cheating, read here). Later I also switched to NXServer, which so far I am liking.

[Solved (read Round2)]

I originally switched to NXserver hoping that maybe the following problems are tightvnc or vino issues, but no such luck. (Correction: read round2)

When remoting in via VNC (or NXserver) my user account loses the ability to mount/unmount HDDs.

Unable to mount HDD

Unable to mount HDD

When remoting in via VNC (or NXserver) my user account cannot access some priviledged configuration options,

some examples:

  • cannot do anything (ie. 'add or 'advanced settings') in "System -> Administration -> Users and Groups".
  • cannot use 'unlock' in "System -> Administration -> Login Screen".
  • gparted fails to get any information about the filesystems.
  • etc. (various other admin/config dialogues don't properly work either)

I can only guess this has something to do with user privileges not being assigned properly when an actual physical monitor device is not connected.

The reason 'WHY' this happens in ubuntu 11.04, when it is headless, escapes me; I do not remember this behaviour in previous versions of ubuntu.

Do note that the HDD mounting problem is a non-issue for internal/static hdds (I just add them to fstab since they're static anyways). But really a big pain for removable usb media.

The rest of the problems, I have not figured out how to fix...

I know what you're thinking... log in to ssh, sudo su, and run vncserver under root entirely?

root is broken too!

root is broken too!

Surprise Surprise! root's gui is broken too: gparted fails to get info, users&groups is entirely grayed out (this is a different behaviour than my regular user). Weirdly enough the Login screen administration proggy seems to work fine.


Round 2

( NOTE: I do not know if this did or did not make a difference to the outcome. At some point between round 1 and round 2, I applied the edits mentioned in posts #21 and #24 in this thread )

The regular tightvnc/NXServer sessions have the same behaviour, BUT...

[Solution]

In the NXClient connection settings, when I choose the 'shadow' mode (shadow attaches you to the native display, ie. desktop shadowing)...

Everything works perfect inside this session!

One thing I noticed is that it immediately asks me for a keyring password... maybe the whole mess has something to do with the keyring system gnome uses?

But, if I connect with a regular (not shadow) NX connection, or a vnc it goes back to having the same problems.

 

 

So the gist of it is: any gui sessions not sitting ontop of the native display --or tricked into thinking they sit on the native display-- have faulty privileges.

 

Question: Any comments on a way to fix the problematic behavior for the VNC/non-shadow NX sessions?

 

P.S. There were a couple of days inbettween round1 and round2, hence why I don't know for sure if that xorg.conf VNC device edit or that nomodeset setting made a difference.

 

10Jun/110

Ubuntu 11.04 and VNC the hate-hate relationship.

Posted by DM8Mydog

A quick and dirty way to disable Unity

There is no love in Ubuntu 11.04 in regards to VNC. It's "Unity" desktop and other effects either completely break VNC or otherwise make it impossible to use.

On a desktop computer, where you get to use the GDM (login screen) you can choose a gnome session in that login screen; ie unity,unity-2d,gnome classic,gnome classic (No Effects).

Choosing the session on a headless machine (no physical monitor attached) can be a pain...

On a headless machine Unity/effects/etc are only getting in the way, ie breaking or slowing your VNC/RDP/NX/etc

You could change the default gnome session used by locating where that setting is and changing it ... Sorry, I have not found that (yet)

BUT... I cheated!!!

The default session file is /usr/share/gnome-session/sessions/ubuntu.session
The plain old classic gnome without effects session file is /usr/share/gnome-session/sessions/2d-gnome.session
so...

$ sudo su
$ cd /usr/share/gnome-session/sessions
$ mv ubuntu.session ___ubuntu.session
$ ln -s 2d-gnome.session ubuntu.session
$ ll
total 28
drwxr-xr-x 2 root root 4096 2011-06-09 00:14 ./
drwxr-xr-x 3 root root 4096 2011-05-31 00:34 ../
-rw-r--r-- 1 root root  202 2011-04-26 23:55 2d-gnome.session
-rw-r--r-- 1 root root  247 2011-02-24 13:37 2d-ubuntu.session
-rw-r--r-- 1 root root  303 2011-04-26 23:55 classic-gnome.session
-rw-r--r-- 1 root root  571 2011-04-26 23:55 gnome.session
-rw-r--r-- 1 root root  606 2011-04-26 23:55 ____ubuntu.session
lrwxrwxrwx 1 root root   16 2011-06-09 00:14 ubuntu.session -> 2d-gnome.session

It's quick, it's dirty, it does the job.

Any filename would do just so we can make a symlink for the default session's filename.

The proper way would be to change the config file above the session (ie the one that calls the session). If someone knows/can find the location of the config file that has the default session's filename in it please do share! :)

 

Coming up: More Ubuntu Headless craziness!

Tagged as: , , No Comments
2Jun/110

Pictures dump 2011-06

Posted by DM8Mydog

My desk's setup..

My desk's setup..

 

My tower: Thermaltake Kandalf LCS

My tower: Thermaltake Kandalf LCS

 

The LCS part of Thermaltake Kandalf LCS

The LCS part of Thermaltake Kandalf LCS

 

testing bro's mobo

testing bro's old mobo (it works!!)

 

bro's pc ATI control panel

bro's pc ATI control panel

 

4 Dead HDDs

4 Dead HDDs (400GB, 1TB, 750GB, 60GB)
High tech paperweights!!

 

31May/110

Lovely….

Posted by admin

hdd failure

hdd failure

so apparently an HDD on my windows machine got jealous of that 400GB HDD croaking yesterday on that linux machine...

FFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU!!!

ok I'm done.

P.S. it's 1TB. and it has <100gb free on it. it showed up on a reboot immediately afterwards; hope I can manage to get those files out... before it really dies.

EDIT: nope, windows fails to do much with it, linux is having a moderate success... doh :(

31May/110

In the process of turning my old home rig into a server box

Posted by DM8Mydog

Ubuntu 11.04

System info: Pentium D 920, 2GB (4x512MB DDR2@667), mobo has 6xSATA2, additional PCI controller has 4xSATA1 and some ancient nvidia gfx (nv6600?),

Out with the old--in with the new! the old ubuntu (v9.x iirc) I had on it was begining to be ..leaky anyways, something was messing with Xorg and making it use 100%cpu.

I'm going to be using it as a file server box primarily and maybe as a domain A.D. (via samba?) -- if I can figure it out and if I can get used to having my local OS being completely taken over by a remote machine like that ;) .

deadmeat@MiddleEarth:~$ df -h -T
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/md125    ext4    359G  3.7G  337G   2% /
none      devtmpfs    996M  816K  996M   1% /dev
none         tmpfs   1004M  260K 1004M   1% /dev/shm
none         tmpfs   1004M  464K 1004M   1% /var/run
none         tmpfs   1004M     0 1004M   0% /var/lock
/dev/md124    ext4    496M   33M  438M   7% /boot
/dev/md127    ext3    917G  200M  871G   1% /media/1TB_RAID1_ext3
/dev/sdi5  fuseblk    699G  616G   84G  89% /media/750GB SMG 001
/dev/sdh5     ext4    688G  252G  402G  39% /media/750GB SGT
/dev/sdd5     ext4    1.4T  170G  1.2T  13% /media/1.5TB1
/dev/sdf5     ext3    1.4T  366G  940G  29% /media/1.5tb2

Still a mess, cause I'm still not done moving files around (damn terrabytes! ;) )

This is hardware I had -- not brand new -- with all that can translate into. It was running as my main rig at home for ~3 years or so. The 1.5TB drives were probably recent additions, but everything else is quite old.

The OS sits on 2x400GB drives in RAID1 with a bit of ... extra paranoia: an additional 400GB drive as hot spare set into the raid.

Screenshot of the OS RAID1 array (with the hot spare)

Screenshot of the OS RAID1 array (with the hot spare)

It's actually split to 3 partitions: one for /boot, one for / and one for the swap (raided swap!)

Built it by: creating one 512MB primary partition, then an extended partition, on the rest of the space, which contains an 8192MB partition inside the extended (at the end of it) and a logical partition for whatever was left in the middle. Rinse-repeat for the other drive in the array AND the spare.
When done through them over to mdadm:

sudo mdadm --create --verbose /dev/md0 --auto=md --raid-devices=2 \
  --spare-devices=1 --level=1 --name=BOOT_RAID1 /dev/sda1 /dev/sdb1 /dev/sdc1
sudo mdadm --create --verbose /dev/md1 --auto=md --raid-devices=2 \
  --spare-devices=1 --level=1 --name=OSROOT_RAID1 /dev/sda5 /dev/sdb5 /dev/sdc5
sudo mdadm --create --verbose /dev/md2 --auto=md --raid-devices=2 \
  --spare-devices=1 --level=1 --name=SWAP_RAID1 /dev/sda6 /dev/sdb6 /dev/sdc6

one thing to concider is that during OS setup ubuntu saw the RAIDed swap (/dev/md2) and the 3 swap partitions (/dev/sda6 /dev/sdb6 /dev/sdc6) and automatically selected ALL of them to be used as swap space for the installed OS. This would make no sense since it'd be double-selecting the same space, so I had to adjust it to only use the raided swap space.

That 750GB showing as fuseblk is still NTFS, haven't moved the files off of it yet.

/dev/md127 is 2x1TB raid1

The other two pairs (the 2x750GB and 2x1.5TB) aren't RAIDed yet. I'm working on it.

I'm looking into maybe figuring out a way to make those all into one raid5 array -or equivelant with lvm?- somehow (would take some tinkering) by making those two 750GBs act as one drive first, and then raid them with the rest; or some other weirder lvm setup perhaps.

The reason for the RAID setups is that this is going to be a file server for our ''not entirely unimportant'' files.. plus I'm going to try using it as an A.D. .. so those profile files are a tad valuable.

So, all the random tv/movies/warez those HDDs currently have will have to go find a new home -- but I'll probably keep my 'resources' (cliparts,brushes,styles, icons. etc... ) and some convenience items, ie OS/App isos, MAME collection ;) there, for now.

True story: omgwtf!

Those 3x400GB where up until a few hours ago 4x400GB! ...but ... one of them just died on me!

I had them set up as a RAID5 -- 4x400GB  -- ~1200GB for the '/' mount.

The interesting part is that when I was researching/setting that RAID5 up, google kept giving me search results from ubuntuforums, and elsewhere, where people kept insisting that you can't put the /boot mount point on a soft (mdadm) RAID5 in ubuntu...Well, that is apparently incorrect!

No idea why those guys kept insisting, it did not involve me doing anything special. The ubuntu-11.04-server-amd64.iso installer allowed me to use the raid5 as bootable with no complaints. GRUB worked and everything was fine; well until that 400GB hdd croaked on me. :(

Oh well, that's old hardware for ya, one more HDD for my collection of broken HDDs. I should open a museum!

Now I chose to use raid1+hot spare, only because... frankly I had never tried that before.

 

Syslog monitoring

Have you ever seen one of those flashy/pretty/omg-awesome/theme demonstration screenshots people take of their various Linux desktop setups?
Did you ever notice most of them have a tiny syslog window somewhere in the mix?

While I'm not aware of something like that out-of-the-box on ubuntu/debian, the reason for that is probably that it's very easy to make your own:

Screenshot how to make your own syslog viewer

Screenshot how to make your own syslog viewer

Open a terminal and go in the profiles.
Make a new profile, name it something like syslogviewer,
Look for something like 'run a custom command instead of my shell', enable it and add this cmd:

tail -f /var/log/syslog

Adjust the font size / colors / initial window dimensions for that profile and save it.
Now you can launch it with:

gnome-terminal --window-with-profile syslogviewer

You'd probably want to add a launcher for it on a menu or a panel.

 

More ubuntu craziness as I fight with samba to test A.D. later on perhaps.

 

29May/110

Messing around with a 3rd screen on my personal rig

Posted by DM8Mydog

Added a 3rd screen on my desk today



temporary.desk.2011-05-29

temporary.desk.2011-05-29

 

still a mess, need to move the UPS off the top of the desk cause it's now in the way.

 

Chronos USB2VGA-Jr adapter

The way I added the 3rd screen, for now, is by using a USB2VGA adapter.
I do *NOT* recommend those, the one I got is crappy ... Chronos USB2VGA-Jr, based around a MCT chip
I'm actually using the driver from MCT's site instead of the one on the product's CD, because the one on the CD is crap, but the MCT one is not perfect either...

device manager snapshot

device manager snapshot

Pros:

  • USB bus powered
  • It's cheap...
  • PC Tower stays as-is (ie no need to switch the mobo for an SLI one, no need to swap the gfx, or buy a bigger PSU etc etc)

Cons:

  • It breaks Aero!!!
    • Seriously WTF is up with that???
  • Most video player software will NOT work on that screen.
    • Don't work: VLC, mplayerC, wmp11 -- I am reffering to default settings that would otherwise work fine on your other screens.
    • Work: QuickTime player, flash videos from within browser windows (ie. youtube)
  • It's not a rock-solid device (<hint> unstable junk </hint>)

 

Better ways to do it would be:

  • Two regular PCI-E x16 gfx cards
    • But the mobo must have two PCI-E x16 slots (mine doesn't)
  • A mobo with internal graphics
    • So it would be a combo, INTGFX  (1 screen) + PCI-EGFX (2 screens)
  • A GFX card that actually supports 3 screens.
    • This is not always the case, even if the card has 3 or more connectors on it, ie HDMI + 2xDVI, in truth it might only allow 2 screens.
    • For instance, this one actually does allow 3 screens SAPHIRE HD5670 1G GDDR5 PCI-E HDMI/DVI-I/DP. one screen on the hdmi (you can convert that to DVI-D with a convertor or cable) one screen on the DVI-I (that can be D-SUB(analogue) if you need it to be) and one screen on the DisplayPort - probably with a converter (I've tested a DP-to-D-SUB converter, worked fine for 1280x1024)
  • The Classic/Old way that manufacturers and computer shops are for some reason phasing out. This option has traditionally always been available: Add an extra graphics card in a regular expansion slot on your motherboard. I am not talking about the ''graphics card'' slots, (which have been set aside just for gfx - AGP 1x-8x  and PCI-E 16x) . I am referring to regular plain OLD PCI slots, or the newer PCI-E x1 slots:
    • PCI-E x16 (2 screens) + PCI (OLD) 1 screen.
    • PCI-E x16 (2 screens) + PCI-E x1 (NOT x16!) 1 screen.

That last option would have been my top choice 10 years ago; However most stores don't even bother carrying such cards. and if they do they're some very very high end and pricey pieces, ie: nVidia Quadro based cards (or worse, Matrox ones!), nothing for the regular home/office user.

 

When I have 150-200euroes to spare I might look for a better solution, but for now I'm stuck with this P.O.S. :(

28Mar/100

toString.pm – Convert $foo to a string.

Posted by DM8Mydog

I normally have warnings enabled ("use warnings;") on my perl scripts.

When I was concatenating strings/vars/anything together, ie for debug msgs, I too often had to do this:

my $msg = 'blah blah $foo:[' . (defined $foo ? $foo : 'undef') . '] blah blah...';

So I decided to spend a few minutes to make something that would get rid of this for me.

my $msg = 'blah blah $foo:[' . string($foo) . '] blah blah...';

Call Context:

if &string is called in array context, it will return an array of stringified items of what it was fed.

my @vars = ($foo,$bar);
my @strings = string(@vars);

if &string is called in scalar context, it abides by the perl convection of only evaluating the last item in the ARG list it was given.

so:

my $blah =  string($foo,$bar);

is the same as doing:

my $blah = string($bar);

Behaviour:

When given undef, it will return the sting 'undef';
When given a ref of type: ARRAY,HASH,SCALAR or Regexp it will return a stingified Dump of it using Data::Dumper without indentation (all in one line).
It also replaces \r \n \t with space, and merges multiple spaces into one.

toString.pm exports nothing by default, so that you can use toString::string() when you have a colliding &string() function already in your namespace.
To export &string into your namespace use this:

use toString.pm 'string';

Download: toString

22Mar/100

tvrage.pl for Irssi

Posted by DM8Mydog

Here's a quick TVRage script I wrote for Irssi

the command is !tv <the.show's.name.here>

it doesn't do !tonight or !tomorrow like another well known tvrage script does though.

Download: TVRage.zip