Friday, November 28, 2008

Nvidia controls aren't in the GUI menus

My computer at home has an Nvidia graphics card, and it's running Ubuntu 8.10 at the moment. We have the living room set up as a combo family room/dining room/play space/study/office with an open layout and furniture sort of compartmentalizing the areas for each usage. We do not have cable TV, but we do have a nice TV/computer monitor that we watch movies and YouTube videos on. We pipe in all video content from the computer, whether it's from a DVD or from the Net. In order to make that work, we have the TV monitor set up as a secondary monitor plugged into the video card.

The problem: There was no GUI menu item for the Nvidia driver settings. The display settings that System->Preferences->ScreenResolution gives aren't the right thing at all.

The solution: You *may* have a link in System->Administration for Nvidia X-Server settings. If so, that's what you want. If not, open up a terminal window and type

gksudo nvidia-settings


It will ask you for your password, and then you can set up the secondary monitor as you like.

If you want to make that a selection in the System->Administration menu, right click on the word "System" in the top panel, then choose "edit menus". From there you can add a menu item for the above command.

Thursday, November 20, 2008

Bash Readline Commands

One of the cool things about most versions of the Linux command line is that you get a built in text editor to allow you to move around and edit your line easily. I generally use the Bash shell, and that comes with Readline. I know a few commands by heart and use them constantly, but there are more that never quite stick in my head. So, I figured I'd write about them here so they'd be easy to find and, possibly, pressed a little more firmly into my gray matter by virtue of having written them down.

Ctrl-e Go to the end of the line
Ctrl-a Go to the start of the line
Alt-f Go forward one word (actually Meta-f, but Meta is usually Alt)
Alt-b Go backward one word


Ctrl-k Kill the text from the current cursor point to the end of the line
Alt-d Kill the text from the current cursor to the end of the word
Alt-DEL Kill the text from the current cursor to the start of the word
Ctrl-w Kill the text from the current cursor to the previous white space
Alt-DEL and Ctrl-w are different because the "word boundaries" are different. Alt-DEL will stop at punctuation and other non-word characters. Ctrl-w does not.
Ctrl-y Yank (paste) the most recently killed text into place at the current cursor


Ctrl-l Clear the screen, putting the current line at the top

Sunday, October 19, 2008

Wireless connection from the command line

If ever you find yourself stuck with a *Nix box that won't boot into any kind of comfy graphical interface, and you need to connect to a wireless internet connection so that you can look stuff up and maybe solve your problem, here's a helpful tip:

There is a wireless networking utility very much like ifconfig called iwconfig. When you have a chance (and preferably before you really need it) check out the man page for it. Here are some quick and dirty instructions, in case you are desperate right now.

To find out what wireless networks are available to you, type
iwconfig wlan0 scan (see comments)
iwlist wlan0 scan

To attach to an open, non-encrypted network, type
iwconfig wlan0 essid netname
where netname is the essid of the network you want to connect to.

If you only have encrypted networks available, you might be in a bit more trouble. I haven't actually managed to get that working at all yet, though theoretically, it should work something like this:
iwconfig wlan0 key s:password
iwconfig wlan0 essid netname

where password is your password and netname is the essid of the network you want. The s: means that the password is in string format. If you know the hex version of your password, then instead of saying s:password you'd just type in the hex of the password like this:
iwconfig wlan0 key 0123-4567-89

Good luck getting your GUI fixed!

Sunday, October 12, 2008

Stealing from Ubuntu to pay Midinux

I'm busy trying to get an application to work on Midinux MID devices. There's a problem, though, because a chunk of libraries that I need are not available in Midinux for some reason. So, I'm snagging the libraries I need from the Ubuntu os I'm running on my desktop and converting them to run on the MIDs with Midinux. I can do this because, for reasons I don't understand at all, Midinux is compiled as an i386 system even though it's sitting on a Mobile Internet Device with an Atom CPU (that's lpia architecture, in case you didn't know).

You can find lots of debs (those that you have installed on your Ubuntu desktop, that is) in /var/cache/apt/archives/ . The advantage of that is that you don't have to go hunting very far. If you can't find the deb that you are looking for there, try searching http://packages.ubuntu.com

