Debian recollection: remember when your laptop could not reboot?

Remember that “I can’t reboot” problem has hit all of the Dell laptop on which I’ve installed Debian Linux 6.

The symptom is that the screen froze after initiating a reboot. You might wait forever and it would not change. Its a known problem, I think everybody is pointing at everybody else saying “you did not follow the standard correctly.”

Here is the fix.

The kernel line in the boot thingie has to have the magic word “noapic”.

You can do that intereractively every time you start, but it is better to make it automatic.

Here’s the way I did it.

look in /etc/default. That’s a Debian place, similar to RedHat’s /etc/sysconfig.

THere should be a file “grub”. You only need to change one thing, the 4th line.
I put in “noapic”. I remove the “quiet” option because I like to watch the error messages.

After that, you run “update-grub”. That has to be done as root (or if you setup “sudo”, that way).

Here is my grub file:

# If you change this file, run ‘update-grub’ afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n ‘Simple configuration’

GRUB_DEFAULT=0
GRUB_TIMEOUT=15
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=”noapic”
GRUB_CMDLINE_LINUX=”"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)
#GRUB_BADRAM=”0×01234567,0xfefefefe,0x89abcdef,0xefefefef”

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo’
#GRUB_GFXMODE=640×480

Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=”true”

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1″

################################################################

Here’s what update grub looks like on my system. I have several kernels installed, so it cycles thorough each one.

$ su
Password:
root@pjlap-124:/home/pauljohn# update-grub
Generating grub.cfg …
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.2.0-2-amd64
Found initrd image: /boot/initrd.img-3.2.0-2-amd64
Found linux image: /boot/vmlinuz-3.0.0-1-amd64
Found initrd image: /boot/initrd.img-3.0.0-1-amd64
Found Windows 7 (loader) on /dev/sda2
Found Debian GNU/Linux (6.0.1) on /dev/sda9
done

Comments off

Stable Debian, new R

To get the new R with the Debian stable, here’s what you do.

http://rweb.quant.ku.edu/cran/bin/linux/debian/

