My reasoned, well-considered thoughts on gadgets, computing, quantified self, health, open source and whatever else gets my dander up.
Cookie Notice
As far as I know, and as far as I remember, nothing in this page does anything with Cookies.
2008/12/09
Showing the most useful piece of Catalyst documentation yet ....
Not that it is particularly useful.
Useful Test
I'm mostly going to test how to put code samples here, but if you're going to test, might as well make it useful, right?
I run Ubuntu, and I have sshfs installed. sshfs is part of FUSE, Filesystems in Userspace. What SSH allows you to do is mount the file systems on other machines via SSH.
The issue I ran into was that I wanted certain continual mounts all the time. I created a
I have two example machines to mount: Home and Work.
It could easily be set up to mount and unmount the NTFS filesystem of a dual-boot computer using
(I plan to beautify the means to dump code in the near future.)
I run Ubuntu, and I have sshfs installed. sshfs is part of FUSE, Filesystems in Userspace. What SSH allows you to do is mount the file systems on other machines via SSH.
The issue I ran into was that I wanted certain continual mounts all the time. I created a
~/Mount directory and put the mountpoints in there, and had mounting and unmounting shell scripts. If I wanted everything, I got everything. If I just wanted to unmount and remount one, well, I had to grep for the commands I want.I have two example machines to mount: Home and Work.
mount.pl mounts both. mount.pl -q unmounts both. mount.pl -m Home mounts just the Home filesystem. mount.pl -u Home unmounts just the Home filesystem. It could easily be set up to mount and unmount the NTFS filesystem of a dual-boot computer using
ntfsmount, or interact with Windows systems via smbmount, or other things. Right now, it seems way too small to try to put together as a project, but if you find it useful, feel free to comment.
#!/usr/bin/perl
use strict ;
use warnings ;
use Getopt::Long ;
use 5.010 ;
use subs qw( mount unmount ) ;
# Definition
# mount.pl -- mounts all in the config
# mount.pl -Q -- unmounts all in the config
# mount.pl -m foo -- mounts foo, if foo is in config
# mount.pl -u foo -- unmounts foo, if foo is in config
# mount.pl -m foo -u bar -- mounts and unmounts can be mixed
my @mount ;
my @unmount ;
my $unmount ;
my %local ;
my %remote ;
my $mountprog = '/usr/bin/sshfs' ;
my $unmountprog = '/bin/fusermount' ;
GetOptions( 'mount=s' => \@mount,
'unmount=s' => \@unmount,
'quit' => \$unmount, ) ;
while ( ) {
chomp ;
my $line = $_ ;
next if $line !~ m{\w}mx ;
my $result = ( split m{\#}mx, $line )[ 0 ] ;
$line = $result ;
next if $line !~ m{\w}mx ;
my ( $name, $remote, $local ) = split m{\s*\|\s*}mx, $line ;
$local{ $name } = $local ;
$remote{ $name } = $remote ;
}
# UNMOUNT EVERYTHING
if ( $unmount ) {
for my $mount ( sort keys %local ) {
unmount $mount , $local{ $mount } ;
}
}
# MOUNT EVERYTHING
elsif ( ( $#mount == -1 ) && ( $#unmount == -1 ) ) {
for my $mount ( sort keys %local ) {
mount $mount , $remote{ $mount }, $local{ $mount } ;
}
}
# MIXED MOUNTS AND UNMOUNTS
else {
# mounts first
for my $mount ( @mount ) {
mount $mount , $remote{ $mount }, $local{ $mount } ;
}
# then unmounts
for my $mount ( @unmount ) {
unmount $mount , $local{ $mount } ;
}
}
exit 0 ;
sub mount {
my $name = shift ;
my $remote = shift ;
my $local = shift ;
return 0 if $name !~ /\w/mx ;
return 0 if $remote !~ /\w/mx ;
return 0 if $local !~ /\w/mx ;
return 0 if !-d $local ;
say 'Mounting ' . $name ;
say qx( /usr/bin/sshfs $remote $local ) ;
return 1 ;
}
sub unmount {
my $name = shift ;
my $local = shift ;
return 0 if $name !~ /\w/mx ;
return 0 if $local !~ /\w/mx ;
return 0 if !-d $local ;
say 'Unmounting ' . $name ;
say qx( /bin/fusermount -u $local ) ;
return 1 ;
}
__DATA__
# NAME | REMOTE MOUNT POINT | LOCAL MOUNT POINT
Work | xxx.xxxx.xxxx.edu: | /home/rant/Mount/work
Home | xxx.xxxx.xxxx.net: | /home/rant/Mount/home
(I plan to beautify the means to dump code in the near future.)
2008/12/08
2008/12/04
Considering the Vast Array of Possibility...
At the end of work today, I had a fully-functional OpenSolaris machine running under VirtualBox.
I have tried, at various points in time, to keep a Solaris x86 machine around — "But, Mom! It followed me home! Honest!" — but in the end, I always wiped it. That is, if I ever got the installation finished. Solaris has not been an easy installation.
This wasn't real. This was virtual. A virtual ISO sat in a fake CD-ROM drive and filled a phony chunk of memory full of OpenSolaris. I clicked "GO", moved to another desktop and beat my head on Catalyst and MySQL for a little while. Then, I moved back to the desktop and clicked OK, and it was done. I had my first stab at Solaris package management trying to install the "Guest" packages.
First time I sat behind a Solaris box, I was using CDE. Ever use CDE? CDE is the reason people started looking in to window managers. So they could get away from it! OpenSolaris comes with Gnome, and it's nice. Nice like the Gnome that comes with Ubuntu. And they're both Live CDs.
If the OpenSolaris user experience is, within Δ, the Ubuntu user experience, why use OpenSolaris? You want to integrate into a huge Sun environment. You develop in Java or otherwise want to have your Sun-based development environment. You're used to Sun. Or you wish to prove your manhood by grappling with the OS that was the go-to Unix when Linus was in high school.
I almost have a use for the similar XP install on my desktop. I don't really have one for OpenSolaris yet. So, what do I use it for?
I have tried, at various points in time, to keep a Solaris x86 machine around — "But, Mom! It followed me home! Honest!" — but in the end, I always wiped it. That is, if I ever got the installation finished. Solaris has not been an easy installation.
This wasn't real. This was virtual. A virtual ISO sat in a fake CD-ROM drive and filled a phony chunk of memory full of OpenSolaris. I clicked "GO", moved to another desktop and beat my head on Catalyst and MySQL for a little while. Then, I moved back to the desktop and clicked OK, and it was done. I had my first stab at Solaris package management trying to install the "Guest" packages.
First time I sat behind a Solaris box, I was using CDE. Ever use CDE? CDE is the reason people started looking in to window managers. So they could get away from it! OpenSolaris comes with Gnome, and it's nice. Nice like the Gnome that comes with Ubuntu. And they're both Live CDs.
If the OpenSolaris user experience is, within Δ, the Ubuntu user experience, why use OpenSolaris? You want to integrate into a huge Sun environment. You develop in Java or otherwise want to have your Sun-based development environment. You're used to Sun. Or you wish to prove your manhood by grappling with the OS that was the go-to Unix when Linus was in high school.
I almost have a use for the similar XP install on my desktop. I don't really have one for OpenSolaris yet. So, what do I use it for?
2008/12/02
Reading the Documentation ....
My boss has a flatbed scanner he wants to work. An HP ScanJet 3670.
I tell you the model number so that you too can do what I have done, which is look up the XSane compatability list. You will find that the 3670 is explicitly listed as not working with XSane, which means ito be non-Linux-compliant.
So, my boss suggests I dual-boot the thing. And my other boss — Boss1 can hire and fire me, but Boss2 controls the hardware I deal with on a day-to-day basis — suggests I try VirtualBox, running XP in a virtual machine under Ubuntu. I'm happy to do this, as I would much rather have most of the user software running on Linux than Windows. That's the kind of guy I am.
This process is complicated by the Thanksgiving weekend, which means that all the people I need for getting XP install media (to run in the VirtualBox) are on vacation just when I need to do it. So, finally, I get my hands on install media, get everything running, and guess what!?!
VirtualBox OSE, the open source edition, has no USB support. None. None at all.
This makes me frown.
Want to know what made me smile?
The VirtualBox License.
You can use VirtualBox, the closed, feature-rich version, if you are
Like, for example, a research lab of a large land-grand university!
So, a little apt-get here and there and I have the real VirtualBox running.
Now I just have to convince the ScanJet to talk nice. I could still be setting up a dual-boot yet.
ETA: Adding this to your /etc/fstab and restarting helped a lot, too.
Assuming you add your users into that group. Thank you, noorez!
I tell you the model number so that you too can do what I have done, which is look up the XSane compatability list. You will find that the 3670 is explicitly listed as not working with XSane, which means ito be non-Linux-compliant.
So, my boss suggests I dual-boot the thing. And my other boss — Boss1 can hire and fire me, but Boss2 controls the hardware I deal with on a day-to-day basis — suggests I try VirtualBox, running XP in a virtual machine under Ubuntu. I'm happy to do this, as I would much rather have most of the user software running on Linux than Windows. That's the kind of guy I am.
This process is complicated by the Thanksgiving weekend, which means that all the people I need for getting XP install media (to run in the VirtualBox) are on vacation just when I need to do it. So, finally, I get my hands on install media, get everything running, and guess what!?!
VirtualBox OSE, the open source edition, has no USB support. None. None at all.
This makes me frown.
Want to know what made me smile?
The VirtualBox License.
You can use VirtualBox, the closed, feature-rich version, if you are
- Using it just for yourself
- Evaluating it for your company, or
- Part of an academic institution
Like, for example, a research lab of a large land-grand university!
So, a little apt-get here and there and I have the real VirtualBox running.
Now I just have to convince the ScanJet to talk nice. I could still be setting up a dual-boot yet.
ETA: Adding this to your /etc/fstab and restarting helped a lot, too.
none /proc/bus/usb usbfs devgid=[GUID of vboxusers],devmode=0666 0 0 Assuming you add your users into that group. Thank you, noorez!
2008/11/19
Rage Taking Over ....
The current job is to create an Electronic Lab Notebook. Basically, you need to be able to access it via the web, you need to be able to link to images and import tables from Excel and the like. I started doing wiki on a UseMod wiki, so when I started rolling my own, I looked to UseMod, which was abandoned, and then to OddMuse. OddMuse has a few things I like. It's modular, it's Perl, and you don't have to use a whole host of odd modules and root access to make it work.
So, when it came time to make an Electronic Lab Notebook, I thought wiki. I thought OddMuse Wiki.
There's an add-on for tables. There's an add-on for simple image linking.
But....
The suggested WSYWIG editor is FCKeditor. And "fck!" is pretty much how I'm feeling about said editor. Because it isn't writing acceptable output, and I do not for the life of me know why.
Either that, or it isn't interpreting the saved output once the page is rendered again.
Edited To Add: That was it. The outputted wiki-text was incompatable with the wiki, so by using a module that speaks that kind of output, I got it to work. Yay me.
Specifically, I used the Markup.pl extension, in case that helps someone.
Edited To Add: Using Markup.pl kills tables.
So, when it came time to make an Electronic Lab Notebook, I thought wiki. I thought OddMuse Wiki.
There's an add-on for tables. There's an add-on for simple image linking.
But....
The suggested WSYWIG editor is FCKeditor. And "fck!" is pretty much how I'm feeling about said editor. Because it isn't writing acceptable output, and I do not for the life of me know why.
Either that, or it isn't interpreting the saved output once the page is rendered again.
Edited To Add: That was it. The outputted wiki-text was incompatable with the wiki, so by using a module that speaks that kind of output, I got it to work. Yay me.
Specifically, I used the Markup.pl extension, in case that helps someone.
Edited To Add: Using Markup.pl kills tables.
2008/10/17
Praising The Monks....
One of the topics of conversation for the last Perl Mongers meetings was Strawberry Perl. We have one or two floating laptops around here, so I decided to try to pull the existing ActiveState Perl onboard and replace it with Strawberry.
It installed ... OK. No errors, no problems, but I found it difficult to call. I could do full path —
So, I Googled. And I followed the links into Perlmonks.
And they gave me the answer.
It was to someone else's question, but there was enough to make it work.
Dunno if I'd install it on work machines (this one's about one phone call to IT from replacement) but I think I'd probably go there for my own machines.
It installed ... OK. No errors, no problems, but I found it difficult to call. I could do full path —
c:\strawberry\perl\bin\perl myprog.pl — but they wouldn't come up as executable or even known things on the desktop or in Explorer.So, I Googled. And I followed the links into Perlmonks.
And they gave me the answer.
It was to someone else's question, but there was enough to make it work.
Dunno if I'd install it on work machines (this one's about one phone call to IT from replacement) but I think I'd probably go there for my own machines.
2008/07/29
Entering Guru Meditation ....
There's really two kinds of car computing. Computing while in the car, and computing about the car.
You could do any kind of computing in the car that you could do outside the car. Games, chat, browsing, email, playing music, reading your GPS, finding large primes, etc. This is the big place you're seeing a lot of growth. This is where Microsoft is working with Ford. The car computer will talk Bluetooth, handling your phone calls and reading tracks off your MP3 player. This is an interesting place, because car computing is either going to have to read off of car culture or computer culture.
Car culture is like this: You buy a car. It will last a few good years. It will take a few good years to pay off. And if you're still driving it ten or more years later, you can still get parts. And if you're still driving it twenty years later, you can still get parts. If it's in good shape, you can sell it for a decent amount. Old cars can be and are cool.
Computer culture is like this: You buy a computer. You own it for two years. At that time, the chip company has put out procs that are twice as fast, disc companies are making hard drives that may have as much as 10 times the storage. The video card industry might've gone to the next connector format, forcing replacement for your monitor. The hard drive industry might've gone to the next connector format, forcing replacement of your drives. Old computers are considered trash by all but the most geeky.
The big question is, how do you meld these cultures?
The questions, also big but ultimately smaller than and subsets of the above question, are as follows:
Ultimately, car computing is going to be a sub-industry or parallel industry to the car stereo industry. This is going to be an interesting thing, as it goes, but it does miss half the story. The other half of the story is computing about your car. You can read engine data via OBD II, which is built into all cars built since 1998. (I think...) What can you get from OBD II data? Honestly, I have little clue. The guys at AutoZone who plug in to read your check engine light, he uses a gadget that talks this protocol. But it isn't and shouldn't be limited to that.
Because I'm not (yet) really sure what's all there and why you'd want to know. Drivers get speed, tach, engine heat, and a few more, plus some warning lights. Do you really need pre- and post-converter oxygen sensors? If your car needs to pass an emissions test, sure. But there are a few point I could see hacking, even before I begin to study the essentials of internal combustion.
I am sure that my car is lying to me. I drive 130 miles a day, 65 there and back, to go to work. I fill up the tank on the first day, it's still reading full when I get to work, about 90% when I get back, 60% when I get to work again, then 40% when I get back home. This is not linear. Therefore, this is not accurate. My GPS says I'm at 53 when my speedometer says I'm at 55, which might just be a small tweak, but the gas gauge thing is enough to make me think.
Autotap is one place you can go to get the hardware and software you need. I know there's open source software to deal with this, but the hardware is the iffy point. But, assuming things go well with the initial pass on car computers, I'm sure that they'll have ODB II interfaces built in.
So that's reading the car information. What about writing?
Cars are computers, too. I had an ECU go bad on a car I used to drive. A 1988 Mercury Talon. 20 years ago, cars were computers. There's a market for people to swap out the ECUs of their cars. It's part of hot-rodding them today, and I don't have much more than the sketchiest idea of how it works. But, while I'm pretty sure it'll void my warranty, I still want to know how that works, because that's where car computing becomes interesting.
You could do any kind of computing in the car that you could do outside the car. Games, chat, browsing, email, playing music, reading your GPS, finding large primes, etc. This is the big place you're seeing a lot of growth. This is where Microsoft is working with Ford. The car computer will talk Bluetooth, handling your phone calls and reading tracks off your MP3 player. This is an interesting place, because car computing is either going to have to read off of car culture or computer culture.
Car culture is like this: You buy a car. It will last a few good years. It will take a few good years to pay off. And if you're still driving it ten or more years later, you can still get parts. And if you're still driving it twenty years later, you can still get parts. If it's in good shape, you can sell it for a decent amount. Old cars can be and are cool.
Computer culture is like this: You buy a computer. You own it for two years. At that time, the chip company has put out procs that are twice as fast, disc companies are making hard drives that may have as much as 10 times the storage. The video card industry might've gone to the next connector format, forcing replacement for your monitor. The hard drive industry might've gone to the next connector format, forcing replacement of your drives. Old computers are considered trash by all but the most geeky.
The big question is, how do you meld these cultures?
The questions, also big but ultimately smaller than and subsets of the above question, are as follows:
- How long until there's statutes against using AIM and the like while driving?
- People take time to customize their user environments, especially with computers. How do you set your car up for different users?
- People break into cars and take stereos all the time. How will in-car computers be made theftproof?
- Your car speaks Bluetooth, so your gadgets can talk to it and do what you want them to do. Then tech changes, and the next revision of the Bluetooth protocol comes out, and your new gadgets change but your car doesn't. What happens then? Is a networking card upgrade a warranty issue?
Ultimately, car computing is going to be a sub-industry or parallel industry to the car stereo industry. This is going to be an interesting thing, as it goes, but it does miss half the story. The other half of the story is computing about your car. You can read engine data via OBD II, which is built into all cars built since 1998. (I think...) What can you get from OBD II data? Honestly, I have little clue. The guys at AutoZone who plug in to read your check engine light, he uses a gadget that talks this protocol. But it isn't and shouldn't be limited to that.
Because I'm not (yet) really sure what's all there and why you'd want to know. Drivers get speed, tach, engine heat, and a few more, plus some warning lights. Do you really need pre- and post-converter oxygen sensors? If your car needs to pass an emissions test, sure. But there are a few point I could see hacking, even before I begin to study the essentials of internal combustion.
I am sure that my car is lying to me. I drive 130 miles a day, 65 there and back, to go to work. I fill up the tank on the first day, it's still reading full when I get to work, about 90% when I get back, 60% when I get to work again, then 40% when I get back home. This is not linear. Therefore, this is not accurate. My GPS says I'm at 53 when my speedometer says I'm at 55, which might just be a small tweak, but the gas gauge thing is enough to make me think.
Autotap is one place you can go to get the hardware and software you need. I know there's open source software to deal with this, but the hardware is the iffy point. But, assuming things go well with the initial pass on car computers, I'm sure that they'll have ODB II interfaces built in.
So that's reading the car information. What about writing?
Cars are computers, too. I had an ECU go bad on a car I used to drive. A 1988 Mercury Talon. 20 years ago, cars were computers. There's a market for people to swap out the ECUs of their cars. It's part of hot-rodding them today, and I don't have much more than the sketchiest idea of how it works. But, while I'm pretty sure it'll void my warranty, I still want to know how that works, because that's where car computing becomes interesting.
2008/07/18
This message was sent using the Picture and Video Messaging service from Verizon Wireless!
To learn how you can snap pictures and capture videos with your wireless phone visit www.verizonwireless.com/picture.
To play video messages sent to email, QuickTime® 6.5 or higher is required. Visit www.apple.com/quicktime/download to download the free player or upgrade your existing QuickTime® Player. Note: During the download process when asked to choose an installation type (Minimum, Recommended or Custom), select Minimum for faster download.
2008/05/16
Subscribe to:
Posts (Atom)
