Friday, March 25, 2011

Changing Ubuntu screen resolution

As I noted in the previous post, I have gotten resume to work. However, when the screen appears, the resolution has changed. Obviously you can click
System -> Preferences -> Monitors
and change the resolution there, but I googled around and stumbled onto a command line solution -- this is the command that did the trick:
$ xrandr -s 1024x768

Tuesday, March 22, 2011

#resume-fail

pm_op(): pci_pm_resume+0x0/0xa0 returns -16
PM: Device 0000:00:00.0 failed to resume async: error -16


This is a Latitude C640, by the way, in case anyone else is searching for a fix for this... if someone should stumble in here, please leave a comment, even if you don't find an answer, so I can follow up and see how you did.

In the mean time, I've set my lid-close behavior to hibernate, which does seem to work. Odd thing about that, though, is it displays a similar error (with "resume" replaced by "thaw") when the hibernate is taking place. But it does shut itself off and restart does restore the system properly.

UPDATE: I found a post on Ubuntu Forums that mentions a different issue, but the solution seems to help -- here's my /etc/default/acpi-support file...

#
# Configuration file for the acpi-support package
#
#
# The acpi-support package is intended as "glue" to make special functions of
# laptops work. Specifically, it translates special function keys for some
# laptop models into actions or generic function key presses.
#


#
# Suspend/hibernate method
# ------------------------
#
# When gnome-power-manager or klaptopdaemon are running, acpi-support will
# translate the suspend and hibernate keys of laptops into special "suspend"
# and "hibernate" keys that these daemons handle.
#
# Only in situations where there is no gnome-power-manager or klaptopdaemon
# running, acpi-support needs to perform suspend/hibernate in some other way.
# There are several options for this. The options are:
#
# dbus-pm:
#    Perform suspend and hibernate actions via a DBUS request to the power
#    management daemon. This works for power management daemons that we don't
#    know of. (For gnome-power-manager and klaptopdaemon this will do nothing,
#    since those will be detected when they are running, and triggered using
#    a virtual keypress.)
#
# dbus-hal:
#    Perform suspend and hibernate actions via a DBUS request directly to HAL,
#    bypassing any running power management daemons.
#
# pm-utils:
#    Use pm-suspend and pm-hibernate to suspend and hibernate. (The dbus method
#    normally results in this as well, but calls through dbus. Use this option
#    only if you don't have dbus installed.)
#
# hibernate:
#    Use the hibernate package to suspend and hibernate.
#
# acpi-support:
#    Use the legacy built-in suspend/hibernate support. (DEPRECATED)
# 
# none:
#    Do not attempt to suspend/hibernate. Set SUSPEND_METHODS="none" to
#    disable suspend/hibernate handling in acpi-support.
#
# If you specify dbus or pm-utils, the result will normally be the same as when
# you suspend from your desktop environment. If you specify "hibernate" or
# "acpi-support", be aware that this probably does not match what your desktop
# environment would do (unless you have managed to configure something so that
# the DBUS power management interfaces call the hibernate package).
#
#
# Please specify a space separated list of options. The recommended value is
# "dbus pm-utils"
#
SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"



#
# LEGACY BUILT IN SUSPEND SUPPORT (DEPRECATED)
# --------------------------------------------
#
# These options only work for the "acpi-support" suspend method. This is NOT
# recommended, but is retained for backward compatibility reasons.
#

# Comment the next line to disable ACPI suspend to RAM
ACPI_SLEEP=true

# Comment the next line to disable suspend to disk
ACPI_HIBERNATE=true

# Change the following to "standby" to use ACPI S1 sleep, rather than S3.
# This will save less power, but may work on more machines
ACPI_SLEEP_MODE=standby

# Add modules to this list to have them removed before suspend and reloaded
# on resume. An example would be MODULES="em8300 yenta_socket"
#
# Note that network cards and USB controllers will automatically be unloaded 
# unless they're listed in MODULES_WHITELIST
MODULES=""

# Add modules to this list to leave them in the kernel over suspend/resume
MODULES_WHITELIST=""

# Should we save and restore state using the VESA BIOS Extensions?
SAVE_VBE_STATE=false

# The file that we use to save the vbestate
VBESTATE=/var/lib/acpi-support/vbestate

# Should we attempt to warm-boot the video hardware on resume?
POST_VIDEO=true

# Save and restore video state?
# SAVE_VIDEO_PCI_STATE=true

# Should we switch the screen off with DPMS on suspend?
USE_DPMS=true

# Use Radeontool to switch the screen off? Seems to be needed on some machines
# RADEON_LIGHT=true

# Uncomment the next line to switch away from X and back again after resume.
# This is needed for some hardware, but should be unnecessary on most.
# DOUBLE_CONSOLE_SWITCH=true