In your system’s directory for addon repositories, /etc/apt/sources.list.d, you create a file with a name “R.list” (must be “list” on the end” and in there you put this instruction.

deb http:///bin/linux/debian squeeze-cran/

I suggest replace with “rweb.quant.ku.edu/cran”

then as root (type “su -” in terminal)

$ apt-get update

$ apt-get install r-base r-base-dev

This will come back with some hassle about installing insecure packages because we have not “bothered” with getting the security key for that apt package maintainer. The procedure described in the web page under “Secure Apt” was bumpy. For me, the gpg was not able to directly import the key, so I had to do:

gpg -a –export 381BA480 > jranke_cran.asc

apt-key add jranke_cran.asc

After R is installed, be aware of this issue. The R core team’s packages are installed under /usr/lib/R/library. Other packages that have been turned into debian packages will go under /usr/local/lib/R/site-library. If the non-root user runs install.packages, then the system will invite the user to install them in his home directory, under ~/R/. SO the R system has a complicated set of paths to survey when it looks for packages, and it is a possibility (danger?) that there may be several installed. For example, if the Debian packager has made a package that gets installed under /usr/local/lib/R/site-library, and then a user notices that is old, the user can run install.packages and a newer version will get dropped into ~/R. However, if the system administrator comes along and updates the Debian packages, then the one in the system may be newer.

Also remember, after updating your R packages, consider making 2 steps.

1. Use apt-get (or synaptic) to make sure you are up-to date on other R packages that have been turned into debian packages.

2. Run R as root and do this:

> update.packages(ask=F, checkBuilt=TRUE, dep=TRUE)

That forces re-installation of packages that were built under old R.

Comments off

KU’s digicert SMIME email; my memo

Here’s the gist of it: You can sign up through KU for a Digicert certificate to secure email within KU. There’s no excuse anymore for sending secure information in email without encryption.

Longer explanation

For securing email communications, there are 2 leading approaches, PGP and S/MIME. Both of these systems give the user a
“two part” security system. A private part, that you use to “decode” messages, and a public part, that others use to encrypt messages to you and to verify your identity when you send messages to them. I now have both of them set up in my computer. Contrary to the KU website, it is not necessary to use Outlook as your mail client and you need not have
Windows or Macintosh to make this work.

PGP is what I use most of the time because its is free and fairly widely used throughout the world. I’ve been using
Thunderbird for email for a long time and an addon called “Enigmail” works with PGP. When I want to send email to
people, I go check on a public PGP key server, such as http://pgp.mit.edu. For WIndows users, there is a free/open
implementation gpg4win and a PGP key manager program called Kleopatra that comes with it.

KU decided to go in a different direction.

The S/MIME system is based on SSL certificates. One’s email program can be configured to use either/both PGP and
S/MIME. Until now, I avoided S/MIME because secure certificates are expensive. If you buy one for yourself personally,
the price can be substantial. KU has arranged with the Digicert company to create certificates, however, so for faculty
and staff, it is free to get a certificate pair.

Now that this system exists, and is integrated into the KU Outlook mail server system, it seems to me you have no excuse
for using plain old insecure email when you are communicating about budgets and ID numbers. Please go here and sign up
for certificates. Lets see if we can make encrypted mail work.

http://www.technology.ku.edu/ca/digicert/index.shtml

What’s the down side? KU’s not paying for the certificates for students, and they certainly don’t provide the
certificates for people at other institution. So I still use PGP more often than S/MIME (Digicert), but I need to have
both because KU administrators think that the S/MIME system is preferred.

pj

Comments off

iwlwifi head’s up: kernel 3.2 problems

I run Debian testing and the kernel upgraded to 3.2 a while ago. I’ve had the problem that my dell laptop with Centrino wireless card can’t join wireless networks, Like others, I had mistaken this for a network-manager problem because an
upgrade of n-m occurred around the same time.

This week I learned that this is likely do to a change in the wifi driver in the kernel, iwlagn replaced by iwlwifi, and
the rumor is that the last dependable version of the wifi driver is in kernel 3.1.0.
(https://bugzilla.redhat.com/show_bug.cgi?id=785561)

After hearing that issue, I have started booting the 3.1 kernel and the wifi problem has completely disappeared! I’ve
seen some posts indicating the problem is known and solved in experimental versions of the 3.2.x kernel, but I have no
actual evidence because I can’t waste another day fighting with this.

For the details:

This is a Dell Precision laptop M4600.

$ lspci -v
….
03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)
Subsystem: Intel Corporation Centrino Ultimate-N 6300 3×3 AGN
Flags: bus master, fast devsel, latency 0, IRQ 48
Memory at ded00000 (64-bit, non-prefetchable) [size=8K]
Capabilities:
Kernel driver in use: iwlagn
$ uname -r
3.1.0-1-amd64

You will know if you are experiencing same problem under kernel 3.2.x if you see this in dmesg

[ 812.138914] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 819.918684] wlan0: authenticate with 5c:d9:98:65:64:b0 (try 1)
[ 819.920615] wlan0: authenticated
[ 820.028658] wlan0: associate with 5c:d9:98:65:64:b0 (try 1)
[ 820.031205] wlan0: deauthenticated from 5c:d9:98:65:64:b0 (Reason: 9)
[ 848.322384] wlan0: authenticate with 5c:d9:98:65:64:b0 (try 1)
[ 848.324254] wlan0: authenticated
[ 848.331230] wlan0: failed to insert Dummy STA entry for the AP (error -17)
[ 875.755429] wlan0: deauthenticating from 5c:d9:98:65:64:b0 by local choice (reason=2)
[ 875.804617] wlan0: authenticate with 5c:d9:98:65:64:b0 (try 1)
[ 875.807889] wlan0: authenticated
[ 875.808495] wlan0: failed to insert Dummy STA entry for the AP (error -17)

Comments off

R … dot-dot-dot arguments

Working with dot-dot-dot has been a challenge.
I would not have understood this post by Gabor Grothenieck in r-help on 2011-10-9, but I do now! And I’m so happy!


Suppose we wish to call f with the control.list components plus
those in the default.args not already specified in the control.list.
If any such arg is not an arg of f exclude it:

# test data – f, default.args and control.list
f < - function(a, b, c = 0, d = 1) print(match.call())
default.args <- list(a = 2, b = 1)
control.list <- list(a = 1, d = 2, e = 3)

# override default.args with control.list
use.args <- modifyList(default.args, control.list)

