Wednesday, December 17, 2008

Helpful commands for R


  1. library(foreign) - Allows you to load Stata and Excel files, among others.

  2. foo <- read.dta("location") - Loads a Stata *.dta file.

  3. names(foo) - Lists the names of the variables in dataset foo.

  4. fit <- lm(y~x,data="foo") - Linear regression of Y on X using data in foo.

  5. fit <- glm(y~x,family=binomial(link="probit"),data="foo") - Probit regression of Y on X using data in foo.

  6. summary(fit) - The stuff you want in model fit.

Friday, December 12, 2008

Importance of reading manual pages (wireless)

I had some difficulty configuring wireless at Georgia Tech for OpenBSD, but it was only because of my failure to read the manual pages carefully.


Under the nwkey entry of ifconfig(8), "The key can either be a string, a series of hexadecimal digits (preceded by '0x')..." (emphasis mine). Obviously, if there is no '0x', then ifconfig assumes your WEP key is a string. In our school's case, the WEP key is hexadecimal.

Wednesday, December 10, 2008

VIm and Arrow Keys

For some reason, using arrow keys in VIm is equivalent to typing ABCD. A temporary fix is to type :set term=cons25.

Daemons in OpenBSD

OpenBSD does not by default use a /etc/rc.d system to start and restart daemons. Instead, daemons are started as follows:


/usr/sbin/[name] &


or /usr/local/sbin/[name] &


Daemons are restarted by kill -HUP `cat /var/run/[name].pid`.

PCManFM on OpenBSD

PCManFM is easily installed through the package collection. Once it finishes installing, it will display a few post-installation notes. (They will show up in your xterm.) You will have to edit a few rc files and restart some daemons. Be sure to remember which rc files; if you forget which daemons are to be restarted, simply reboot.


If you aren't using GNOME, then it is very likely that the first time you start PCManFM, you will have an error message that talks about icons. To solve this, do the following:



  1. Make a .gtkrc.mine file in your home directory. Write gtk-icon-theme-name="Name of icon folder in icon directory".

  2. Make a .gtkrc-2.0 file, also in your home directory. Write include "/usr/local/share/themes/[name of theme]/gtk-2.0/gtkrc", enter, and include "/home/[your handle]/.gtkrc.mine".


The icon directory is /usr/local/share/icons/. The default theme is Raleigh.

Wednesday, December 03, 2008

Switch sessions in SLiM

The ability to choose sessions in SLiM is at present an experimental feature. However, for my purposes, I have found no flaws in its execution.


First, edit the slim.conf file. In Archlinux, it is found at /etc/slim.conf. After "sessions," tab and type in the window managers and desktop environments you have installed. These are merely placeholders; they need not be the name of the binaries. Then, edit your .xinitrc. The sample is easy to follow and worked for me. You must modify the names of the sessions accordingly. Thus, in my case, I replaced xfce4, icewm, wmaker, and blackbox with openbox, kde, kde-openbox, and awesome. In addition, I set openbox as my default session. Now, you can press F1 at the login screen and choose your session!

Tuesday, December 02, 2008

Edit TrackPoint sensitivity in Archlinux

The ThinkWiki says that the configuration options can be acccessed by changing directory to /sys/devices/platform/i8042/serio0/serio2. However, on my Lenovo ThinkPad R61, the files were at /sys/devices/platform/i8042/serio1/serio2. My kernel version is 2.6.27.