# Set the following to "platform" if you want to use ACPI to shut down
# your machine on hibernation
HIBERNATE_MODE=shutdown

# Comment this out to disable screen locking on resume
LOCK_SCREEN=true

# Uncomment this line to have DMA disabled before suspend and reenabled
# afterwards
DISABLE_DMA=true

# Uncomment this line to attempt to reset the drive on resume. This seems
# to be needed for some Sonys
# RESET_DRIVE=true

# Add services to this list to stop them before suspend and restart them in 
# the resume process.
STOP_SERVICES=""

# Restart Infra Red services on resume - off by default as it crashes some
# machines
RESTART_IRDA=false

# Add to this list network interfaces that you don't want to be stopped
# during suspend (in fact any network interface whose name starts with
# a prefix given in this list is skipped)
SKIP_INTERFACES="dummy qemu"

# Note: to enable "laptop mode" (to spin down your hard drive for longer
# periods of time), install the laptop-mode-tools package and configure
# it in /etc/laptop-mode/laptop-mode.conf. 

Do-over!

Well I'm glad I did that, the writing down of what I was installing on this Linux system. Or should I say that Linux system? The disk was bad, I'm pretty sure. I could install Windows on it, but Linux just had a hard time with it. I kept getting this error on restore -- the kind that happens after a suspend. I'm really, really hoping I don't run into the same thing on this new install. The other bummer is that other disk is 250GB and this one is only 30GB. Oh well, this system is more or less an experiment and I'm months from a new laptop that has to be the one true laptop.

Wednesday, March 16, 2011

How I roll Linux

I was going to write a note-to-self post, something to keep track of system changes on this laptop I'm setting up with Ubuntu (and Windows, which is a long story)...

I'm installing Linux

Hey, guess where I'm writing from? I'm installing Linux right now!

This post isn't about the fact that I'm on this crazy lovefest with Linux, which certainly isn't news.

No, I'm running the browser and writing this post WHILE I'M INSTALLING!!

This happens to be the umpteenth time I've tried to install on this one hard drive -- it's a long story, every chapter of which ends with "Error: out of disk" and some kind of Grub recovery prompt that doesn't do anything... so I ended up repartitioning, putting 40GB in for Windows to see if NTLDR will save me. We'll see. And if it does, it will be thanks to an article on linux.com.

Anyway, I was -- still am -- in the middle of the latest install and Ubuntu has this little slide show going on showing you all the cool things about 10.10 -- and believe me, Ubuntu has lots of coolness, which is why I'm working so hard getting it onto my biggest spare laptop drive...

Anyway, among the slideshow blurbs was a link to Ubuntu's support page... and it was clickable... so I clicked it... and the browser came up... and the install is still going on... totally amazing!! I wonder how you'd be able to bring up the browser, or anything else on the Live CD, and with any luck I won't have any more opportunities this morning to find out!! ::fingers crossed::

Thursday, March 10, 2011

With a name like Blekko...

"With a name like Smuckers, it has to be good," isn't that what the ads say? Yes, I've confirmed that, using none other than the beta-labeled search engine Blekko. And with such a stupid name, it would have to be great, right? Maybe I'll search for that phrase again in a few days and see where it leads me. But searching with "/date" for "EMPIRE, Wargame of the Century" did not bring me back here. I have to confess, seeing that "/date" made me nostalgiac for VAX/VMS (sorry, Alpha and Open -- you don't rate anywhere nostalgia-wise for me). Hey, maybe my site is one of the millions that Blekko banned, which I read about in the New York Times -- and oh yes, that is how I learned of this new search engine. OK, here's another experiment, since I'm feeling all scientifical -- what if I were to coin a word like experimiftical? It's an adjective describing someone annoyed by search results and making up words to use as test cases. Come on, Google and Bing, I know one of you can do it, but Blekko? I'm not so sure.

Update (4:58 a.m.) go ahead and try to create a word on Wiktionary, but some guy will delete your page before you can even see it in the search results! #jackwagon

Update (~6:45 a.m.) a Google search already includes my test word, but they do have a leg up, this being a Google-hosted blog after all.

Update (Friday) 24 hours later, only Google has my results!

Monday, March 07, 2011

Working with TOPS-10 .TAP files in SIMH

Step 1: mount request
.assign mta0: tape:
.mount tape:/reelid:??????/nowait
Step 2: mount the "tape"
(go to SIMH and hit ctrl/E to interrupt the simulator)
sim> set tu0 lock
sim> attach tu0 /path/??????.tap
sim> go

.r opr

OPR>shoW queUES 
OPR>
21:04:05                -- System Queues Listing --