# exclude components of use.args that are not args of f
sel <- names(use.args) %in% names(as.list(args(f)))
final.args <- use.args[sel]

# run f
do.call("f", final.args)

The last line gives:

> do.call(“f”, final.args)
f(a = 1, b = 1, d = 2)

Wow. That touches all the bases. Understand that, you understand “it”.

The problem I fought first was the “double specification” of options. The … may add arguments that are already set. The magic bullet for that is the “modifyList” function, which can take a default list of settings and selectively replace them with new settings. Awesome.

Then you have the problem that the dot arguments may not apply to a function in which they are to be called. That’s where the args function retrieves the legal arguments from a function and then picks the ones that match. Awesome.

I used “formals” for same purpose in my code, before I saw Gabor’s post.

See also

Richie Cotton:

f <- function(x, …)
{
dots <- list(…) #1
if(length(dots) == 0) return(NULL)
cat(“The arguments in … are\n”)
print(dots)
f(…) #2
}

f(1,2,3,”a”, list(“monkey”))

The function, f, stores all but the first input argument in the ellipsis variable. For accessing its contents, it is easiest to convert it to a list (1). The main use however is for passing arguments to subfunctions, which requires no conversion (2).

########################

Why sometimes

input_list <- list(…)

and other times:

object <- as.list(substitute(list(…)))[-1L]

http://stackoverflow.com/questions/3057341/how-to-use-rs-ellipsis-featur…

Comments off

Firefox 4 will drive you insane. Maybe

FF4 is OK, but they have made some changes I absolutely hate. They hide some menu items, for no particular reason.

And they swapped the “New Window” and “New Tab” items in the right click.

People respond “install the menu-editor addon” but that’s a big mistake. It does not work well. My right menu flies off to the side, or strobes randomly, when I have that open. The ME author says he won’t fix it because it conflicts with too many other programs.

Luckily, there is a more direct fix that does not require an addon. In the file “userChrome.css” insert the following lines. (If file does not exist, create it).

The file is under your user profile: .mozilla/firefox/whatever.default/chrome

$ cat userChrome.css
@namespace url(“http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul”); /* only needed once */

/* Always show all hidden menu entries */
#navigator-toolbox menuitem[class="show-only-for-keyboard"] { display:-moz-box !important; }

#contentAreaContextMenu > * { -moz-box-ordinal-group: 2; }
#context-openlink { -moz-box-ordinal-group: 1 !important; }

Comments off

Create RPMs for yourself

create

~/.rpmmacros:

[pauljohn@pols12 ~]$ cat .rpmmacros
%_topdir /home/pauljohn/LinuxDownloads/redhat

%_signature gpg
%_gpg_name Paul Johnson

%_unpackaged_files_terminate_build 0

2. Make the directory

mkdir -p ~/LinuxDownloads/redhat

3. Install rpmbuild program

$ yum install rpm-build

4. Download the SRPM file of something you want to build. I used firefox to browse,
found something on epel, then downloaded from cli:

$ wget http://download.fedora.redhat.com/pub/epel/6/SRPMS/R-2.12.1-1.el6.src.rpm

5. Install that src.rpm. Unlike other RPM installs, this IS NOT run as root, and it will drop the files into the topdir defined above in .rpmmacros.

$ rpm -ivh R-2.12.1-1.el6.src.rpm

Warnings will say “user mockbuild does not exist”. Just ignore it.

6. Note that creates the directories SPECS and SOURCES under LinuxDownloads/redhat.

Create the others you will need in there

$ mkdir BUILD
$ mkdir RPMS
$ mkdir SRPMS

6. cd to LinuxDownloads/redhat/SPECS.

Read the “spec” file, it controls how the build works. When I have
trouble compiling programs, I almost always download an SRPM file
from that project and study how the packager built it.

If you just want to rebuild R as Tom had done it for EPEL, go ahead.

$ rpmbuild -ba R.spec

If you don’t want to build everything, well, then don’t.

Read the rpmbuild manual page.

$ rpmbuild -bp R.spec

Or

$ rpmbuild -bb R.spec

7. The usual scenario is that I study the spec file, then
figure out what changes I want to make.

Now my purpose is to make an RPM for R-2.12.2, which I’m sure
EPEL will offer on its own, but I’m eager.