Once you have the packages that you need, go ahead and change the debs into rpms using Alien. The command looks like this:
> alien --to-rpm the-package.whatever.deb

With that done, stick the package someplace where you can download it to your Midinux device, then pop over into the X-Terminal and into the directory where the rpm you need to install is sitting. Install the rpm with:
> rpm --install the-package-whatever.rpm

And there you go!

Tuesday, October 7, 2008

Ahhhh... This place has PACKAGES

Having gotten my blasted scratchbox working, I didn't seem to be any closer to compiling anything. I needed several packages and they weren't in the default packages available in the initial set up. Why, o why don't they give you any useful repositories right from the start in your scratchbox setup? I mean, COMEON!

So, the good news is that Hacking the N810 pointed me in the direction of http://gronmayer.com/it which is now officially my second savior of the day (right after Gnuton).

At Gronmayer.com I was able to search for the packages I was looking for, find out what repositories they live in and set up my /etc/apt/sources.list in the scratchbox accordingly.

Just remember, you have to set up configuration files like the /etc/apt/sources.list for EACH target you are running in scratchbox, especially if you plan to be doing cross compilation.

Maemo Scratchbox Hell

That was SO much harder than yesterday. So, maybe it wasn't the same problem.

When trying to install the maemo-sdk-runtime in the ARMEL target of my scratchbox, I kept getting this HUGE error that started
[sbox-DIABLO_ARMEL: ~] > fakeroot apt-get install maemo-sdk-runtime
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
maemo-sdk-runtime
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
27 not fully installed or removed.
Need to get 0B/1890B of archives.
After unpacking 32.8kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
maemo-sdk-runtime
Install these packages without verification [y/N]? y
/scratchbox/tools/bin/sh: line 1: /usr/sbin/dpkg-preconfigure: No such file or directory
Selecting previously deselected package maemo-sdk-runtime.
(Reading database ... 16920 files and directories currently installed.)
Unpacking maemo-sdk-runtime (from .../maemo-sdk-runtime_1.0_all.deb) ...
Setting up gconf2 (2.16.0-1osso14) ...
/scratchbox/tools/bin/chown: `messagebus:messagebus': invalid user
dpkg: error processing gconf2 (--configure):
subprocess post-installation script returned error exit status 1

and ended
E: Sub-process /scratchbox/devkits/debian-etch/bin/dpkg returned an error code (1)



I'll now list ALL the things that it took to get this working...

Let us start with /etc/sysctl.conf
add the lines
vm.mmap_min_addr = 4096
net.ipv4.ip_local_port_range = 1024 65535
vm.vdso_enabled = 0

to this file. I recommend doing a search for each of those setting before you add the new lines. If you have the settings in there, comment them out, and then put the changed setting directly underneath with a comment about WHY you are doing this. (That's to save you heartache later if it breaks something else.)

Next, I ran apt-get install -f in both my normal shell and in the scratchbox. I used apt-get autoremove to get rid of some no-longer-needed packages in my regular shell.

Gnuton reported several problems and fixes and although I didn't have his 'messagebus:messagebus': invalid user problem I still did
cd /var/cache/apt/archives
fakeroot dpkg -i *dbus*

in the scratchbox, just in case.

Finally, I followed his advice and did
cp /usr/sbin/dpkg-preconfigure /scratchbox/users/lisha/targets/DIABLO_ARMEL/usr/sbin

and finally the &$%#! fakeroot apt-get install maemo-sdk-runtime worked.

Sometimes I just don't learn

I created this blog for the specific purpose of saving me from my own terrible memory. Again and again I get myself into deja vu situations where I can distinctly remember getting into this problem before, but I can't remember hoow I solved it. The number of times that has happened has dropped precipitously since I started blogging my most annoying problems here. But, despite that fact, I managed to forget how really important it is to my learning process to write these things here.

Yesterday, my maemo development scratchbox and I had a little disagreement regarding available packages and repositories. In the end, I solved the problem, but only in the i386 target. Today I cant get the armel target to work and I have no idea what the fix was yesterday. This is a serious pain.

Not to worry, I was better than the problem yesterday, and after wasting a bit more time, I shall beat it again. When I do, I'll be sure to blog the solution here.