Friday, June 10, 2011

Linux minimal printer install

yum install cups
yum install gutenprint-cups
yum install system-config-printer

$DISPLAY not set for ssh -X

Ran into an one i hadn't seen around this; had all the right settings in /etc/ssh/sshd_config for X forwarding on a minimal server, but still no joy.  Did a 'yum install xauth' and life was good again.

Monday, May 9, 2011

Quick source code searching on Linux

While working on a fix in the JDK, I wanted to find all occurrences of a string in large collection of Java source.  I ended up using http://swish-e.org/  Its default file type is *ML, so a simple config file of:
IndexOnly .java
IndexContents TXT* .java
did the trick.  'swish-e -c swish-e.con -i .' and then 'swish-e -w word' -- blazingly fast.

Building OpenJava 7 on Ubuntu 11

sudo apt-get install mercurial
hg clone http://hg.openjdk.java.net/jdk7/jdk7
cd jdk7
sh -x ./get_source.sh

sudo aptitude install openjdk-6-jdk gcc-4.2 g++-4.2
sudo aptitude install libmotif-dev
sudo apt-get install ant
sudo apt-get install libasound2-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install gawk
sudo apt-get install libxext-dev
sudo apt-get install libxrender-dev
sudo apt-get install libxtst-dev
export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk
make ALLOW_DOWNLOADS=true
Then a 'make ALLOW_DOWNLOADS=true' gets things rolling.  Not sure why this isn't documented anywhere that was easy to find. One can also go to http://jdk7.java.net/download.html export LANG=C export ALT_BOOTDIR=/home/beaty/jdk1.7.0_04 export ALT_JDK_IMPORT_PATH=/home/beaty/jdk1.7.0_04 export ALT_HOTSPOT_IMPORT_PATH=/home/beaty/jdk1.7.0_04

Friday, April 29, 2011

Saeco Via Venezia and espresso pods

We have one of these machines at work, and it some experimenting on how to use it with pods.  The instructions left much to be desired.  So, put the rubber adapter in first, then the single shot basket, then the pod.  Here's a picture:

Wednesday, April 27, 2011

Connecting a VirtualBox guest network to its host

I love VirtualBox (http://www.virtualbox.org/) and use it all the time.  I have a Ubuntu guest running on an OSX host.  I wanted to move files between the two, but my OSX home directory is encrypted (as they all should be).  In general, the network connection made from the guest to outside the box isn't directly available, so I added a second network adapter via the VirtualBox control panel, and made it a "Host-only Adapter" (see screen shot below).  An 'ifconfig' on the guest gave the address of 192.168.56.101, so a simple 'sftp beaty@192.168.56.101' from the host OS connected me to the SSHD server.
One does have to first create the network via Virtualbox's preferences:
 

Thursday, April 14, 2011

udev and USB serial devices

We have a number of secure serial device servers (from http://www.vscom.de/) where I work.  One the Linux server where they are connected, they show up at different /dev/ttyUSB locations after each boot.  No particular surprise as I've seen the same things with disks.  What I wanted to do was create symlinks that remained constant.  So, one starts by profiling the devices via
udevinfo -a -p /class/tty/ttyUSBXX
A lot of info spews out.  For these particular devices, there are two ttyUSBXX entries, one number apart.  They differ in only one regard
29c29
<     SYSFS{bInterfaceNumber}=="00"
---
>     SYSFS{bInterfaceNumber}=="01"
So, one has to create udev rules to differentiate the two.  I created a file '/etc/udev/rules.d/97-pdu.rules' the looks like
kernel=="ttyUSB*", SYSFS{bInterfaceNumber}=="00", SYSFS{../serial}=="FT123456", 
SYSFS{../product}=="USB FAST SERIAL ADAPTER", SYSFS{../manufacturer}=="FTDI", SY
MLINK+="PDU44"

kernel=="ttyUSB*", SYSFS{bInterfaceNumber}=="01", SYSFS{../serial}=="FT123456", 
SYSFS{../product}=="USB FAST SERIAL ADAPTER", SYSFS{../manufacturer}=="FTDI", SY
MLINK+="PDU45"
Did a 'udevtest /class/tty/ttyUSBXX' to make sure the correct symlinks would be created, and then did a '/sbin/udevtrigger' to make it happen the first time.  All was good after that.