So I get the source code for that version of R, put it in the
LinuxDownloads/redhat/SOURCES folder. Hopefully, that follows
the same naming convention as the previous R packaging. If
it doesn’t, there will be more work to do.

Then go back to spec file, and change the VERSION number so
it matches the new R source just downloaded.

If everything is “just right”, then the new rpm can be built
without further trouble. Usually, things don’t go just
right. Perhaps the packaging for the previous version
applied a patch that is no longer needed (or has already
been applied in R itself), so you have to remove that from the
spec file.

Or you want to change the build options in the spec.

There is some controversy about how R ought to be built, and
you see the results in the difference of Debian and Epel packaging
of R. Look at the configure statements, you’ll see what I mean.

Posted from GScribble.

Posted from GScribble.

Comments off

Mplus File transfer utility

Don’t Forget to try:

N2Mplus

Can convert Excel and SPSS -> Mplus.

http://www.danielsoper.com/n2mplus/default.aspx

Comments off

Multiple Imputation: SEM & diagnostics

Here:

http://www.statmodel.com/discussion/messages/22/381.html

I found this:

Bruce A. Cooper posted on Monday, March 19, 2007 – 5:59 pm
Thanks, Linda -

Here are some references that you may find useful.

I haven’t gotten the Statistics in Medicine reference yet, but Don Rubin referred to it and two others in the “IMPUTE” thread “IMPUTE: Re: “Averaging” chi-square values (fwd)” as providing information about averaging Chi-squared values from SEM models on imputed data sets. There are some other notes in the IMPUTE threads re averaging R-squared values, but you already report R-squared for the imputation analysis. It would be nice to have the DF for the t-tests and the and an option for testing the Deviance, too!

Thread: http://www.mail-archive.com/impute@utdallas.edu/msg00158.html

References:
Li, K. H., Raghunathan, T. E., & Rubin, D. B. (1991). Large-sample significance levels from multiply imputed data using moment-based statistics and an F-reference distribution. Journal of the American Statistical Association, 86(416), 1065-1073.

Rubin, D. B., & Meng, X. L. (1992). Performing likelihood ratio tests with multiply-imputed data sets. Biometrika, 79(1), 103-111.

Rubin, D. B., & Schenker, N. (1991). Multiple imputation in health-care databases: an overview and some applications. Stat Med, 10(4), 585-598. (PMID: 2057657)

Comments off

Subversion and my course notes/hanouts

I’ve started an SVN archive where I’m going to be putting my source code for handouts and lectures, so if you want the
LyX or R files for that stuff, you can have it. But you need to sign up for a CRMDA computing account (free) and then
read my writeup on how to use an SVN version control system.

All the information on signing up and accessing these systems is on the CRMDA computing focal point:

http://pj.freefaculty.org/cgi-bin/mw

and the SVN manual I wrote is here:

http://pj.freefaculty.org/cgi-bin/mw/index.php?title=Software:VersionControlWithSVN

Read down to point 8, “I’m Shooting with Real Bullets Now”, and you see I’ve created my repository under

/crmda/users/pauljohn/SVN-repo

If you create an account, you should have read access to those files. I’m just starting now, but the beauty of SVN is
you can easily get the updated copy or scan for changes.

I try to remember to print out pdf versions and drop them back into the stat website. For example, my handouts on
logistic regression were pretty good, but not totally awesome. Last week I turned up the dial to 9 for a couple of days
and made a couple of things that I expect will really help. In particular, if you are considering using ordinal logistic
regression, you will benefit from a review of the documents. The meaning of the elusive terms “intercept” and
“threshold” is laid bare; the puzzle that different programs report different numbers is solved. In the web page, they
are now under stat at

http://pj.freefaculty.org/stat/LogisticRegression/Logit1-1_2011.pdf

http://pj.freefaculty.org/stat/LogisticRegression/Ordinal-1.pdf

But in the SVN-repo, you find those as LyX (?LaTeX?) documents and fig files, which you could open, edit, print, etc.
Assuming your computer is adequate, that is. These particular documents are Sweaved and will require the xfig program,
so they won’t compile on just any old PC. But many of the ones I will upload soon will be plain vanilla LyX files that
you can open, edit, compile, and print however you want.

Comments off

« Previous entries Next Page » Next Page »