Tuesday, September 14, 2010

VMWare Image for CDH3

I made this posting 2 months ago (http://getsatisfaction.com/cloudera/topics/vmware_image_for_cdh3) and apparently Cloudera has yet to release a fix for this VMWare:

In any case, here is the same posting:

VMWare image for CDH3 -- eth0 does not show up as an installed driver. The previous cloudera-training-0.3.3 VmWare image did not have this issue, but cloudera-training-0.3.4
does seem to be missing the appropriate driver. By default I can't access the Internet.

I managed to bypass this issue by activating eth1 by editing /etc/network/interfaces:
sudo bash 
vi /etc/network/interfaces: 

auto eth1 
iface eth1 inet dhcp 
/etc/init.d/networking restart 
Also, I tried to install VMWare Tools to see if the eth0 issue would go away, but after rebooting, the problem still persisted. I certainly didn't see this issue on the previous VmWare image.

In any case, here are instructions to install VMWare Tools:
sudo apt-get install linux-headers-`uname -r` (this is necessary to get the right headers) 
Click on install VMWare Tools 
mount /cdrom 
cd /cdrom 
Copy VMWare tool source code to /tmp and extract the files (the actual filename will depend on your VMWare version [which the VMWare installer would have reported in case of a mismatch]):
cp VMWareTools*.tar.gz /tmp 
cd /tmp 
tar -xzvf VMWareTools*.tar.gz 
cd vmware-tools-distrib/ 
sudo ./vmware-install.pl

Changing the behavior of Emacs' list-buffers mode

I encountered the same issue with Emacs.  The issue is that when you hit Ctrl-X, Ctrl-B to see all of your buffers with the window split in 2, the buffer list shows up on the other side.  It's hugely annoying since you lose the previous buffer screen.

http://stackoverflow.com/questions/1231188/emacs-list-buffers-behavior

In GNU emacs, every time I hit Ctrl-x Ctrl-b to see all of my buffers, the window is split to show the buffer list, or if I have my window already split in 2 (for instance, I will have a shell running in the lower window), the buffer list appears in the other window.

My desired behavior is for the buffer list to appear in my active window so that I can select the buffer I want and continue to working in the same window, rather than having to Ctrl-x Ctrl-o to the other buffer, selecting the buffer (with enter) and editing that buffer in the other window... I've googled for it but it doesn't seem to be a common desire? I wonder if anyone has an elispy (or other) solution?

Simplest solution?

Edit your .emacs:

(global-set-key "\C-x\C-b" 'buffer-menu)

Monday, September 13, 2010

Brother 8480DN Duplex printing

Brother has a table listing of Linux drivers:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html

To download the BR8480DN printer driver, the PPD is made available here:
http://pub.brother.com/pub/com/bsc/linux/dlf/BR8480_2_GPL.ppd.gz

gzip -d BR8480_2_GPL.ppd.gz

You can use "Provide PPD file" and use the gzip unzipped PPD file. This will then allow you to setup duplex mode to print!

You should choose DuplexTumble or DuplexNoTumble here:
http://www.infres.enst.fr/~demaille/a2ps/doc-4.12/a2ps_11.html

Dropbox and shared folders

We know that Dropbox uses Amazon S3 for its storage back-ends. For 2GB of storage, Amazon will charge them $.30 (assuming $.15/GB). This obviously doesn't include their other hosting costs but we're using it as a basic measurement.

Once you start using shared folders (especially if your company starts creating shared folders), then pretty quickly your storage capacity gets filled up. You have to look at Dropbox's simple statement here:
https://www.dropbox.com/help/14
When you sign up for a free Dropbox account, we'll give you 2GB of storage space forever. Deleted files and previous versions of files don't count against your quota, but any shared folders you have joined do.
The implications are huge about using shared folders. This statement pretty much means that every person who ends up using the shared folder has to be upgraded to a $10/month plan, which means that Dropbox can comfortably begin to make more than 10x for each user account once they're dependent on using it. And the organization that uses the share folders also must pay for the monthly cost to increase storage quota as well!

Saturday, September 11, 2010

Ubuntu 10.04 and Sprint 3G/4G

The instructions are here:

http://jebus.nu/tech-corner/sprint-u300

You can probe your USB devices and see which one has a CMOTECH, a South Korean company that manufactures eVDO data modems.
# lsusb
Bus 002 Device 008: ID 16d8:6008 CMOTECH Co., Ltd. 
Unlike the link, the product ID was 6008. So I used the following command to add the unit as a serial device:
sudo modprobe usbserial vendor=0x16d8 product=0x6008
The /etc/udev/rules.d/50-u301modem.rules looks like:
ACTION!="add", GOTO="3G_End"

SUBSYSTEMS=="usb", ATTRS{idProduct}=="6008", ATTRS{idVendor}=="16d8", RUN+="/sbi
n/modprobe usbserial vendor=0x16d8 product=0x6008"
LABEL="3G_End" 

Note: for Ubuntu 12.04, you don't need to make these changes. In fact, you shoud remove the rules, sudo service restart udev, and restart Gnome (logout).  Ubuntu 12.04 already seems to have rules for these modems (at least the U600 device), and having this rule appears to conflict with the Mobile Broadband option that gets provided.

Thursday, September 9, 2010

Emacs and Pyflakes using a /tmp directory

One of the issues in how most instructions to use Pyflakes with Emacs is to create a temporary buffer xxx_flymake.py in the file you're editing. This issue can cause problems when trying to view other people's Python files in which you have no write permissions. The typical example code for editing your .emacs file is as follows:

(when (load "flymake" t)
  (defun flymake-pyflakes-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-inplace))                                                                                                                                    
           (local-file (file-relative-name
                        temp-file
                        (file-name-directory buffer-file-name))))
      (list "pyflakes" (list local-file))))
  (add-to-list 'flymake-allowed-file-name-masks
               '("\\.py\\'" flymake-pyflakes-init)))
(add-hook 'python-mode-hook 'flymake-mode)
We can change the code to use the Emacs Lisp make-temp-file:

(defun flymake-create-temp-in-system-tempdir (filename prefix)
  (make-temp-file (or prefix "flymake")))

(when (load "flymake" t)
  (defun flymake-pyflakes-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-in-system-tempdir))
           (local-file (file-relative-name
                        temp-file
                        (file-name-directory buffer-file-name))))
      (list "pyflakes" (list local-file))))
  (add-to-list 'flymake-allowed-file-name-masks
               '("\\.py\\'" flymake-pyflakes-init)))
(add-hook 'python-mode-hook 'flymake-mode)

I give credit to http://github.com/purcell/emacs.d/blob/master/site-lisp/flymake-ruby/flymake-ruby.el for showing how it can be done for editing Ruby environments.

Another thing that can be done is to move all Emacs temporary files to the /tmp dir, or your own ~/.emacs.d/tmp directory:
(setq temporary-file-directory "~/.emacs/tmp")

(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

Wednesday, September 8, 2010

Ubuntu Tweak installation

sudo add-apt-repository ppa:tualatrix/ppa

sudo apt-get update

sudo apt-get install ubuntu-tweak