One does have to first create the network via Virtualbox's preferences:
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.
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/ttyUSBXXA lot of info spews out. For these particular devices, there are two ttyUSBXX entries, one number apart. They differ in only one regard29c29
< 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 likekernel=="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.
Direct network connection to APC PDU's
Some of this information is scattered around the web, but I thought I'd put in all in one place.
In order to schedule an event on the PDU's, one has to use the web interface -- this functionality is not replicated in the serial interface. First, I set the PDU's to request addresses on via DHCP via the serial interface, though I didn't test if that was necessary.
To connect (in my case, a MacBook) directly to the ethernet port on a PDU, one has to run a DHCP server on the laptop. You'll need to set the ethernet port to a static IP address, in this case something along the lines of 'ifconfig en0 192.168.1.1/24'.
First, download the DHCP server source from ISC: http://www.isc.org/software/dhcp Do the usual './configure'. There is a compile error at this time requiring editing 'dhcpctl/Makefile' to remove the -Werror from the CFLAGS macro. Then one can 'make'. Do not 'make install' as it will overwrite your DHCP client config. Instead, cd to each of server, dhcpctl, and opamip, and do 'sudo make install' in each. The APC PDU's require a very specific portion of the reply; use the following /etc/dhcpd.conf
Run 'sudo /usr/local/sbin/dhcpd -d en0' and watch for the DHCP requests and responses. You will see a lease given out; point your browser to that IP address.
In order to schedule an event on the PDU's, one has to use the web interface -- this functionality is not replicated in the serial interface. First, I set the PDU's to request addresses on via DHCP via the serial interface, though I didn't test if that was necessary.
To connect (in my case, a MacBook) directly to the ethernet port on a PDU, one has to run a DHCP server on the laptop. You'll need to set the ethernet port to a static IP address, in this case something along the lines of 'ifconfig en0 192.168.1.1/24'.
First, download the DHCP server source from ISC: http://www.isc.org/software/dhcp Do the usual './configure'. There is a compile error at this time requiring editing 'dhcpctl/Makefile' to remove the -Werror from the CFLAGS macro. Then one can 'make'. Do not 'make install' as it will overwrite your DHCP client config. Instead, cd to each of server, dhcpctl, and opamip, and do 'sudo make install' in each. The APC PDU's require a very specific portion of the reply; use the following /etc/dhcpd.conf
option vendor-encapsulated-options 01:04:31:41:50:43;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.150 192.168.1.200;
default-lease-time 300000;
max-lease-time 350000;
}
Run 'sudo /usr/local/sbin/dhcpd -d en0' and watch for the DHCP requests and responses. You will see a lease given out; point your browser to that IP address.
Monday, April 4, 2011
Linux external USB hard drive
It appears a well-known problem that when an external USB hard drive sleeps to save power, Linux becomes very confused. I tried modifying the drive's settings to no avail. My cheesy answer is to not let the drive sleep using a cron job. Do "sudo crontab -e" and put a line like:
0,10,20,30,40,50 * * * * echo "junk" > /mnt/steve/keepawake
in the crontab, with the correct path to the file on your machine of course. You don't have to be root of course, if you have permissions to write to a partition on the drive.
0,10,20,30,40,50 * * * * echo "junk" > /mnt/steve/keepawake
in the crontab, with the correct path to the file on your machine of course. You don't have to be root of course, if you have permissions to write to a partition on the drive.
Wednesday, March 30, 2011
Adjusting band on Rado ceramic watch
I didn't find any instructions on the web on how to do this, so here are some. It wasn't obvious to me at first, but in the end, there really is only one thing to do: remove the one visible pin near the clasp:
I recommend you take pictures, just like I did... Once the pin (well, pins if you adjust both sides) is/are removed, one can slide the outer link off the inner link:
Note that there are two sizes of outer and inner links; keep track in order to put them back correctly.
One has to allow the inner links to bend over in order to remove the outer links.
Here's a picture illustrating the different sized inner and outer links. Assembly is the reverse as they say. All in all, a clever system.
I recommend you take pictures, just like I did... Once the pin (well, pins if you adjust both sides) is/are removed, one can slide the outer link off the inner link:
Note that there are two sizes of outer and inner links; keep track in order to put them back correctly.
One has to allow the inner links to bend over in order to remove the outer links.
Here's a picture illustrating the different sized inner and outer links. Assembly is the reverse as they say. All in all, a clever system.
Thursday, February 24, 2011
Friday, February 18, 2011
7 +- 2
The issue with computer science (well, and all other engineering disciplines) is complexity. We can't deal with how complex our "artifacts" are. Our brains are built with a working memory size of about seven objects. Maybe hunting parties, or family sizes, were seven? Using any more of our brains to track more things was a waste and would lead to a loss of efficiency? Is this why telephone number are seven digits long? Don't know. What I do know is that once something we're looking at has more than seven objects, we are incapable of understanding it. More than seven visible variables, nesting levels, etc., and we can't understand what we're looking at. Hence functional decomposition and object-oriented programming. Most people whom claim to do OO, don't, but that's a post for another day. For today, check out http://coloradmin.com/circle.html for a visual demonstration of the property. Most people can only count to 7 (+-2) without having to "chunk" (group and then count). See: http://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two for a more rigorous treatment of this.
Subscribe to:
Posts (Atom)