Mount Queue:
Volume    Status     Type     Write    Req#   Job#          User
-------  --------  --------  -------  ------  ----  -------------------
T10FOR   Waiting   Magtape   Locked        4     2  OPR    [1,2]
   Volume-set: TAPE
   Label-Type: No, Tracks: 9, Density: 1600 BPI
There is 1 request in the queue

OPR>ideNTIFY (device) mta0: (with) reQUEST-ID 4
OPR>
21:04:29        Device MTA0  -- Volume T10FOR reassigned --
                User: OPR    [1,2] Job #2

OPR>exit
Step 3: restore the files
.r backup

/tape tape:
/files
/rew
/restore dsk:=[*,*]*.*
With a tip of the hat to www.asun.net for help with the first two steps.

Sunday, March 06, 2011

Empire, another timewaster from my youth

People are always asking me, "Dave, you're so good at wasting hours and hours on trivial nonsense... what's your secret?"

Well here's the latest gem of my youth: EMPIRE, Wargame of the Century. Just log into your nearest Ubuntu system and say "$ empire" -- you'll thank me, I'm sure!!
    ...+++++++...      .++++++++.........+..  .+.  0 S 
...+++++aX+..........+++A+A++.........AA. .+. e
+++Xa+++..a++............+O+.........++AA. .++ 2 c
.+++++++...++++...........++........++AAOA....++ t
..+++++.....+++++...........+.........A++AA...+++ 4 o
++++++.......+++......................+AAA....A++ r
++................+++............T...........A+O+ 6
+X.........p..T...A++++.....................A++++ 5
a+++.++++........AO+++++..+..........++.....+++++ 8
+++a++........AA++A++++++.......++++....AA+++. R
++X++......A++++A++++++......+++++....A+++.. 10 o
++aaa......AAA+AAAO++++O....++++++.....+O.. u
++++a.....AA......++A+....A++O++......... 12 n
+++a+....................A++++A......... d
aa......................+A+++++....... 14
aa......................A+++++++...... 1
aa....................AOA+A++++...... 16 7
a++....................AAAAA+OA++... 8
.aXa....................AAAAAAA++... 18
........++++.......+++.......AA+A..
.....+X+++...... ++.. ....AA... 20
....++++a...... +... ........
...+++ a.... ++.. ....... 22
... +.. .....
+....... 24
.......
..... 26
...

My hope was to build this from the Fortran/Macro sources on TOPS-10, but that didn't pan out -- many undefined symbols in the Link. But this updated version is definitely the next best thing!

Friday, March 04, 2011

Setting javax.net.ssl.trustStore in JDev

While running an application deployed to my integrated WLS instance, I was seeing this error:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

And trying to solve it using the program attached to this post.

Unfortunately when I'd run it, instead of seeing the same error as above, I'd see this:

No errors, certificate is already trusted

And here's why: I noticed when JDeveloper started up WLS, it was setting

javax.net.ssl.trustStore=%OH%/Middleware/wlserver_10.3/server/lib/DemoTrust.jks

But when I ran InstallCert, it was instead referencing a keystore that does contain the certificate I need

%OH%/Middleware/jdk160_21/jre/lib/security/cacerts

It turns out that in JDev preferences, setting Client Trusted Certificate Keystore will change the value of javax.net.ssl.trustStore. A quick restart of WLS and your app is working great!

Java switches

Why can I never remember this?

$ javac -d ./classes ...

$ java -cp ./classes ...

I.e. I can never remember which one gets the -d and which gets the -cp. I need to make up a little song or something.

Wednesday, March 02, 2011

No more crashes!

My Droid 2 was crashing waaaay too much. Or should I have said wayyyy? It's hard to know. I never let it bother me too much until one day when my phone felt physically hot in my pocket and after setting it on my desk, I heard the tell-tale buzz of rebooting. Enough. I wish I could remember which site I was reading that led me to an idea of a culprit, because they deserve credit for what I'm about to tell you. Which is that Advanced Task Killer is no longer on my phone, and ::knock on wood:: it has been nearly crash-free (once) ever since. Come to think of it, the article I read might not have named the software, but just blamed task killers in general. Maybe the fault lies elsewhere and ATK is being blamed unfairly, but the result of removing one app does tend to speak pretty loudly for itself.

Too many windows

Every now and then I'll click a link in the Android browser and an alert will pop up, telling me I have too many windows open. Should I blame the web programmer for insisting that a new window be created? No, he/she might never have imagined their site being used on my tiny, wondrous computer. The developers of the Android web browser, on the other hand, had a pretty good idea where their program would be running and should have left the new-window decision up to me. The very idea of multiple windows, unless the user has requested such a thing, seems contrary to the natural flow of the Android UI. So let it never be said that this Phandroid never had a critical word for Google, even if it is a small one.